Server IP : 172.67.216.182 / Your IP : 108.162.227.64 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 : |
--source include/not_embedded.inc --echo # --echo # Variable name : session_track_system_variables --echo # Scope : Global & Session --echo # --echo # Global - default SELECT @@global.session_track_system_variables; --echo # Session - default SELECT @@session.session_track_system_variables; --echo --echo # via INFORMATION_SCHEMA.GLOBAL_VARIABLES --disable_warnings SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track%' ORDER BY VARIABLE_NAME; --enable_warnings --echo # via INFORMATION_SCHEMA.SESSION_VARIABLES --disable_warnings SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track%' ORDER BY VARIABLE_NAME; --enable_warnings # Save the global value to be used to restore the original value. SET @global_saved_tmp = @@global.session_track_system_variables; --echo --echo # Altering global variable's value SET @@global.session_track_system_variables='autocommit'; SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Altering session variable's value SET @@session.session_track_system_variables='autocommit'; SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Variables' values in a new session. connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,); --echo # Global - expect "autocommit" SELECT @@global.session_track_system_variables; --echo --echo # Session - expect "autocommit" SELECT @@session.session_track_system_variables; --echo --echo # Switching to the default connection. connection default; SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Test if DEFAULT is working as expected. SET @@global.session_track_system_variables = DEFAULT; SET @@session.session_track_system_variables = DEFAULT; --echo SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Variables' values in a new session (con2). connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,); SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Altering session should not affect global. SET @@session.session_track_system_variables = 'sql_mode'; SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Variables' values in a new session (con3). connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,); --echo # Altering global should not affect session. SET @@global.session_track_system_variables = 'sql_mode'; SELECT @@global.session_track_system_variables; SELECT @@session.session_track_system_variables; --echo --echo # Switching to the default connection. connection default; --echo # Testing NULL SET @@global.session_track_system_variables = NULL; SET @@session.session_track_system_variables = NULL; --echo # Global - expect NULL SELECT @@global.session_track_system_variables; --echo # Session - expect NULL SELECT @@session.session_track_system_variables; --echo # testing with duplicate entries (must fail). # Lets first set it to some valid value. SET @@global.session_track_system_variables= "time_zone"; SET @@session.session_track_system_variables= "time_zone"; # Now set with duplicate entries (must fail). --error ER_DUP_LIST_ENTRY SET @@global.session_track_system_variables= "sql_mode,sql_mode"; --error ER_DUP_LIST_ENTRY SET @@session.session_track_system_variables= "sql_mode,sql_mode"; --echo # Global - must remain unchanged, 'time_zone' SELECT @@global.session_track_system_variables; --echo # Session - must remain unchanged, 'time_zone' SELECT @@session.session_track_system_variables; --echo --echo # Restoring the original values. SET @@global.session_track_system_variables = @global_saved_tmp; --echo # End of tests.