summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2020-05-15 21:49:57 +0300
committerAndrei Elkin <andrei.elkin@mariadb.com>2020-05-18 15:14:16 +0300
commit44c8d84908e9d697bbcea55d6ebcd5f2250c4727 (patch)
tree07674821f0f538727c58f798dc3b1979626e0814 /sql
parent7baa40dffae4c8175913ab58d320684f1d5f1bad (diff)
downloadmariadb-git-44c8d84908e9d697bbcea55d6ebcd5f2250c4727.tar.gz
MDEV-22520 Assertion `gathered_length == thd->lex->comment.length` failed in binlog_defragment
The assert was caused by early cleanup of a user variable participant in BINLOG @var,@var where it plays twice. That was unexpected by the base code to clear its value prematurely. Fixed with relocating the user var destruction after operations with its value is over.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_binlog.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 1105c9a55ec..b8d4525b5d7 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -78,8 +78,9 @@ int binlog_defragment(THD *thd)
memcpy(thd->lex->comment.str + gathered_length, entry[k]->value,
entry[k]->length);
gathered_length += entry[k]->length;
- update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
}
+ for (uint k=0; k < 2; k++)
+ update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
DBUG_ASSERT(gathered_length == thd->lex->comment.length);