1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Andrei Elkin
2020-05-15 21:49:57 +03:00
parent 7baa40dffa
commit 44c8d84908
3 changed files with 10 additions and 1 deletions

View File

@@ -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);