summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2021-12-15 13:59:38 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2021-12-24 18:08:31 +0530
commit4b9cb6ca85dd3e588d211b9a8b14c49468328985 (patch)
treecb4f3c5fddeabf0a8bc5b3728feeae9853ca5d86 /sql/sql_prepare.cc
parent42fea34d4a9f4ed1ae87cf8494f07bcdfcc49e83 (diff)
downloadmariadb-git-bb-10.2-MDEV-25460.tar.gz
MDEV-25460: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-MDEV-25460
failed in Diagnostics_area::set_ok_status in my_ok from mysql_sql_stmt_prepare Analysis: Before PREPARE is executed, binlog_format is STATEMENT. This PREPARE had SET STATEMENT which sets binlog_format to ROW. Now after PREPARE is done we reset the binlog_format (back to STATEMENT). But we have temporary table, it doesn't let changing binlog_format=ROW to binlog_format=STATEMENT and gives error which goes unreported. This unreported error eventually causes assertion failure. Fix: Change return type for LEX::restore_set_statement_var() to bool and make it return error state.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 9339cb925e5..bb1a99d9eef 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -4283,7 +4283,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
Restore original values of variables modified on handling
SET STATEMENT clause.
*/
- thd->lex->restore_set_statement_var();
+ error|= thd->lex->restore_set_statement_var();
/* The order is important */
lex->unit.cleanup();