• Kristian Nielsen's avatar
    MDEV-7189: main.processlist fails sporadically in buildbot · 00649525
    Kristian Nielsen authored
    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.
    00649525
mysql-test-run.pl 189 KB