diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-11-02 07:20:30 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-11-02 07:20:30 +0200 |
commit | e571eaae9fb6587932f8d191380b7f289a5f40a0 (patch) | |
tree | 23d7cd3baae6038d44ddb039a419135bc8896e40 | |
parent | ea239034deac61642dbf25a5f402a58642a4c1ad (diff) | |
download | mariadb-git-e571eaae9fb6587932f8d191380b7f289a5f40a0.tar.gz |
MDEV-23328 Server hang due to Galera lock conflict resolution
Use better error message when KILL fails even in case TOI
fails.
-rw-r--r-- | mysql-test/suite/galera/r/galera_to_error.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/galera_to_error.test | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 |
3 files changed, 10 insertions, 8 deletions
diff --git a/mysql-test/suite/galera/r/galera_to_error.result b/mysql-test/suite/galera/r/galera_to_error.result index 4f985593466..545029bf069 100644 --- a/mysql-test/suite/galera/r/galera_to_error.result +++ b/mysql-test/suite/galera/r/galera_to_error.result @@ -15,10 +15,10 @@ Killing server ... connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1c; CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; -ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query. -ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query. +Got one of the listed errors +Got one of the listed errors CREATE UNIQUE INDEX b2 ON t2(b); -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors connection node_1; disconnect node_1a; disconnect node_1b; diff --git a/mysql-test/suite/galera/t/galera_to_error.test b/mysql-test/suite/galera/t/galera_to_error.test index 71bfe64c02d..576fa01e64d 100644 --- a/mysql-test/suite/galera/t/galera_to_error.test +++ b/mysql-test/suite/galera/t/galera_to_error.test @@ -34,16 +34,16 @@ BEGIN; --connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1 --connection node_1c ---error ER_LOCK_DEADLOCK +--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; --disable_query_log ---error ER_LOCK_DEADLOCK +--error ER_LOCK_DEADLOCK, ER_CANNOT_USER,ER_KILL_QUERY_DENIED_ERROR --eval KILL QUERY $k_thread; --enable_query_log # Reset the master and restart the slave so that post-test checks can run ---error 1047 +--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR CREATE UNIQUE INDEX b2 ON t2(b); --connection node_1 diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0209dab7e18..67e2fcd6764 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -9093,7 +9093,9 @@ void sql_kill(THD *thd, longlong id, killed_state state, killed_type type) #ifdef WITH_WSREP return; wsrep_error_label: - my_error(ER_CANNOT_USER, MYF(0), " "); + error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR : + ER_KILL_DENIED_ERROR); + my_error(error, MYF(0), id); #endif /* WITH_WSREP */ } @@ -9128,7 +9130,7 @@ void sql_kill_user(THD *thd, LEX_USER *user, killed_state state) #ifdef WITH_WSREP return; wsrep_error_label: - my_error(ER_CANNOT_USER, MYF(0), " "); + my_error(ER_CANNOT_USER, MYF(0), user ? user->user.str : "NULL"); #endif /* WITH_WSREP */ } |