summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-01-09 18:48:16 +0100
committerSergei Golubchik <serg@mariadb.org>2021-01-11 21:54:47 +0100
commit6f707430e5e24aed3720e39de6cf49dc8d18d131 (patch)
treecce8b443fdcd38ec979671846c60a66189a7c5e0 /sql/sql_class.h
parent4568a72ce45207a538d89449ffcff4a84cb3ea33 (diff)
downloadmariadb-git-6f707430e5e24aed3720e39de6cf49dc8d18d131.tar.gz
cleanup: copy RAII helpers from 10.5, cleanup test
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b68e3553a2d..fe920270542 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5997,6 +5997,38 @@ class Sql_mode_save
sql_mode_t old_mode; // SQL mode saved at construction time.
};
+class Abort_on_warning_instant_set
+{
+ THD *m_thd;
+ bool m_save_abort_on_warning;
+public:
+ Abort_on_warning_instant_set(THD *thd, bool temporary_value)
+ :m_thd(thd), m_save_abort_on_warning(thd->abort_on_warning)
+ {
+ thd->abort_on_warning= temporary_value;
+ }
+ ~Abort_on_warning_instant_set()
+ {
+ m_thd->abort_on_warning= m_save_abort_on_warning;
+ }
+};
+
+class Check_level_instant_set
+{
+ THD *m_thd;
+ enum_check_fields m_check_level;
+public:
+ Check_level_instant_set(THD *thd, enum_check_fields temporary_value)
+ :m_thd(thd), m_check_level(thd->count_cuted_fields)
+ {
+ thd->count_cuted_fields= temporary_value;
+ }
+ ~Check_level_instant_set()
+ {
+ m_thd->count_cuted_fields= m_check_level;
+ }
+};
+
class Switch_to_definer_security_ctx
{
public: