[MDEV-26629] lex->no_write_to_binlog is not initialized properly Created: 2021-09-17  Updated: 2021-09-17

Status: Open
Project: MariaDB Server
Component/s: Parser, Server
Affects Version/s: 10.4
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Jan Lindström (Inactive) Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

How to reproduce:

  • CREATE TABLE book(a int not null);
  • TRUNCATE table book;

Thread 37 "mysqld" hit Breakpoint 1, mysql_execute_command (thd=0x7fff78001120) at /home/jan/mysql/10.4/sql/sql_parse.cc:6192
(gdb) where
#0  mysql_execute_command (thd=0x7fff78001120) at /home/jan/mysql/10.4/sql/sql_parse.cc:6192
#1  0x0000555555d9e83c in mysql_parse (thd=0x7fff78001120, rawbuf=0x7fff78013468 "TRUNCATE TABLE book", length=19, parser_state=0x7fffe8576430, is_com_multi=false, is_next_command=false) at /home/jan/mysql/10.4/sql/sql_parse.cc:7995
#2  0x0000555555d9df2e in wsrep_mysql_parse (thd=0x7fff78001120, rawbuf=0x7fff78013468 "TRUNCATE TABLE book", length=19, parser_state=0x7fffe8576430, is_com_multi=false, is_next_command=false) at /home/jan/mysql/10.4/sql/sql_parse.cc:7799
#3  0x0000555555d8aa42 in dispatch_command (command=COM_QUERY, thd=0x7fff78001120, packet=0x7fff7800abf1 "TRUNCATE TABLE book", packet_length=19, is_com_multi=false, is_next_command=false) at /home/jan/mysql/10.4/sql/sql_parse.cc:1843
#4  0x0000555555d893b3 in do_command (thd=0x7fff78001120) at /home/jan/mysql/10.4/sql/sql_parse.cc:1373
#5  0x0000555555f1b7b5 in do_handle_one_connection (connect=0x5555583d1ea0) at /home/jan/mysql/10.4/sql/sql_connect.cc:1420
#6  0x0000555555f1b451 in handle_one_connection (arg=0x5555583d1ea0) at /home/jan/mysql/10.4/sql/sql_connect.cc:1316
#7  0x0000555556947f95 in pfs_spawn_thread (arg=0x55555805dbc0) at /home/jan/mysql/10.4/storage/perfschema/pfs.cc:1869
#8  0x00007ffff7a5f450 in start_thread (arg=0x7fffe8577640) at pthread_create.c:473
#9  0x00007ffff75f6d53 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) p lex->sql_command
$1 = SQLCOM_TRUNCATE
(gdb) p lex->no_write_to_binlog
$2 = 165
(gdb) p thd->lex->no_write_to_binlog
$3 = 165

Value 165 is meaningless on TRUNCATE.


Generated at Thu Feb 08 09:46:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.