summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-22 00:58:21 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-22 02:27:00 +0200
commitf1ce69f3a9c01877c588c28eab9484fba8cd0e56 (patch)
tree38e09211de3288dc660ebc5a40159cb9720d3ba7 /sql/sql_class.h
parent3fbd4aa03208833001296e63847c7922ff0bdd8b (diff)
parentf8a800bec81983910a96a5dc38f3aeb9b7528bce (diff)
downloadmariadb-git-f1ce69f3a9c01877c588c28eab9484fba8cd0e56.tar.gz
Merge branch '10.1' into 10.2
But without f4f48e06215..f8a800bec81 - fixes for MDEV-12672 and related issues. 10.2 specific fix follows...
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index e5a4c7fcedc..48e1f3cd0e3 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1649,6 +1649,29 @@ 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)
+ {
+ if (*level == Sql_condition::WARN_LEVEL_ERROR)
+ 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.