Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL)
-
None
-
None
Description
While writing MTR tests of procedure code, it's sometimes necessary to expect the current connection/thread to be killed.
I've been using the following in my MTR .test files:
--error ER_CONNECTION_KILLED
|
call PROCEDURE_THAT_WILL_CAUSE_THIS_CONNECTION_TO_DIE();
|
However, this occasionally results in tests failing
mysqltest: At line X, PROCEDURE_THAT_WILL_CAUSE_THIS_CONNECTION_TO_DIE() failed with wrong errno 2013: 'Lost connection to MySQL server during query', instead of 1927...
|
- The error ER_CONNECTION_KILLED (= 1927) is #define d in mysqld_error.h (https://github.com/mariadb-corporation/mariadb-connector-c/blob/HEAD/include/mysqld_error.h#L918), but the error 2013 is not named anywhere in the server code.
- The error 2013 is not defined anywhere that I can find in the MariaDB server repository; however it is described as a "client error" in
https://github.com/mariadb-corporation/mariadb-connector-c/blob/HEAD/libmariadb/ma_errmsg.c#L43). - Many existing MTR tests use --error 2013, ER_CONNECTION_KILLED (e.g. main/processlist.test) but others use only --error ER_CONNECTION_KILLED (e.g. main/kill.test), or only --error 2013.
It would be useful to have clarity on when/why an MTR test can sometimes fail with error 2013 instead of error 1927/ER_CONNECTION_FAILED.
- Is this a consequence of server- vs client-side timing of when the lost connection is detected?
- Is there a way to ensure we consistently get only one result, and not the other?
- If the variation is truly unavoidable, shouldn't all tests with --error ER_CONNECTION_KILLED also allow for --error 2013?