#8 0x0000557333f2d4cb in Diagnostics_area::set_ok_status (this=0x1484f0006ab0, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x557334c1db18 "Statement prepared") at /test/10.6_dbg/sql/sql_error.h:1017
#9 0x0000557333fa35c5 in my_ok (message=0x557334c1db18 "Statement prepared", id=0, affected_rows_arg=0, thd=0x1484f0000db8) at /test/10.6_dbg/sql/sql_class.h:5486
#10 mysql_sql_stmt_prepare (thd=thd@entry=0x1484f0000db8) at /test/10.6_dbg/sql/sql_prepare.cc:2938
#11 0x0000557333f87440 in mysql_execute_command (thd=thd@entry=0x1484f0000db8) at /test/10.6_dbg/sql/sql_parse.cc:3938
#12 0x0000557333f738d0 in mysql_parse (thd=thd@entry=0x1484f0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x148558097410) at /test/10.6_dbg/sql/sql_parse.cc:8004
#13 0x0000557333f824d6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1484f0000db8, packet=packet@entry=0x1484f000b359 "pREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT * FROM b'", packet_length=packet_length@entry=68, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
#14 0x0000557333f858b1 in do_command (thd=0x1484f0000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
#15 0x00005573340deb42 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5573364606b8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#16 0x00005573340df147 in handle_one_connection (arg=arg@entry=0x5573364606b8) at /test/10.6_dbg/sql/sql_connect.cc:1312
#17 0x000055733458bbef in pfs_spawn_thread (arg=0x557336384cd8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#18 0x0000148558e0d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#19 0x00001485589fc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Once the diagnostics area bug is fixed, it would be good to spawn another report for the wrong handling of binlog_format in SET STATEMENT, so that's it's not forgotten. It's a valid use case, but it seems to work in a very odd and buggy way – there are more different errors and even diagnostics area assertions around it, for example one can easily get a failure in set_error_status instead:
--source include/have_innodb.inc
CREATETABLE t (c INT) ENGINE=InnoDB;
SET AUTOCOMMIT= 0;
SET STATEMENT binlog_format=ROW FORINSERTINTO t VALUES (1);
So, I'm afraid any regression test based on binlog_format will be contaminated, it would be better to come up with a different variable (if SET STATEMENT remains important after the analysis).
Elena Stepanova
added a comment - Once the diagnostics area bug is fixed, it would be good to spawn another report for the wrong handling of binlog_format in SET STATEMENT , so that's it's not forgotten. It's a valid use case, but it seems to work in a very odd and buggy way – there are more different errors and even diagnostics area assertions around it, for example one can easily get a failure in set_error_status instead:
--source include/have_innodb.inc
CREATE TABLE t (c INT ) ENGINE=InnoDB;
SET AUTOCOMMIT= 0;
SET STATEMENT binlog_format=ROW FOR INSERT INTO t VALUES (1);
So, I'm afraid any regression test based on binlog_format will be contaminated, it would be better to come up with a different variable (if SET STATEMENT remains important after the analysis).
Core was generated by `/test/MD280821-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14d884623700 (LWP 2753254))]
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000014d8871e1859 in __GI_abort () at abort.c:79
#2 0x000055af2d930be7 in DbugExit (why=why@entry=0x14d8846219b0 "missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"set_ok_status\"\n") at /test/10.7_dbg/dbug/dbug.c:2046
#3 0x000055af2d932b98 in _db_return_ (_stack_frame_=_stack_frame_@entry=0x14d884621c00) at /test/10.7_dbg/dbug/dbug.c:1213
#4 0x000055af2cdc8a69 in Diagnostics_area::set_ok_status (this=0x14d840006c30, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x55af2daaf7ce "Statement prepared") at /test/10.7_dbg/sql/sql_error.cc:361
#5 0x000055af2ce502c1 in my_ok (message=0x55af2daaf7ce "Statement prepared", id=0, affected_rows_arg=0, thd=0x14d840000db8) at /test/10.7_dbg/sql/sql_class.h:5553
#6 mysql_sql_stmt_prepare (thd=thd@entry=0x14d840000db8) at /test/10.7_dbg/sql/sql_prepare.cc:3036
#7 0x000055af2ce226c8 in mysql_execute_command (thd=thd@entry=0x14d840000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:3957
#8 0x000055af2ce0eb83 in mysql_parse (thd=thd@entry=0x14d840000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d884622400) at /test/10.7_dbg/sql/sql_parse.cc:8030
#9 0x000055af2ce1d788 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d840000db8, packet=packet@entry=0x14d84000b739 "PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1'", packet_length=packet_length@entry=61, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
#10 0x000055af2ce20b90 in do_command (thd=0x14d840000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
#11 0x000055af2cf96f2e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55af2f914f48, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
#12 0x000055af2cf97533 in handle_one_connection (arg=arg@entry=0x55af2f914f48) at /test/10.7_dbg/sql/sql_connect.cc:1312
#13 0x000055af2d400586 in pfs_spawn_thread (arg=0x55af2f83dae8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
#14 0x000014d8876f0609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x000014d8872de293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Roel Van de Paar
added a comment -
# mysqld options required for replay: --debug-assert=0 (or --skip-debug-assert)
CREATE TEMPORARY TABLE t (c INT );
PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1' ;
Leads to:
10.7.0 05e29e177df243b700392b797e26cae43fd3181e (Debug)
Core was generated by `/test/MD280821-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14d884623700 (LWP 2753254))]
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000014d8871e1859 in __GI_abort () at abort.c:79
#2 0x000055af2d930be7 in DbugExit (why=why@entry=0x14d8846219b0 "missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"set_ok_status\"\n") at /test/10.7_dbg/dbug/dbug.c:2046
#3 0x000055af2d932b98 in _db_return_ (_stack_frame_=_stack_frame_@entry=0x14d884621c00) at /test/10.7_dbg/dbug/dbug.c:1213
#4 0x000055af2cdc8a69 in Diagnostics_area::set_ok_status (this=0x14d840006c30, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x55af2daaf7ce "Statement prepared") at /test/10.7_dbg/sql/sql_error.cc:361
#5 0x000055af2ce502c1 in my_ok (message=0x55af2daaf7ce "Statement prepared", id=0, affected_rows_arg=0, thd=0x14d840000db8) at /test/10.7_dbg/sql/sql_class.h:5553
#6 mysql_sql_stmt_prepare (thd=thd@entry=0x14d840000db8) at /test/10.7_dbg/sql/sql_prepare.cc:3036
#7 0x000055af2ce226c8 in mysql_execute_command (thd=thd@entry=0x14d840000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:3957
#8 0x000055af2ce0eb83 in mysql_parse (thd=thd@entry=0x14d840000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d884622400) at /test/10.7_dbg/sql/sql_parse.cc:8030
#9 0x000055af2ce1d788 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d840000db8, packet=packet@entry=0x14d84000b739 "PREPARE s FROM 'SET STATEMENT binlog_format=ROW FOR SELECT 1'", packet_length=packet_length@entry=61, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1358
#10 0x000055af2ce20b90 in do_command (thd=0x14d840000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
#11 0x000055af2cf96f2e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55af2f914f48, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
#12 0x000055af2cf97533 in handle_one_connection (arg=arg@entry=0x55af2f914f48) at /test/10.7_dbg/sql/sql_connect.cc:1312
#13 0x000055af2d400586 in pfs_spawn_thread (arg=0x55af2f83dae8) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
#14 0x000014d8876f0609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x000014d8872de293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.3.32 (dbg), 10.4.22 (dbg), 10.5.13 (dbg), 10.6.5 (dbg), 10.7.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.41 (dbg), 10.2.41 (opt), 10.3.32 (opt), 10.4.22 (opt), 10.5.13 (opt), 10.6.5 (opt), 10.7.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.35 (dbg), 5.7.35 (opt), 8.0.26 (dbg), 8.0.26 (opt)
Once the diagnostics area bug is fixed, it would be good to spawn another report for the wrong handling of binlog_format in SET STATEMENT, so that's it's not forgotten. It's a valid use case, but it seems to work in a very odd and buggy way – there are more different errors and even diagnostics area assertions around it, for example one can easily get a failure in set_error_status instead:
--source include/have_innodb.inc
So, I'm afraid any regression test based on binlog_format will be contaminated, it would be better to come up with a different variable (if SET STATEMENT remains important after the analysis).