diff options
author | Teemu Ollakka <teemu.ollakka@galeracluster.com> | 2019-03-08 17:22:30 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2019-03-11 16:33:01 +0200 |
commit | 15ccd3902e24279ff49c0365886824cf4de11b1a (patch) | |
tree | 8ee606d1d284c377a6233e9918f8f879db9a87f4 | |
parent | 88d89ee0bae24b71416c2af4f4c2f2be7b6a033a (diff) | |
download | mariadb-git-15ccd3902e24279ff49c0365886824cf4de11b1a.tar.gz |
MDEV-18837 Fixed stored procedure wsrep error handling and MW-388
Fixed sync points in MW-388 and fixed SP wsrep error handling to
avoid propagating wsrep errors via client-server protocol response.
-rw-r--r-- | mysql-test/suite/galera/disabled.def | 1 | ||||
-rw-r--r-- | mysql-test/suite/galera/r/MW-388.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/MW-388.test | 7 | ||||
-rw-r--r-- | sql/sp_head.cc | 14 |
4 files changed, 22 insertions, 10 deletions
diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index ad3455b0ac3..59cdc6ee68d 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -18,7 +18,6 @@ MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C] MW-329 : wsrep_local_replays not stable MW-336 : MDEV-13549 incorrect wait_condition for wsrep_slave_threads changes MW-360 : needs rewrite to be MariaDB gtid compatible -MW-388: MDEV-18837 Test failure: mysqltest: Result length mismatch MW-416 : MDEV-13549 Galera test failures MW-44 : MDEV-15809 Test failure on galera.MW-44 galera_account_management : MariaDB 10.0 does not support ALTER USER diff --git a/mysql-test/suite/galera/r/MW-388.result b/mysql-test/suite/galera/r/MW-388.result index 3e532b3e12d..ab78b989efe 100644 --- a/mysql-test/suite/galera/r/MW-388.result +++ b/mysql-test/suite/galera/r/MW-388.result @@ -23,15 +23,15 @@ SET SESSION wsrep_sync_wait = 0; SET SESSION DEBUG_SYNC = 'wsrep_after_certification SIGNAL wsrep_after_certification_reached WAIT_FOR wsrep_after_certification_continue'; CALL insert_proc ();; connection node_1a; -SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached"; +SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_certification_reached"; SET GLOBAL DEBUG_DBUG = ""; -SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue"; +SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; connection node_2; connection node_1; -SELECT @errno = 1213; -@errno = 1213 -1 +SELECT @errno `expect 1213`; +expect 1213 +1213 SELECT * FROM t1; f1 f2 1 node 2 diff --git a/mysql-test/suite/galera/t/MW-388.test b/mysql-test/suite/galera/t/MW-388.test index 4df1fc1a03f..e99559400c1 100644 --- a/mysql-test/suite/galera/t/MW-388.test +++ b/mysql-test/suite/galera/t/MW-388.test @@ -47,16 +47,17 @@ SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_certification_reached"; SET GLOBAL DEBUG_DBUG = ""; -SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue"; +SET DEBUG_SYNC = "now SIGNAL wsrep_after_certification_continue"; SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; --connection node_2 --reap --connection node_1 -# We expect no errors here, because the handler in insert_proc() caught the deadlock error +# We expect no errors here, because the handler in insert_proc() +# caught the deadlock error --reap -SELECT @errno = 1213; +SELECT @errno `expect 1213`; SELECT * FROM t1; --connection node_2 diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f2d3a01b953..dc5123efe36 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -3609,7 +3609,7 @@ sp_instr_stmt::exec_core(THD *thd, uint *nextp) { /* SP was killed, and it is not due to a wsrep conflict. - We skip after_command hook at this point because + We skip after_statement hook at this point because otherwise it clears the error, and cleans up the whole transaction. For now we just return and finish our handling once we are back to mysql_parse. @@ -3619,6 +3619,18 @@ sp_instr_stmt::exec_core(THD *thd, uint *nextp) else { (void) wsrep_after_statement(thd); + /* + Final wsrep error status for statement is known only after + wsrep_after_statement() call. If the error is set, override + error in thd diagnostics area and reset wsrep client_state error + so that the error does not get propagated via client-server protocol. + */ + if (wsrep_current_error(thd)) + { + wsrep_override_error(thd, wsrep_current_error(thd), + wsrep_current_error_status(thd)); + thd->wsrep_cs().reset_error(); + } } #endif /* WITH_WSREP */ MYSQL_QUERY_EXEC_DONE(res); |