403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.68.164.120
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/wait_timeout_func.test
###############################################################################
#                                                                             #
# Variable Name: wait_timeout                                                 #
# Scope: GLOBAL | SESSION                                                     #
# Access Type: Dynamic                                                        #
# Data Type: numeric                                                          #
# Default Value:                                                              #
# Range:                                                                      #
#                                                                             #
#                                                                             #
# Creation Date: 2008-03-07                                                   #
# Author:  Salman Rawala                                                      #
#                                                                             #
# Modified: HHunger 2008-08-27 Simplified the test and replaced the sleeps.   #
#                                                                             #
# Description: Test Cases of Dynamic System Variable wait_timeout             #
#              that checks the functionality of this variable                 #
#                                                                             #
# Reference:                                                                  #
#  http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html        #
#                                                                             #
###############################################################################

--source include/not_embedded.inc
--source include/not_threadpool.inc

SET @start_value= @@global.wait_timeout;


--echo '#--------------------FN_DYNVARS_186_01-------------------------#'
#######################################################################
# 1. test of scope session
#######################################################################

SET @start_time= UNIX_TIMESTAMP();
--echo connect (test_con1, localhost, root,,);
connect (test_con1, localhost, root,,);
connection test_con1;

# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';

# Find a small value <> @@global.wait_timeout.
let $session_value =
`SELECT IF(@@global.wait_timeout <> 2 OR @@global.wait_timeout IS NULL, 2, 3)`;
--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value;

--echo connect (test_con2, localhost, root,,);
connect (test_con2, localhost, root,,);
connection test_con2;

--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value - 1;

--echo connection default;
connection default;

--echo wait until connections ready
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
SELECT info FROM information_schema.processlist;

--echo '#--------------------FN_DYNVARS_186_03-------------------------#'
#######################################################################
# 2. test of scope global
#######################################################################

# Find a small value <> @@global.wait_timeout.
let $global_value = $session_value + 1;
--replace_result $global_value <global_value>
eval SET @@global.wait_timeout= $global_value;

# Changing the @@global.wait_timeout has no influence on the
# @@session.wait_timeout of already established sessions.
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';

--echo connect (test_con3, localhost, root,,);
connect (test_con3, localhost, root,,);
connection test_con3;

# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';

--echo connection default;
connection default;
# We can be sure that the connections test_con1 and test_con2 must be
# established because both have already executed a SET @@session.wait_timeout.
# This means they are or at least were visible within the processlist.
# Therefore we can now simply wait till both disappear from the processlist.
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
SELECT info FROM information_schema.processlist;

--replace_result $global_value <global_value> $session_value <session_value>;
eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value;
SET @@global.wait_timeout= @start_value;


Youez - 2016 - github.com/yon3zu
LinuXploit