403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.71.124.54
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/sys_vars/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/sys_vars/t/max_user_connections_func.test
############# 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                                         #
#                                                                            #
# Modified: 2008-07-10 HHUNGER: Inserted wait condition                      #
#                                                                            #
##############################################################################

--echo ** Setup **
--echo
#
# Setup
#

--source include/not_embedded.inc

SET @default_max_user_connections = @@global.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 ** Poll till disconnected conn1 disappears from processlist
let $wait_condition= SELECT count(id) <= 2
   FROM information_schema.processlist WHERE user = 'root';
--source include/wait_condition.inc

--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;


Youez - 2016 - github.com/yon3zu
LinuXploit