Commit 8282ddc4 authored by Luis Soares's avatar Luis Soares

BUG#46697: Table name in error message is not populated

When a query fails with a different error on the slave,
the sql thread outputs a message (M) containing:

  1. the error message format for the master error code
  2. the master error code
  3. the error message for the slave's error code
  4. the slave error code

Given that the slave has no information on the error message
itself that the master outputs, it can only print its own
version of the message format (but stripped from the 
additional data if the message format requires). This may
confuse users.

To fix this we augment the slave's message (M) to explicitly
state that the master's message is actually an error message 
format, the one associated with the given master error code 
and that the slave server knows about.
parent d4a9b5a8
...@@ -11,6 +11,6 @@ set sql_log_bin=1; ...@@ -11,6 +11,6 @@ set sql_log_bin=1;
insert into t1 values(1),(2); insert into t1 values(1),(2);
ERROR 23000: Duplicate entry '2' for key 'a' ERROR 23000: Duplicate entry '2' for key 'a'
drop table t1; drop table t1;
Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave) Error: "Query caused different errors on master and slave. Error on master: message format='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
Errno: "0" (expected 0) Errno: "0" (expected 0)
drop table t1; drop table t1;
...@@ -3337,7 +3337,8 @@ START SLAVE; . Query: '%s'", expected_error, thd->query()); ...@@ -3337,7 +3337,8 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
rli->report(ERROR_LEVEL, 0, rli->report(ERROR_LEVEL, 0,
"\ "\
Query caused different errors on master and slave. \ Query caused different errors on master and slave. \
Error on master: '%s' (%d), Error on slave: '%s' (%d). \ Error on master: message format='%s' error code=%d ; \
Error on slave: actual message='%s', error code=%d. \
Default database: '%s'. Query: '%s'", Default database: '%s'. Query: '%s'",
ER_SAFE(expected_error), ER_SAFE(expected_error),
expected_error, expected_error,
......
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