[MDEV-22712] Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status Created: 2020-05-26  Updated: 2022-02-01  Resolved: 2022-02-01

Status: Closed
Project: MariaDB Server
Component/s: XA
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Andrei Elkin
Resolution: Duplicate Votes: 0
Labels: affects-tests, upstream-5.5

Issue Links:
Relates
relates to MDEV-25460 Assertion `!is_set() || (m_status == ... Closed

 Description   

USE test;
CREATE TABLE t1(bitk bit);
XA BEGIN '0';
INSERT INTO t1 VALUES(1);
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';

Leads to:

10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

mysqld: /test/10.5_dbg/sql/sql_error.cc:335: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.

10.5.4 8569dac1ec9f6853a0b2f3ea9bcbda67644ead24

Core was generated by `/test/MD260520-mariadb-10.5.4-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x15401e9ad700 (LWP 1309567))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055e247018d7a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2  0x000055e2467be385 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x000015401d0f1801 in __GI_abort () at abort.c:79
#6  0x000015401d0e139a in __assert_fail_base (fmt=0x15401d2687d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55e24718e198 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=file@entry=0x55e24718e140 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=335, function=function@entry=0x55e24718ecc0 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:92
#7  0x000015401d0e1412 in __GI___assert_fail (assertion=assertion@entry=0x55e24718e198 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=file@entry=0x55e24718e140 "/test/10.5_dbg/sql/sql_error.cc", line=line@entry=335, function=function@entry=0x55e24718ecc0 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
#8  0x000055e2464ca3af in Diagnostics_area::set_ok_status (this=0x153ffbc1ab90, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x0) at /test/10.5_dbg/sql/sql_error.cc:335
#9  0x000055e24663a391 in my_ok (message=0x0, id=0, affected_rows_arg=0, thd=0x153ffbc15088) at /test/10.5_dbg/sql/sql_class.h:5198
#10 mysql_client_binlog_statement (thd=thd@entry=0x153ffbc15088) at /test/10.5_dbg/sql/sql_binlog.cc:388
#11 0x000055e2465193b9 in mysql_execute_command (thd=thd@entry=0x153ffbc15088) at /test/10.5_dbg/sql/sql_parse.cc:5864
#12 0x000055e24652102e in mysql_parse (thd=thd@entry=0x153ffbc15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15401e9ac3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7991
#13 0x000055e24650db42 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153ffbc15088, packet=packet@entry=0x153ffbc67089 "BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZw", 'A' <repeats 22 times>, " ", 'A' <repeats 19 times>, "7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC '", packet_length=packet_length@entry=148, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1874
#14 0x000055e24650c31c in do_command (thd=0x153ffbc15088) at /test/10.5_dbg/sql/sql_parse.cc:1355
#15 0x000055e24666673f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153ffd8453a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#16 0x000055e246666e5b in handle_one_connection (arg=arg@entry=0x153ffd8453a8) at /test/10.5_dbg/sql/sql_connect.cc:1313
#17 0x000055e246ac614e in pfs_spawn_thread (arg=0x15401c445888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#18 0x000015401ddd46db in start_thread (arg=0x15401e9ad700) at pthread_create.c:463
#19 0x000015401d1d288f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.1.46 (dbg), 10.2.33 (dbg), 10.3.24 (dbg), 10.4.14 (dbg), 10.5.4 (dbg)
MySQL: 5.5.62 (dbg)

Bug confirmed not present in:
MariaDB: 10.1.46 (opt), 10.2.33 (opt), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (opt)
MySQL: 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)



 Comments   
Comment by Roel Van de Paar [ 2020-05-26 ]

Note: Bug present in MySQL 5.5.62 (dbg).

Comment by Alice Sherepa [ 2020-10-12 ]

if using mtr, please run the test from the description with

  --mysqld=--default-storage-engine=innodb --mysqld=--innodb

Comment by Roel Van de Paar [ 2021-01-01 ]

CREATE TABLE t2 (c1 INT);
XA START 0x7465737462,0x2030405060,0xb;
INSERT INTO t2 VALUES (8513.33);
BINLOG ' mSKWVg8BAAAAdwAAAHsAAAAAAAQANS44LjAtbTE3LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAACZIpZWEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA AYzz6oU= '/*!*/;

Leads to:

10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

mysqld: /test/10.6_dbg/sql/sql_error.cc:334: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.

10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

