Commit 2aab7f2d authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-26597 post-fix: cannot add new error messages in 10.4

followup for e8acec89
parent d0c4526e
......@@ -11,7 +11,7 @@ CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
ERROR HY000: Maximum writeset size exceeded
SHOW WARNINGS;
Level Code Message
Error 4160 Maximum writeset size exceeded
Error 1105 Maximum writeset size exceeded
connection node_2;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
......
......@@ -10,7 +10,7 @@ CREATE TABLE t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 FLOAT(3,2));
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
SET @@autocommit=0;
INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00),(1009,1.25),(1010,1.50),(1011,1.75);
--error ER_TOO_BIG_WRITESET
--error ER_UNKNOWN_ERROR
CREATE TABLE t1 ( pk int primary key) ENGINE=INNODB;
SHOW WARNINGS;
......
......@@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
--error ER_TOO_BIG_WRITESET
--error ER_UNKNOWN_ERROR
INSERT INTO t1 VALUES (REPEAT('a', 512));
SELECT COUNT(*) = 0 FROM t1;
......
......@@ -12,7 +12,7 @@ CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine
--let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size`
SET GLOBAL wsrep_max_ws_size = 1024;
--error ER_TOO_BIG_WRITESET
--error ER_UNKNOWN_ERROR
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
SELECT COUNT(*) = 0 FROM t1;
......
......@@ -9090,5 +9090,3 @@ ER_PERIOD_CONSTRAINT_DROP
ER_TOO_LONG_KEYPART 42000 S1009
chi "指定的索引部分太长;最大索引部分长度为 %u 个字节"
eng "Specified key part was too long; max key part length is %u bytes"
ER_TOO_BIG_WRITESET
eng "Maximum writeset size exceeded"
......@@ -2154,7 +2154,7 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
ret,
(thd->db.str ? thd->db.str : "(null)"),
wsrep_thd_query(thd));
my_error(ER_TOO_BIG_WRITESET, MYF(0));
my_error(ER_UNKNOWN_ERROR, MYF(0), "Maximum writeset size exceeded");
break;
case wsrep::e_deadlock_error:
WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. "
......
......@@ -182,7 +182,7 @@ void wsrep_reset_threadvars(THD *);
so don't override those by default
*/
static inline void wsrep_override_error(THD *thd, uint error)
static inline void wsrep_override_error(THD *thd, uint error, const char *format= 0, ...)
{
DBUG_ASSERT(error != ER_ERROR_DURING_COMMIT);
Diagnostics_area *da= thd->get_stmt_da();
......@@ -195,25 +195,11 @@ static inline void wsrep_override_error(THD *thd, uint error)
da->sql_errno() != ER_LOCK_DEADLOCK))
{
da->reset_diagnostics_area();
my_error(error, MYF(0));
}
}
/**
Override error with additional wsrep status.
*/
static inline void wsrep_override_error(THD *thd, uint error,
enum wsrep::provider::status status)
{
Diagnostics_area *da= thd->get_stmt_da();
if (da->is_ok() ||
!da->is_set() ||
(da->is_error() &&
da->sql_errno() != error &&
da->sql_errno() != ER_LOCK_DEADLOCK))
{
da->reset_diagnostics_area();
my_error(error, MYF(0), status);
va_list args;
va_start(args, format);
if (!format) format= ER_THD(thd, error);
my_printv_error(error, format, MYF(0), args);
va_end(args);
}
}
......@@ -226,9 +212,9 @@ static inline void wsrep_override_error(THD* thd,
{
case wsrep::e_error_during_commit:
if (status == wsrep::provider::error_size_exceeded)
wsrep_override_error(thd, ER_TOO_BIG_WRITESET);
wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
else
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, status);
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status);
break;
case wsrep::e_deadlock_error:
wsrep_override_error(thd, ER_LOCK_DEADLOCK);
......@@ -237,11 +223,11 @@ static inline void wsrep_override_error(THD* thd,
wsrep_override_error(thd, ER_QUERY_INTERRUPTED);
break;
case wsrep::e_size_exceeded_error:
wsrep_override_error(thd, ER_TOO_BIG_WRITESET);
wsrep_override_error(thd, ER_UNKNOWN_ERROR, "Maximum writeset size exceeded");
break;
case wsrep::e_append_fragment_error:
/* TODO: Figure out better error number */
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, status);
wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status);
break;
case wsrep::e_not_supported_error:
wsrep_override_error(thd, ER_NOT_SUPPORTED_YET);
......
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