diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-07-31 08:48:14 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-07-31 09:27:53 +0200 |
commit | 2cdf8a932737f5128004742cafbd3d3bb1df14a2 (patch) | |
tree | 8a9e60decd2997ca36ce05b43744b47eaa749dd4 /mysql-test | |
parent | 22709897b06331fad4660739be37773077d25d62 (diff) | |
download | mariadb-git-2cdf8a932737f5128004742cafbd3d3bb1df14a2.tar.gz |
MDEV-23752 SHOW EXPLAIN FOR thd waits for sleep
fix main.processlist_notembedded test
* before EXPLAINing `select sleep` wait for select to start
(fixes "Target is not running an EXPLAINable command")
* after killing sleep, wait for it to die
(fixes test failures on --repeat when old sleep shows on a test rerun)
* unify with 10.3, copy minor changes from there
(`--echo End of 5.5` vs `--echo # End of 5.5`, etc)
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/processlist_notembedded.result | 17 | ||||
-rw-r--r-- | mysql-test/t/processlist_notembedded.test | 27 |
2 files changed, 25 insertions, 19 deletions
diff --git a/mysql-test/r/processlist_notembedded.result b/mysql-test/r/processlist_notembedded.result index ddde45f3031..46b1f0669cb 100644 --- a/mysql-test/r/processlist_notembedded.result +++ b/mysql-test/r/processlist_notembedded.result @@ -1,7 +1,7 @@ # # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes # -connect con1,localhost,root,,; +connect con1,localhost,root; connection con1; SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; connection default; @@ -13,17 +13,22 @@ user disconnect con1; connection default; SET DEBUG_SYNC = 'RESET'; -End of 5.5 tests +# +# End of 5.5 tests +# # # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep # -connect con1,localhost,root,,; -select sleep(100000);; +connect con1,localhost,root; +select sleep(100000); connection default; -SHOW EXPLAIN FOR con_id; +SHOW EXPLAIN FOR $con_id; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select sleep(100000) -KILL QUERY con_id; +KILL QUERY $con_id; +disconnect con1; +# # End of 10.2 tests +# diff --git a/mysql-test/t/processlist_notembedded.test b/mysql-test/t/processlist_notembedded.test index 26021040c39..35cac36bb95 100644 --- a/mysql-test/t/processlist_notembedded.test +++ b/mysql-test/t/processlist_notembedded.test @@ -1,4 +1,3 @@ -source include/have_debug.inc; source include/have_debug_sync.inc; source include/not_embedded.inc; source include/count_sessions.inc; @@ -7,7 +6,7 @@ source include/count_sessions.inc; --echo # MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes --echo # -connect (con1,localhost,root,,); +connect con1,localhost,root; connection con1; @@ -37,24 +36,26 @@ connection default; SET DEBUG_SYNC = 'RESET'; -source include/wait_until_count_sessions.inc; - ---echo End of 5.5 tests +--echo # +--echo # End of 5.5 tests +--echo # --echo # --echo # MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep --echo # ---connect (con1,localhost,root,,) +--connect con1,localhost,root --let $con_id = `SELECT CONNECTION_ID()` ---send select sleep(100000); +--send select sleep(100000) --connection default +let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist where state='User sleep'; +source include/wait_condition.inc; +evalp SHOW EXPLAIN FOR $con_id; +evalp KILL QUERY $con_id; +disconnect con1; +source include/wait_until_count_sessions.inc; ---replace_result $con_id con_id -eval SHOW EXPLAIN FOR $con_id; - ---replace_result $con_id con_id -eval KILL QUERY $con_id; - +--echo # --echo # End of 10.2 tests +--echo # |