summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-20 20:02:01 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-20 20:02:17 +0200
commit378beed0a680172d6570117c853d803e30983199 (patch)
treeae8cd84af068adb40ac1f469b32703ceefd252a9 /sql/sql_class.h
parentb7434bacbdd99d9c60499415f8be10aa59234dbf (diff)
downloadmariadb-git-378beed0a680172d6570117c853d803e30983199.tar.gz
MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or `! is_set()' failed
followup for 97c2a7354b6 - don't use thd->is_error(), the error could've been set before TABLE_LIST::cleanup_items. Use the error handler to count errors. This fixes rpl.rpl_row_binlog_max_cache_size - it was failing when ER_STMT_CACHE_FULL happened duing multi-table update. Because multi_update::abort_result_set() calls do_updates() to update as much as possible, so one cannot rely on thd->is_error() after that.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 57ff65cb416..7429ac586ea 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1469,6 +1469,28 @@ public:
/**
+ Implements the trivial error handler which counts errors as they happen.
+*/
+
+class Counting_error_handler : public Internal_error_handler
+{
+public:
+ int errors;
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ Sql_condition::enum_warning_level level,
+ const char* msg,
+ Sql_condition ** cond_hdl)
+ {
+ errors++;
+ return false;
+ }
+ Counting_error_handler() : errors(0) {}
+};
+
+
+/**
This class is an internal error handler implementation for
DROP TABLE statements. The thing is that there may be warnings during
execution of these statements, which should not be exposed to the user.