Commit graph

8 commits

Author SHA1 Message Date
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00
Alexander Barkov
91ee98a8c8 MDEV-7807 information_schema.processlist truncates queries with binary strings
Adding a new column INFORMATION_SCHEMA.PROCESSLIST.INFO_BINARY.
2015-05-08 00:34:06 +04:00
Kristian Nielsen
00649525ee MDEV-7189: main.processlist fails sporadically in buildbot
The test case tried to trigger a DEBUG_SYNC point at the end of a SELECT
SLEEP(5) statement. It did this by using EXECUTE 2, intending to trigger first
at the end of SET DEBUG_SYNC, and second at the end of the SELECT SLEEP(5).

However, in --ps-protocol mode, this does not work, because the SELECT is
executed in two steps (Prepare followed by Execute). Thus, the DEBUG_SYNC got
triggered too early, during the Prepare stage rather than Execute, and the
test case could race and information_schema.processlist see the thread in the
wrong state.

This patch fixes by changing the way the DEBUG_SYNC point is triggered. Now we
add a DBUG injection inside the code for SLEEP(5). This ensures that the
DEBUG_SYNC point is not activated until the SLEEP(5) is running, ensuring
that the following wait for completion will be effective.
2015-01-06 16:32:41 +01:00
Kristian Nielsen
bad5fdec18 Fix sporadic test failure in main.processlist
The test runs a query in one thread, then in another queries the processlist
and expects to find the first thread in the COM_SLEEP state. The problem is
that the thread signals completion to the client before changing to COM_SLEEP
state, so there is a window where the other thread can see the wrong state.

A previous attempt to fix this was ineffective. It set a DEBUG_SYNC to handle
proper waiting, but unfortunately that DEBUG_SYNC point ended up triggering
already at the end of SET DEBUG_SYNC=xxx, so the wait was ineffective.

Fix it properly now (hopefully) by ensuring that we wait for the DEBUG_SYNC
point to trigger at the end of the SELECT SLEEP(), not just at the end of
SET DEBUG_SYNC=xxx.
2014-10-31 12:48:17 +01:00
Kristian Nielsen
64af1ecc20 Fix two races in test main.processlist that could cause random failures (seen in Buildbot)
1. Do not use NULL `info' field in processlist to select the thread of
interest. This can fail if the read of processlist ends up happening after
REAP succeeds, but before the `info' field is reset. Instead, select on the
CONNECTION_ID(), making sure we still scan the whole list to trigger the same
code as in the original test case.

2. Wait for the query to really complete before reading it in the
processlist. When REAP returns, it only means that ack has been sent to
client, the reset of query stage happens a bit later in the code.
2014-10-22 13:51:33 +02:00
Sergei Golubchik
ebaac51c2f mtr: check that tests clean up debug_sync. fix tests that didn't. 2014-01-27 12:10:53 +01:00
Sergei Golubchik
03c71ff2ba MDEV-4683 query start_time not reset when going to sleep 2013-07-01 12:02:44 +02:00
Sergei Golubchik
85a8de31b1 MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
SHOW PROCESSLIST might see a thread that started executing a query *after*
processlist has started. Don't show a negative or huge wrapped-around query execution time.
2013-06-13 20:19:32 +02:00