diff options
Diffstat (limited to 'mysql-test/t/max_user_connections_func.test')
-rw-r--r-- | mysql-test/t/max_user_connections_func.test | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/mysql-test/t/max_user_connections_func.test b/mysql-test/t/max_user_connections_func.test new file mode 100644 index 00000000000..21bea82ad77 --- /dev/null +++ b/mysql-test/t/max_user_connections_func.test @@ -0,0 +1,93 @@ +############# mysql-test\t\max_user_connections_func.test #################### +# # +# Variable Name: max_user_connections # +# Scope: SESSION # +# Access Type: Dynamic # +# Data Type: NUMERIC # +# Default Value: - # +# Values: 1-4294967295 # +# # +# # +# Creation Date: 2008-03-02 # +# Author: Sharique Abdullah # +# # +# Description: Test Cases of Dynamic System Variable "max_user_connections # +# that checks behavior of this variable in the following ways # +# * Functionality based on different values # +# # +#Reference:http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html +# option_mysqld_max_user_connections # +# # +############################################################################## + +--echo ** Setup ** +--echo +# +# Setup +# + +SET @default_max_user_connections = @@max_user_connections; + + +################################### +#Setting value max_user_connection# +################################### + +Set Global max_user_connections=2; + + + +--echo '#--------------------FN_DYNVARS_114_01-------------------------#' +####################################### +#should not make more then 2 connection# +####################################### + + +--echo ** Connecting conn1 using username 'root' ** +CONNECT (conn1,localhost,root,,); + +--echo ** Connecting conn2 using username 'root' ** +CONNECT (conn2,localhost,root,,); + +--echo ** Connecting conn3 using username 'root' ** +--disable_query_log +--Error ER_TOO_MANY_USER_CONNECTIONS +CONNECT (conn3,localhost,root,,); +--enable_query_log +--echo Expected error "too many connections" + +--echo ** Disconnecting conn1 ** +DISCONNECT conn1; + + + + +--echo '#--------------------FN_DYNVARS_114_02-------------------------#' +##################################################### +#set value to 3 and see if 3 connections can be made# +##################################################### + + +Set Global max_user_connections=3; +--echo ** Connecting conn5 using username 'root' ** +CONNECT (conn5,localhost,root,,); +--echo ** Connecting conn6 using username 'root' ** +CONNECT (conn6,localhost,root,,); + + +# +# Cleanup +# + +--echo ** Connection default ** +CONNECTION default; + +--echo ** Disconnecting conn5, conn6 ** +DISCONNECT conn2; +DISCONNECT conn5; +DISCONNECT conn6; + +SET GLOBAL max_user_connections = @default_max_user_connections; + +--disable_info +--enable_warnings |