| 1 |
## Test case reproducing issue described under Bug#31931873 |
| 2 |
|
| 3 |
--source include/count_sessions.inc |
| 4 |
--source include/have_debug_sync.inc |
| 5 |
--source include/xplugin_preamble.inc |
| 6 |
--source include/xplugin_create_user.inc |
| 7 |
|
| 8 |
## Test case description: |
| 9 |
--echo ## I. Validate the fix for the bug. The issue occures between two |
| 10 |
--echo ## session, where one shows X Plugins status variables, second |
| 11 |
--echo ## triggers reauthentication |
| 12 |
--echo # |
| 13 |
--echo # 1. Create classic session (S2), show any X Plugins status variable |
| 14 |
--echo # 2. Create X Protocol session (S1), which triggers reauthentication |
| 15 |
--echo # 3. Synchronize S1 and S2, in a way that triggers the issue |
| 16 |
--echo # |
| 17 |
--echo |
| 18 |
|
| 19 |
|
| 20 |
## Test starts here |
| 21 |
|
| 22 |
# SQL FOR SYNCHRONIZATION OF TWO SESSIONS |
| 23 |
--let $sql_synchronize_sessions= $MYSQL_TMP_DIR/mutexes1.xpl |
| 24 |
--write_file $sql_synchronize_sessions |
| 25 |
SET DEBUG_SYNC= 'now WAIT_FOR reached_is_handled_by_thd'; |
| 26 |
SET DEBUG_SYNC= 'now WAIT_FOR reached_create_session_locked'; |
| 27 |
SET DEBUG_SYNC= 'now SIGNAL continue_create_session_locked'; |
| 28 |
SET DEBUG_SYNC= 'now SIGNAL continue_is_handled_by_thd'; |
| 29 |
EOF |
| 30 |
|
| 31 |
# SQL FOR TRIGGERING THE ISSUE ON S2 |
| 32 |
--let $sql_trigger_issue_S2= $MYSQL_TMP_DIR/mutexes2.xpl |
| 33 |
--write_file $sql_trigger_issue_S2 |
| 34 |
SET DEBUG_SYNC= 'syncpoint_is_handled_by_thd SIGNAL reached_is_handled_by_thd WAIT_FOR continue_is_handled_by_thd'; |
| 35 |
show status like "Mysqlx_sessions" |
| 36 |
EOF |
| 37 |
|
| 38 |
# X PROTOCOL PART OF THE ISSUE (TRIGGER ON S1) |
| 39 |
--let $xtest_file= $MYSQL_TMP_DIR/mutexes.xpl |
| 40 |
--write_file $xtest_file |
| 41 |
|
| 42 |
SET DEBUG_SYNC= 'syncpoint_create_session_locked SIGNAL reached_create_session_locked WAIT_FOR continue_create_session_locked'; |
| 43 |
env %MASTER_MYPORT% MASTER_MYPORT; |
| 44 |
env %MYSQL% MYSQL; |
| 45 |
|
| 46 |
echo; |
| 47 |
echo #; |
| 48 |
echo # I.1; |
| 49 |
# Trigger issue on Session2 (S2) |
| 50 |
system_in_background %MYSQL% |
| 51 |
-P %MASTER_MYPORT% |
| 52 |
--protocol tcp |
| 53 |
-u x_root |
| 54 |
-h localhost |
| 55 |
test < %SQL_FILE2%; |
| 56 |
|
| 57 |
echo; |
| 58 |
echo #; |
| 59 |
echo # I.2; |
| 60 |
# Trigger issue on Session1 (S1) |
| 61 |
Mysqlx.Session.Close{ |
| 62 |
} |
| 63 |
|
| 64 |
echo; |
| 65 |
echo #; |
| 66 |
echo # I.3; |
| 67 |
system_in_background %MYSQL% |
| 68 |
-P %MASTER_MYPORT% |
| 69 |
--protocol tcp |
| 70 |
-u x_root |
| 71 |
-h localhost |
| 72 |
test < %SQL_FILE1%; |
| 73 |
|
| 74 |
recv; |
| 75 |
closesession abort; |
| 76 |
EOF |
| 77 |
|
| 78 |
|
| 79 |
exec $MYSQLXTEST |
| 80 |
-ux_root --password='' |
| 81 |
--file=$xtest_file |
| 82 |
-v%SQL_FILE1%=$sql_synchronize_sessions |
| 83 |
-v%SQL_FILE2%=$sql_trigger_issue_S2 2>&1; |
| 84 |
|
| 85 |
## Cleanup |
| 86 |
--source ../include/xplugin_cleanup.inc |
| 87 |
|
| 88 |
# Wait till all disconnects are completed |
| 89 |
--source include/wait_until_count_sessions.inc |