Skip to content

Commit a840605

Browse files
committed
Merge 10.1 into 10.2
2 parents c93f8ac + 44c8d84 commit a840605

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_frag.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
2020
SET @binlog_fragment_0='012345';
2121
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
2222
ERROR 42000: Incorrect argument type to variable 'binlog_fragment_not_exist'
23+
SET @a= '42';
24+
BINLOG @a, @a;
25+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
2326
# Cleanup
2427
DROP TABLE t;

mysql-test/suite/binlog/t/binlog_mysqlbinlog_row_frag.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ SET @binlog_fragment_0='012345';
4141
--error ER_WRONG_TYPE_FOR_VAR
4242
BINLOG @binlog_fragment_0, @binlog_fragment_not_exist;
4343

44+
# MDEV-22520
45+
SET @a= '42';
46+
--error ER_SYNTAX_ERROR
47+
BINLOG @a, @a;
48+
4449
--echo # Cleanup
4550
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
4651
DROP TABLE t;

sql/sql_binlog.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ int binlog_defragment(THD *thd)
158158
memcpy(thd->lex->comment.str + gathered_length, entry[k]->value,
159159
entry[k]->length);
160160
gathered_length += entry[k]->length;
161-
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
162161
}
162+
for (uint k=0; k < 2; k++)
163+
update_hash(entry[k], true, NULL, 0, STRING_RESULT, &my_charset_bin, 0);
163164

164165
DBUG_ASSERT(gathered_length == thd->lex->comment.length);
165166

0 commit comments

Comments
 (0)