mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
deal with errno out of range when reading it from the master
sql/slave.cc: print expected error number sql/unireg.h: sanity check for errno range in ER(X)
This commit is contained in:
parent
714640bfb9
commit
18da1d3f31
2 changed files with 6 additions and 4 deletions
|
@ -916,9 +916,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
|
|||
(actual_error = thd->net.last_errno) && expected_error)
|
||||
{
|
||||
const char* errmsg = "Slave: did not get the expected error\
|
||||
running query from master - expected: '%s', got '%s'";
|
||||
sql_print_error(errmsg, ER(expected_error),
|
||||
actual_error ? thd->net.last_error:"no error"
|
||||
running query from master - expected: '%s'(%d), got '%s'(%d)";
|
||||
sql_print_error(errmsg, ER(expected_error), expected_error,
|
||||
actual_error ? thd->net.last_error:"no error",
|
||||
actual_error
|
||||
);
|
||||
thd->query_error = 1;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
#define SHAREDIR "share/"
|
||||
#endif
|
||||
|
||||
#define ER(X) errmesg[(X)-1000]
|
||||
#define ER(X) ((X) >= 1000 && (X) < ER_ERROR_MESSAGES + 1000) ? \
|
||||
errmesg[(X)-1000] : "Invalid error code"
|
||||
|
||||
#define ERRMAPP 1 /* Errormap f|r my_error */
|
||||
#define LIBLEN FN_REFLEN-FN_LEN /* Max l{ngd p} dev */
|
||||
|
|
Loading…
Reference in a new issue