Server IP : 185.86.78.101 / Your IP : 216.73.216.213 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 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 : OFF Directory : /www/server/mysql/mysql-test/r/ |
Upload File : |
SET @query_cache_type= @@global.query_cache_type; Warnings: Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release. SET @query_cache_limit= @@global.query_cache_limit; Warnings: Warning 1287 '@@query_cache_limit' is deprecated and will be removed in a future release. SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit; Warnings: Warning 1287 '@@query_cache_min_res_unit' is deprecated and will be removed in a future release. SET @query_cache_size= @@global.query_cache_size; Warnings: Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release. # Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock # Establish connections user1,user2,user3 (user=root) # Switch to connection user1 SET GLOBAL query_cache_type=1; Warnings: Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release. SET GLOBAL query_cache_limit=10000; Warnings: Warning 1287 '@@query_cache_limit' is deprecated and will be removed in a future release. SET GLOBAL query_cache_min_res_unit=0; Warnings: Warning 1287 '@@query_cache_min_res_unit' is deprecated and will be removed in a future release. SET GLOBAL query_cache_size= 102400; Warnings: Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release. FLUSH TABLES; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (1),(2),(3); # Switch to connection user2 LOCK TABLE t2 WRITE; # Switch to connection user1 # "send" the next select, "reap" the result later. # The select will be blocked by the write lock on the t1. SELECT *, (SELECT COUNT(*) FROM t2) FROM t1; # Switch to connection user3 # Poll till the select of connection user1 is blocked by the write lock on t1. SELECT user,command,state,info FROM information_schema.processlist WHERE state = 'Waiting for table metadata lock' AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1'; user command state info root Query Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1 INSERT INTO t1 VALUES (4); # Switch to connection user2 UNLOCK TABLES; # Switch to connection user1 # Collecting ("reap") the result from the previously blocked select. # The printing of the result (varies between 3 and 4 rows) set has to be suppressed. # Switch to connection user3 # The next select enforces that effects of "concurrent_inserts" like the # record with a = 4 is missing in result sets can no more happen. SELECT 1 FROM t1 WHERE a = 4; 1 1 # Switch to connection user1 # The next result set must contain 4 rows. SELECT *, (SELECT COUNT(*) FROM t2) FROM t1; a (SELECT COUNT(*) FROM t2) 1 0 2 0 3 0 4 0 RESET QUERY CACHE; Warnings: Warning 1681 'RESET QUERY CACHE' is deprecated and will be removed in a future release. SELECT *, (SELECT COUNT(*) FROM t2) FROM t1; a (SELECT COUNT(*) FROM t2) 1 0 2 0 3 0 4 0 DROP TABLE t1,t2; # Switch to connection default + close connections user1,user2,user3 SET GLOBAL query_cache_type= @query_cache_type; Warnings: Warning 1287 '@@query_cache_type' is deprecated and will be removed in a future release. SET GLOBAL query_cache_limit= @query_cache_limit; Warnings: Warning 1287 '@@query_cache_limit' is deprecated and will be removed in a future release. SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit; Warnings: Warning 1287 '@@query_cache_min_res_unit' is deprecated and will be removed in a future release. SET GLOBAL query_cache_size= @query_cache_size; Warnings: Warning 1287 '@@query_cache_size' is deprecated and will be removed in a future release.