Core was generated by `/test/MD010121-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x14e8b4752700 (LWP 460215))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x00005611063400d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
#2  0x0000561105ad4ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x000014e8ca5cc859 in __GI_abort () at abort.c:79
#6  0x000014e8ca5cc729 in __assert_fail_base (fmt=0x14e8ca762588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5611064a0df0 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x5611064a0cd0 "/test/10.6_dbg/sql/sql_error.cc", line=334, function=<optimized out>) at assert.c:92
#7  0x000014e8ca5ddf36 in __GI___assert_fail (assertion=assertion@entry=0x5611064a0df0 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=file@entry=0x5611064a0cd0 "/test/10.6_dbg/sql/sql_error.cc", line=line@entry=334, function=function@entry=0x5611064a0e28 "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
#8  0x00005611057b4c0b in Diagnostics_area::set_ok_status (this=0x14e884006a68, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x0) at /test/10.6_dbg/sql/sql_error.h:1017
#9  0x000056110593ccb4 in my_ok (message=0x0, id=0, affected_rows_arg=0, thd=0x14e884000db8) at /test/10.6_dbg/sql/sql_class.h:5294
#10 mysql_client_binlog_statement (thd=thd@entry=0x14e884000db8) at /test/10.6_dbg/sql/sql_binlog.cc:388
#11 0x0000561105815133 in mysql_execute_command (thd=thd@entry=0x14e884000db8) at /test/10.6_dbg/sql/sql_parse.cc:5772
#12 0x00005611057fc072 in mysql_parse (thd=thd@entry=0x14e884000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e8b47513d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
#13 0x000056110580a1ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e884000db8, packet=packet@entry=0x14e884008d39 "BINLOG ' mSKWVg8BAAAAdwAAAHsAAAAAAAQANS44LjAtbTE3LWRlYnVnLWxvZw", 'A' <repeats 22 times>, " ", 'A' <repeats 18 times>, "CZIpZWEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA AYzz6oU= '/*!*/", packet_length=packet_length@entry=178) at /test/10.6_dbg/sql/sql_class.h:1293
#14 0x000056110580d52d in do_command (thd=0x14e884000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
#15 0x00005611059697fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x561108bec488, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#16 0x0000561105969f03 in handle_one_connection (arg=arg@entry=0x561108bec488) at /test/10.6_dbg/sql/sql_connect.cc:1312
#17 0x0000561105e1f88f in pfs_spawn_thread (arg=0x561108b40898) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#18 0x000014e8caada609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#19 0x000014e8ca6c9293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.37 (dbg), 10.3.28 (dbg), 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg)
MySQL: 5.5.62 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.37 (opt), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (opt), 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (o

Comment by Roel Van de Paar [ 2021-02-13 ]

CREATE TABLE t (a INT,b INT,KEY using BTREE (a,b),KEY using BTREE (b));
XA START 'XA3';
INSERT INTO t VALUES(6,'');
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';

Comment by Roel Van de Paar [ 2021-03-16 ]

# mysqld options required for replay: --log-bin 
XA START '123';
CREATE TEMPORARY TABLE t3 (a INT KEY);
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';

Comment by Sergei Golubchik [ 2021-03-31 ]

Roel, what does this BINLOG command do?

Comment by Roel Van de Paar [ 2021-03-31 ]

serg It is not immediately clear what this does, though it is present in the following MTR test:

mysql-test/suite/rpl/r/rpl_bug31076.test

Which provides surrounding information:

# at 4 (0x4)
#071204 14:29:31 server id 1  end_log_pos 106
# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags
#        4 3b 56 55 47   0f   01 00 00 00   66 00 00 00   6a 00 00 00   00 00
#       17 04 00 35 2e 31 2e 32 33  2d 72 63 2d 64 65 62 75 |..5.1.23.rc.debu|
#       27 67 2d 6c 6f 67 00 00 00  00 00 00 00 00 00 00 00 |g.log...........|
#       37 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |................|
#       47 00 00 00 00 3b 56 55 47  13 38 0d 00 08 00 12 00 |.....VUG.8......|
#       57 04 04 04 04 12 00 00 53  00 04 1a 08 00 00 00 08 |.......S........|
#       67 08 08 02                                         |...|
#       Start: binlog v 4, server v 5.1.23-rc-debug-log created 071204 14:29:31 at startup
 
BINLOG '
O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
'/*!*/;

https://bugs.mysql.com/bug.php?id=31076 is likely related.

Comment by Sergei Golubchik [ 2021-04-01 ]

Well, if it starts at 4, it's a Format_description_log_event

Comment by Roel Van de Paar [ 2021-08-21 ]

CREATE TABLE t (b INT);
XA START 'a';
INSERT INTO t VALUES(0);
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=';

Leads to:

10.7.0 52505bf20de0ce77a5c0b0a74af021051987bb0d (Debug)

mysqld: /test/10.7_dbg/sql/sql_error.cc:334: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.

10.7.0 52505bf20de0ce77a5c0b0a74af021051987bb0d (Debug)

Core was generated by `/test/MD160821-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 0x1503ed6e5700 (LWP 897134))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000015040456d859 in __GI_abort () at abort.c:79
#2  0x000015040456d729 in __assert_fail_base (fmt=0x150404703588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5583d0f65588 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x5583d0f65468 "/test/10.7_dbg/sql/sql_error.cc", line=334, function=<optimized out>) at assert.c:92
#3  0x000015040457ef36 in __GI___assert_fail (assertion=assertion@entry=0x5583d0f65588 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=file@entry=0x5583d0f65468 "/test/10.7_dbg/sql/sql_error.cc", line=line@entry=334, function=function@entry=0x5583d0f655c0 "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
#4  0x00005583d02909bf in Diagnostics_area::set_ok_status (this=0x1503ac006c30, affected_rows=affected_rows@entry=0, last_insert_id=last_insert_id@entry=0, message=message@entry=0x0) at /test/10.7_dbg/sql/sql_error.h:1029
#5  0x00005583d0433118 in my_ok (message=0x0, id=0, affected_rows_arg=0, thd=0x1503ac000db8) at /test/10.7_dbg/sql/sql_class.h:5552
#6  mysql_client_binlog_statement (thd=thd@entry=0x1503ac000db8) at /test/10.7_dbg/sql/sql_binlog.cc:408
#7  0x00005583d02efa87 in mysql_execute_command (thd=thd@entry=0x1503ac000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5911
#8  0x00005583d02d6ac3 in mysql_parse (thd=thd@entry=0x1503ac000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1503ed6e4400) at /test/10.7_dbg/sql/sql_parse.cc:8030
#9  0x00005583d02e56c8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1503ac000db8, packet=packet@entry=0x1503ac00b739 "BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9n", 'A' <repeats 24 times>, " ", 'A' <repeats 18 times>, "BI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='", packet_length=packet_length@entry=159, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1357
#10 0x00005583d02e8ae9 in do_command (thd=0x1503ac000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
#11 0x00005583d045edd6 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5583d2b32308, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1418
#12 0x00005583d045f3db in handle_one_connection (arg=arg@entry=0x5583d2b32308) at /test/10.7_dbg/sql/sql_connect.cc:1312
#13 0x00005583d08c7ce4 in pfs_spawn_thread (arg=0x5583d2a5b038) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
#14 0x0000150404a7c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x000015040466a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.41 (dbg), 10.3.32 (dbg), 10.4.22 (dbg), 10.5.13 (dbg), 10.6.5 (dbg), 10.7.0 (dbg)
MySQL: 5.5.62 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 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 (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)

