summaryrefslogtreecommitdiff
path: root/mysql-test/t/user_limits.test
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2005-01-20 00:54:01 +0300
committerunknown <dlenev@brandersnatch.localdomain>2005-01-20 00:54:01 +0300
commit1f6070a4b992a9e09ced0e3ec495e05f9e989fd5 (patch)
tree4f4ff97c5b4b9d78a131d1adb1230a438c496eb4 /mysql-test/t/user_limits.test
parent628804d9348afdbe489d259de4ac625651a0c2ef (diff)
downloadmariadb-git-1f6070a4b992a9e09ced0e3ec495e05f9e989fd5.tar.gz
Fix for bug #7637: "Test failure: 'user_limits' on QNX and 64-bit systems"
Made user_limits.test scheduling independant (this solves failure on QNX). Made sys_var_max_user_conn variable int sized. Changed max_user_connections from ulong to uint to be able to use it in sys_var_max_user_conn::value_ptr() (solves failures on 64-bit platforms). mysql-test/r/user_limits.result: Made test scheduling independant. mysql-test/t/user_limits.test: Made test scheduling independant. sql/mysql_priv.h: Made max_user_connections to be the same size as USER_RESOURCES::user_conn (to be able to use them in sys_var_max_user_conn::value_ptr()). sql/mysqld.cc: Made max_user_connections to be the same size as USER_RESOURCES::user_conn (to be able to use them in sys_var_max_user_conn::value_ptr()). sql/set_var.cc: sys_var::item(): Added support for int system variables. sql/set_var.h: Made sys_var_max_user_conn to be int sized variable.
Diffstat (limited to 'mysql-test/t/user_limits.test')
-rw-r--r--mysql-test/t/user_limits.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test
index 50c16e5e114..729894a588a 100644
--- a/mysql-test/t/user_limits.test
+++ b/mysql-test/t/user_limits.test
@@ -19,6 +19,8 @@ flush privileges;
# Test of MAX_QUERIES_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
+# This ensures that counters are reset and makes test scheduling independent
+flush user_resources;
connect (mqph, localhost, mysqltest_1,,);
connection mqph;
select * from t1;
@@ -37,6 +39,7 @@ disconnect mqph2;
# Test of MAX_UPDATES_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
+flush user_resources;
connect (muph, localhost, mysqltest_1,,);
connection muph;
select * from t1;
@@ -60,6 +63,7 @@ disconnect muph2;
# Test of MAX_CONNECTIONS_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
+flush user_resources;
connect (mcph1, localhost, mysqltest_1,,);
connection mcph1;
select * from t1;
@@ -86,6 +90,7 @@ drop user mysqltest_1@localhost;
# We need this to reset internal mqh_used variable
flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
+flush user_resources;
connect (muc1, localhost, mysqltest_1,,);
connection muc1;
select * from t1;
@@ -102,6 +107,7 @@ select * from t1;
# Changing of limit should also help (and immediately)
connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
+flush user_resources;
connect (muc4, localhost, mysqltest_1,,);
connection muc4;
select * from t1;
@@ -127,6 +133,7 @@ set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections;
# Let us check that global limit works
grant usage on *.* to mysqltest_1@localhost;
+flush user_resources;
connect (muca1, localhost, mysqltest_1,,);
connection muca1;
select @@session.max_user_connections, @@global.max_user_connections;
@@ -139,6 +146,7 @@ connect (muca3, localhost, mysqltest_1,,);
# Now we are testing that per-account limit prevails over gloabl limit
connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
+flush user_resources;
connect (muca3, localhost, mysqltest_1,,);
connection muca3;
select @@session.max_user_connections, @@global.max_user_connections;