summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-10-11 16:10:47 +0200
committerSergei Golubchik <serg@mariadb.org>2022-10-11 16:20:22 +0200
commit2aab7f2d0a6555f7ebb6dcde243639354ca5da53 (patch)
treece7b98b5bdb9907d9d384eea1e8a5ce62b36868a /sql
parentd0c4526eced7191b7e8b0b64b789ee70f5f245b6 (diff)
downloadmariadb-git-2aab7f2d0a6555f7ebb6dcde243639354ca5da53.tar.gz
MDEV-26597 post-fix: cannot add new error messages in 10.4
followup for e8acec897417
Diffstat (limited to 'sql')
-rw-r--r--sql/share/errmsg-utf8.txt2
-rw-r--r--sql/wsrep_mysqld.cc2
-rw-r--r--sql/wsrep_thd.h34
3 files changed, 11 insertions, 27 deletions
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 8d9bf5c6ebb..dde8337f01c 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -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"
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index f4efaeee42e..1dee4a6d3cd 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -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. "
diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h
index 32663e9fc3b..31f95510c5e 100644
--- a/sql/wsrep_thd.h
+++ b/sql/wsrep_thd.h
@@ -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);