403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.68.164.105
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/perfschema/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/perfschema/t/global_read_lock.test
# Tests for PERFORMANCE_SCHEMA
#
# Test the effect of a flush tables with read lock on setup_ tables.

--source include/not_embedded.inc
--source include/have_perfschema.inc

use performance_schema;

# Make test robust against errors in other tests.
# Ensure that instrumentation is turned on when we create new connection.
update performance_schema.setup_instruments set enabled='YES';

set @orig_sql_mode= @@sql_mode;
set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
set sql_mode= @orig_sql_mode;
flush privileges;

--echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);

lock tables performance_schema.setup_instruments read;
--disable_result_log
select * from performance_schema.setup_instruments;
--enable_result_log
unlock tables;

lock tables performance_schema.setup_instruments write;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
unlock tables;

--echo connection default;
connection default;

flush tables with read lock;

--echo connection con1;
connection con1;

lock tables performance_schema.setup_instruments read;
--disable_result_log
select * from performance_schema.setup_instruments;
--enable_result_log
unlock tables;

# This will block
--send
lock tables performance_schema.setup_instruments write;

--echo connection default;
connection default;

let $wait_condition= select 1 from performance_schema.events_waits_current where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";

--source include/wait_condition.inc

# Observe the blocked thread in the performance schema :)
select event_name,
  left(source, locate(":", source)) as short_source,
  if(timer_end IS NULL, NULL, "SET") as timer_end,
  if(timer_wait IS NULL, NULL, "SET") as timer_wait,
  operation
  from performance_schema.events_waits_current
  where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";

unlock tables;

connection con1;
--reap

update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
unlock tables;

disconnect con1;
--source include/wait_until_disconnected.inc

--echo connection default;
connection default;

drop user pfsuser@localhost;
flush privileges;


Youez - 2016 - github.com/yon3zu
LinuXploit