403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/storage_engine/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/storage_engine/select_high_prio.test
# 
# SELECT HIGH_PRIOIRITY
#
--source have_engine.inc

--source include/count_sessions.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

# We will have 3 connections: 
#   con1 will lock a table in READ mode
#   con0 will run UPDATE (and will wait on the lock)
#   con2 will start another SELECT
#   con1 will then unlock the table
#
#   With standard SELECT we should see updated rows in the 2nd result set,
#   while with SELECT HIGH_PRIORITY we should still see only old rows in con2 resultset 
# (and it shouldn't wait till the table is unlocked and UPDATE is executed).

--connect (con0,localhost,root,,)
SET lock_wait_timeout = 4;
--connect (con1,localhost,root,,)
SET lock_wait_timeout = 4;
--connect (con2,localhost,root,,)
SET lock_wait_timeout = 4;


# Part 1: Standard SELECT 
#         should be executed after the UPDATE

--source create_table.inc
INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b');

--connection con1
LOCK TABLE t1 READ;

--connection con0
--send
UPDATE t1 SET b = CONCAT(b,b);

--connection con2
let $show_statement = SHOW PROCESSLIST;
let $field = State;
let $condition = LIKE 'Waiting for table%';
let $wait_timeout = 2;
--source include/wait_show_condition.inc
--send
SELECT a,b FROM t1;

--connection con1
let $show_statement = SHOW PROCESSLIST;
let $field = Info;
let $condition = = 'SELECT a,b FROM t1';
let $wait_timeout = 2;
--source include/wait_show_condition.inc
if (!$found)
{
  --let $mysql_errname = timeout in wait_show_condition.inc
  --let $functionality = Table locking or UPDATE
  --source unexpected_result.inc
}

UNLOCK TABLES;

--connection con0
--reap
if ($mysql_errname)
{
  --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b)
  --let $functionality = UPDATE
  --source unexpected_result.inc
}

--connection con2
--echo # Should return the new data
--sorted_result
--reap

DROP TABLE t1;


# Part 2: SELECT HIGH_PRIORITY
#         should be executed before the UPDATE

--source create_table.inc
INSERT INTO t1 (a,b) VALUES (1,'f'),(2,'b');

--connection con1
LOCK TABLE t1 READ;

--connection con0
--send
UPDATE t1 SET b = CONCAT(b,b,b);

--connection con2
let $condition = LIKE 'Waiting for table%';
let $field = State;
let $wait_timeout = 2;
--source include/wait_show_condition.inc
SET lock_wait_timeout = 1;
--echo # Should return old data
--sorted_result
SELECT HIGH_PRIORITY * FROM t1;
if ($mysql_errname)
{
  --let $functionality = SELECT HIGH_PRIORITY
  --source unexpected_result.inc
}

--connection con1
UNLOCK TABLES;

--connection con0
--reap
if ($mysql_errname)
{
  --let $my_last_stmt = UPDATE t1 SET b = CONCAT(b,b,b)
  --let $functionality = UPDATE
  --source unexpected_result.inc
}

--disconnect con1
--disconnect con2
--disconnect con0
let $wait_timeout = 30;

--connection default

# Cleanup
DROP TABLE t1;

--source include/wait_until_count_sessions.inc

--source cleanup_engine.inc


Youez - 2016 - github.com/yon3zu
LinuXploit