summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorDmitry Shulga <dmitry.shulga@mariadb.com>2021-06-11 11:25:56 +0700
committerSergei Golubchik <serg@mariadb.org>2021-06-17 19:30:24 +0200
commitfe784950532e96812d06f1bcd6b977435154b15c (patch)
treef6c3744bea6166faf4097933e7ae7124408e6fe8 /sql/sql_class.h
parent994e3f40b5588a044dcebeb20f3e8a217c3bad79 (diff)
downloadmariadb-git-fe784950532e96812d06f1bcd6b977435154b15c.tar.gz
MDEV-16708: fixed assert firing in the method THD::reset_for_the_next_command
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 004b92712c8..713523b7d75 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5453,6 +5453,33 @@ public:
return (variables.old_behavior & OLD_MODE_UTF8_IS_UTF8MB3 ?
MY_UTF8_IS_UTF8MB3 : 0);
}
+
+ /**
+ Save current lex to the output parameter and reset it to point to
+ main_lex. This method is called from mysql_client_binlog_statement()
+ to temporary
+
+ @param[out] backup_lex original value of current lex
+ */
+
+ void backup_and_reset_current_lex(LEX **backup_lex)
+ {
+ *backup_lex= lex;
+ lex= &main_lex;
+ }
+
+
+ /**
+ Restore current lex to its original value it had before calling the method
+ backup_and_reset_current_lex().
+
+ @param backup_lex original value of current lex
+ */
+
+ void restore_current_lex(LEX *backup_lex)
+ {
+ lex= backup_lex;
+ }
};