This particular test appears in suite/rpl/t/rpl_row_corruption.test:

## test #3: check that BINLOG statements will also raise an
##          error if containing table map events mapping different
##          tables to same table identifier.
 
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
 
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
 
# FD event
BINLOG '
SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8=
'/*!*/;
 
#110708 12:21:44 server id 1  end_log_pos 774   Table_map: `test`.`t1` mapped to number 66
# at 774
#110708 12:21:44 server id 1  end_log_pos 815   Table_map: `test`.`t2` mapped to number 67
# at 815
#110708 12:21:44 server id 1  end_log_pos 855   Update_rows: table id 66
# at 855
#110708 12:21:44 server id 1  end_log_pos 895   Update_rows: table id 67 flags: STMT_END_F
SET @@global.debug_dbug="d,inject_tblmap_same_id_maps_diff_table";
--error ER_SLAVE_FATAL_ERROR

Comment by Roel Van de Paar [ 2021-09-18 ]

CREATE TABLE t (c INT);
XA START 'a';
SELECT * FROM t WHERE c=0;
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';

Comment by Roel Van de Paar [ 2022-01-31 ]

Please test any fixes with testcase also:

CREATE TABLE t (a INT,b INT,c BINARY (1),d CHAR(1),e BINARY (1),f VARCHAR(1),g BLOB,h BLOB,id INT,KEY(b),KEY(e));
XA START 'xa_con3','xa_bqual',12;
INSERT INTO t VALUES (-23,0,0,'JIa5cvhg6tUx5CrOhuNTZBady8pN6ktM1gz6Mb2UfqsT7EdaB2AxVA7FruicGyEWLJj0qqB9bFtVrTNVTXb9wi3hFQdTPPR0JZRYvefC6zDn6aAxmcz25GAQxMGbInrJ4LVuO77LdQTQ0JJfokf7Y88nbUhobCQdM7yakLV2KRsHK8bVhnNXzkDXXrdzLqlHLApvWQUxghIQYZ188Cgb8WR2mJsXiKCrOUQIEXWZXAck5yAQjqXIZfuuX5F4TUkU','WV0ukE2Zq','Cme5VwrnlhpLsnd5ZlQo7PmPR3UW5ZwYsT3dE1r48wWhO5BwT9HcjxhLU0cU0S1',0,'5D',0);
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';

This is a bit of a special testcase.

  • On 10.8.1 it currently crashes with the stack from MDEV-27687, but I believe this is only because MDEV-27687 masks this bug. This can be proven by the fact that when this testcase is executed against 10.8.0 (@ rev e222e44d1bfc995870430bb90d8ac97e91f66cb4) it crashes with the stack from this bug. Similarly, another testcase from the last comment above will also crash with the stack from MDEV-27687 when executed against 10.8.1 (@ rev 0c5d1342ae6b5ab3256848be7a83e5c3b1f21566)
  • On all other versions, except MySQL 5.5.62, it will crash with the assert/stack from this bug. On MySQL 5.5.62 (only) it will be this assert/stack:

    (Debug)

    mysqld: /test/5.5_dbg/sql/sql_error.cc:358: void Diagnostics_area::set_ok_status(THD*, ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.
    

    (Debug)

    Core was generated by `/test/MS121121-mysql-5.5.62-linux-x86_64-dbg/bin/mysqld --no-defaults --core --'.
    Program terminated with signal SIGABRT, Aborted.
    #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
        at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
    [Current thread is 1 (Thread 0x1490c8b04700 (LWP 4165693))]
    (gdb) bt
    #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
    #1  0x000056527a9161f1 in my_write_core (sig=sig@entry=6) at /test/5.5_dbg/mysys/stacktrace.c:433
    #2  0x000056527a7d3e1e in handle_fatal_signal (sig=6) at /test/5.5_dbg/sql/signal_handler.cc:247
    #3  <signal handler called>
    #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
    #5  0x00001490d9576859 in __GI_abort () at abort.c:79
    #6  0x00001490d9576729 in __assert_fail_base (fmt=0x1490d970c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56527abca908 "! is_set()", file=0x56527abca4b8 "/test/5.5_dbg/sql/sql_error.cc", line=358, function=<optimized out>) at assert.c:92
    #7  0x00001490d9587f36 in __GI___assert_fail (assertion=assertion@entry=0x56527abca908 "! is_set()", file=file@entry=0x56527abca4b8 "/test/5.5_dbg/sql/sql_error.cc", line=line@entry=358, function=function@entry=0x56527abca598 "void Diagnostics_area::set_ok_status(THD*, ulonglong, ulonglong, const char*)") at assert.c:101
    #8  0x000056527a692b89 in Diagnostics_area::set_ok_status (this=0x56527ca74798, thd=thd@entry=0x56527ca71ba0, affected_rows_arg=affected_rows_arg@entry=0, last_insert_id_arg=last_insert_id_arg@entry=0, message_arg=message_arg@entry=0x0) at /test/5.5_dbg/sql/sql_error.cc:374
    #9  0x000056527a7506b4 in my_ok (message=0x0, id=0, affected_rows=0, thd=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_class.h:2959
    #10 mysql_client_binlog_statement (thd=thd@entry=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_binlog.cc:254
    #11 0x000056527a6b6763 in mysql_execute_command (thd=thd@entry=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_parse.cc:4426
    #12 0x000056527a6b7c47 in mysql_parse (thd=thd@entry=0x56527ca71ba0, rawbuf=<optimized out>, length=148, parser_state=parser_state@entry=0x1490c8b03610) at /test/5.5_dbg/sql/sql_parse.cc:5831
    #13 0x000056527a6b94bd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x56527ca71ba0, packet=packet@entry=0x56527caf90e1 "BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZw", 'A' <repeats 22 times>, " ", 'A' <repeats 19 times>, "7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC '", packet_length=packet_length@entry=148) at /test/5.5_dbg/sql/sql_class.h:758
    #14 0x000056527a6bad83 in do_command (thd=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_parse.cc:776
    #15 0x000056527a76b3f2 in do_handle_one_connection (thd_arg=thd_arg@entry=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_connect.cc:870
    #16 0x000056527a76b4c4 in handle_one_connection (arg=0x56527ca71ba0) at /test/5.5_dbg/sql/sql_connect.cc:789
    #17 0x00001490d9a7f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
    #18 0x00001490d9673293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    

    Which is (likely incidentally) the same as the one in the just-fixed MDEV-27536.

Given these findings, it is highly likely there is zero connection between this bug, MDEV-27536 and MDEV-27687 (except for any masking), so I am not linking them for the moment.

Comment by Andrei Elkin [ 2022-02-01 ]

Duplicates MDEV-27536.

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