Commit 15ccd390 authored by Teemu Ollakka's avatar Teemu Ollakka Committed by Jan Lindström

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.
parent 88d89ee0
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment