Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
I tried (and failed) to create a test case for MDEV-21512. This test will hit an assertion failure in locking code:
--source include/have_innodb.inc
|
--source include/have_debug.inc
|
--source include/have_sequence.inc
|
|
SET @save_limit = @@innodb_limit_optimistic_insert_debug; |
|
create table t1(a serial, b geometry not null, spatial index(b)) engine=innodb; |
SET GLOBAL innodb_limit_optimistic_insert_debug = 2; |
begin; |
insert into t1 select seq, Point(1,1) from seq_1_to_5; |
rollback; |
|
check table t1; |
drop table t1; |
|
SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit; |
Without the MDEV-21512 fix, inserting 4 records suffices. With the fix, the test would pass with 4 records and fail with 5.
The failure looks like this:
10.2 c4195305b2a8431f39a4c75cc1c66ba43685f7a0 |
mysqltest: At line 11: query 'rollback' failed: 2013: Lost connection to MySQL server during query
|
…
|
mysqld: /mariadb/10.2o/storage/innobase/lock/lock0lock.cc:2480: void lock_rec_free_all_from_discard_page_low(ulint, ulint, hash_table_t *): Assertion `lock_rec_find_set_bit(lock) == ((ulint)(-1))' failed.
|
…
|
#7 0x000055b0776a0daf in lock_rec_free_all_from_discard_page_low (space=<optimized out>, page_no=<optimized out>, lock_hash=<optimized out>) at /mariadb/10.2o/storage/innobase/lock/lock0lock.cc:2480
|
#8 0x000055b0776a5b69 in lock_update_discard (heir_block=0x7f506217cde0, heir_heap_no=<optimized out>, block=0x7f506217d0f0) at /mariadb/10.2o/storage/innobase/lock/lock0lock.cc:3454
|
#9 0x000055b077834752 in btr_discard_page (cursor=<optimized out>, mtr=<optimized out>) at /mariadb/10.2o/storage/innobase/include/mach0data.ic:84
|
#10 0x000055b07785940d in btr_cur_pessimistic_delete (err=0x7f5061e9e394, has_reserved_extents=<optimized out>, cursor=0x7f5061e9e3f8, flags=16, rollback=<optimized out>, mtr=0x7f5061e9ea78) at /mariadb/10.2o/storage/innobase/btr/btr0cur.cc:5292
|
#11 0x000055b0779709b7 in rtr_node_ptr_delete (index=<optimized out>, cursor=0x7f5061e9e3f8, block=<optimized out>, mtr=0x7f5061e9ea78) at /mariadb/10.2o/storage/innobase/gis/gis0rtree.cc:1741
|
#12 0x000055b0778341f8 in btr_discard_page (cursor=<optimized out>, mtr=<optimized out>) at /mariadb/10.2o/storage/innobase/btr/btr0btr.cc:4181
|
#13 0x000055b07785940d in btr_cur_pessimistic_delete (err=0x7f5061e9e7ec, has_reserved_extents=<optimized out>, cursor=0x7f5061e9e800, flags=0, rollback=<optimized out>, mtr=0x7f5061e9ea78) at /mariadb/10.2o/storage/innobase/btr/btr0cur.cc:5292
|
#14 0x000055b077985ad8 in row_undo_ins_remove_sec_low (mode=196641, index=0x7f501418c2b8, entry=0x7f501407b068, thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0uins.cc:255
|
#15 0x000055b07798403f in row_undo_ins_remove_sec (index=<optimized out>, entry=0x7f501407b068, thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0uins.cc:293
|
#16 row_undo_ins_remove_sec_rec (node=<optimized out>, thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0uins.cc:449
|
#17 row_undo_ins (node=<optimized out>, thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0uins.cc:503
|
#18 0x000055b07779ffc1 in row_undo (node=<optimized out>, thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0undo.cc:298
|
#19 row_undo_step (thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/row/row0undo.cc:351
|
#20 0x000055b077713f78 in que_thr_step (thr=<optimized out>) at /mariadb/10.2o/storage/innobase/que/que0que.cc:1038
|
#21 que_run_threads_low (thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/que/que0que.cc:1102
|
#22 que_run_threads (thr=0x7f501418c850) at /mariadb/10.2o/storage/innobase/que/que0que.cc:1142
|
#23 0x000055b0777f9566 in trx_rollback_to_savepoint_low (trx=0x7f5062a8b140, savept=0x0) at /mariadb/10.2o/storage/innobase/trx/trx0roll.cc:107
|
#24 0x000055b0777f9ce3 in trx_rollback_for_mysql (trx=0x7f5062a8b140) at /mariadb/10.2o/storage/innobase/trx/trx0roll.cc:242
|
#25 0x000055b07764a3b5 in innobase_rollback (hton=<optimized out>, thd=0x7f5014000ce8, rollback_trx=true) at /mariadb/10.2o/storage/innobase/handler/ha_innodb.cc:4834
|
#26 0x000055b077479ca5 in ha_rollback_trans (thd=0x7f5014000ce8, all=true) at /mariadb/10.2o/sql/handler.cc:1707
|
#27 0x000055b0773a956f in trans_rollback (thd=0x7f5014000ce8) at /mariadb/10.2o/sql/transaction.cc:415
|
#28 0x000055b0772a21e2 in mysql_execute_command (thd=0x7f5014000ce8) at /mariadb/10.2o/sql/sql_parse.cc:5358
|
#29 0x000055b07729e0f4 in mysql_parse (thd=0x7f5014000ce8, rawbuf=0x7f5014011920 "rollback", length=<optimized out>, parser_state=0x7f5061ea1300, is_com_multi=<optimized out>, is_next_command=false) at /mariadb/10.2o/sql/sql_parse.cc:7740
|
Note: on MySQL 5.7, have_sequence.inc is not available, and you will have to dumb down the test case, something like this:
begin; |
insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)); |
rollback; |
Attachments
Issue Links
- relates to
-
MDEV-21512 InnoDB hang on rollback or purge due to SPATIAL INDEX
-
- Closed
-
-
MDEV-24981 LOAD INDEX may cause rollback of prepared XA transaction
-
- Open
-
Activity
I've reported this assertion failure upstream as suggested by Marko:
Repeat the following testcase till it crashes (usually only one attempt required):
SET GLOBAL innodb_limit_optimistic_insert_debug=2;
|
CREATE TABLE t (p1 POINT NOT NULL, p2 POINT NOT NULL, SPATIAL KEY k1 (p1), SPATIAL KEY k2 (p2)) ;
|
XA START 'x';
|
INSERT INTO t VALUES (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)'));
|
XA END 'x';
|
LOAD INDEX INTO CACHE t1 IGNORE LEAVES;
|
Leads to:
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
mysqld: /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:1989: void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*): Assertion `lock_rec_find_set_bit(lock) == ((ulint)(-1))' 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 0x14b9c01f8700 (LWP 1817623))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x000055a6daecc0d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
|
#2 0x000055a6da660ab1 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 0x000014b9d4c83859 in __GI_abort () at abort.c:79
|
#6 0x000014b9d4c83729 in __assert_fail_base (fmt=0x14b9d4e19588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55a6db28ef00 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=0x55a6db28d330 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=1989, function=<optimized out>) at assert.c:92
|
#7 0x000014b9d4c94f36 in __GI___assert_fail (assertion=assertion@entry=0x55a6db28ef00 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=file@entry=0x55a6db28d330 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=1989, function=function@entry=0x55a6db28ef30 "void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*)") at assert.c:101
|
#8 0x000055a6daaf7776 in lock_rec_free_all_from_discard_page_low (id=<optimized out>, id@entry={m_id = 21474836497}, lock_hash=lock_hash@entry=0x55a6dc1ef4d0 <lock_sys+272>) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:1989
|
#9 0x000055a6daafbf45 in lock_update_discard (heir_block=heir_block@entry=0x14b9b3c11de0, heir_heap_no=heir_heap_no@entry=1, block=block@entry=0x14b9b3c11ec0) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:2974
|
#10 0x000055a6dacbb816 in btr_discard_page (cursor=cursor@entry=0x14b9c01f4da0, mtr=mtr@entry=0x14b9c01f54e0) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:4043
|
#11 0x000055a6dacf941a in btr_cur_pessimistic_delete (err=err@entry=0x14b9c01f4d4c, has_reserved_extents=has_reserved_extents@entry=1, cursor=cursor@entry=0x14b9c01f4da0, flags=flags@entry=16, rollback=rollback@entry=false, mtr=mtr@entry=0x14b9c01f54e0) at /test/10.6_dbg/storage/innobase/btr/btr0cur.cc:5755
|
#12 0x000055a6dae1a4a1 in rtr_node_ptr_delete (cursor=cursor@entry=0x14b9c01f4da0, mtr=mtr@entry=0x14b9c01f54e0) at /test/10.6_dbg/storage/innobase/gis/gis0rtree.cc:1627
|
#13 0x000055a6dacbc7c2 in btr_discard_page (cursor=cursor@entry=0x14b9c01f5260, mtr=mtr@entry=0x14b9c01f54e0) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:4023
|
#14 0x000055a6dacf941a in btr_cur_pessimistic_delete (err=err@entry=0x14b9c01f5254, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x14b9c01f5260, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x14b9c01f54e0) at /test/10.6_dbg/storage/innobase/btr/btr0cur.cc:5755
|
#15 0x000055a6dae3fd98 in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x14b9900245e8, entry=entry@entry=0x14b990079888, thr=thr@entry=0x14b990075668) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:287
|
#16 0x000055a6dae40a90 in row_undo_ins_remove_sec (thr=0x14b990075668, entry=0x14b990079888, index=0x14b9900245e8) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:339
|
#17 row_undo_ins_remove_sec_rec (thr=0x14b990075668, node=0x14b9900792e8) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:503
|
#18 row_undo_ins (node=node@entry=0x14b9900792e8, thr=thr@entry=0x14b990075668) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:555
|
#19 0x000055a6dac354a1 in row_undo (thr=0x14b990075668, node=0x14b9900792e8) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:432
|
#20 row_undo_step (thr=thr@entry=0x14b990075668) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:488
|
#21 0x000055a6dab7b27f in que_thr_step (thr=0x14b990075668) at /test/10.6_dbg/storage/innobase/que/que0que.cc:934
|
#22 que_run_threads_low (thr=0x14b990075668) at /test/10.6_dbg/storage/innobase/que/que0que.cc:997
|
#23 que_run_threads (thr=<optimized out>) at /test/10.6_dbg/storage/innobase/que/que0que.cc:1030
|
#24 0x000055a6dac8686b in trx_t::rollback_low (this=this@entry=0x14b9bbc01260, savept=savept@entry=0x0) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:119
|
#25 0x000055a6dac823fe in trx_rollback_for_mysql_low (trx=0x14b9bbc01260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:186
|
#26 trx_rollback_for_mysql (trx=trx@entry=0x14b9bbc01260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:216
|
#27 0x000055a6daa55a0a in innobase_rollback (hton=<optimized out>, thd=0x14b990000db8, rollback_trx=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4106
|
#28 0x000055a6da666294 in ha_rollback_trans (thd=thd@entry=0x14b990000db8, all=all@entry=true) at /test/10.6_dbg/sql/handler.cc:2053
|
#29 0x000055a6da50b848 in trans_rollback_implicit (thd=thd@entry=0x14b990000db8) at /test/10.6_dbg/sql/transaction.cc:421
|
#30 0x000055a6da509a3b in mysql_admin_table (thd=thd@entry=0x14b990000db8, tables=tables@entry=0x14b9900127d0, check_opt=check_opt@entry=0x0, operator_name=operator_name@entry=0x55a6db219f83 "preload_keys", lock_type=lock_type@entry=TL_READ_NO_INSERT, org_open_for_modify=org_open_for_modify@entry=false, repair_table_use_frm=false, extra_open_options=0, prepare_func=0x0, operator_func=&virtual table offset 752, view_operator_func=0x0) at /test/10.6_dbg/sql/sql_admin.cc:1240
|
#31 0x000055a6da50a705 in mysql_preload_keys (thd=thd@entry=0x14b990000db8, tables=tables@entry=0x14b9900127d0) at /test/10.6_dbg/sql/sql_admin.cc:1368
|
#32 0x000055a6da39c354 in mysql_execute_command (thd=thd@entry=0x14b990000db8) at /test/10.6_dbg/sql/sql_parse.cc:3962
|
#33 0x000055a6da388072 in mysql_parse (thd=thd@entry=0x14b990000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b9c01f73d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
|
#34 0x000055a6da3961ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b990000db8, packet=packet@entry=0x14b990008d39 "", packet_length=packet_length@entry=38) at /test/10.6_dbg/sql/sql_class.h:1293
|
#35 0x000055a6da39952d in do_command (thd=0x14b990000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
|
#36 0x000055a6da4f57fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a6dc872b78, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
|
#37 0x000055a6da4f5f03 in handle_one_connection (arg=arg@entry=0x55a6dc872b78) at /test/10.6_dbg/sql/sql_connect.cc:1312
|
#38 0x000055a6da9ab88f in pfs_spawn_thread (arg=0x55a6dc7adf58) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#39 0x000014b9d5191609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#40 0x000014b9d4d80293 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)
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 (dbg), 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 (opt)
I also noticed the following (without the debug parameter, and related different testcase):
CREATE TABLE t(c INT) ENGINE=MyISAM;
|
XA START 'x';
|
INSERT INTO t VALUES (1);
|
XA END 'x';
|
LOAD INDEX INTO CACHE t;
|
SHOW WARNINGS;
|
Leads to:
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
10.6.0>CREATE TABLE t(c INT) ENGINE=MyISAM;
|
Query OK, 0 rows affected (0.004 sec)
|
|
10.6.0>XA START 'x';
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.6.0>INSERT INTO t VALUES (1);
|
Query OK, 1 row affected (0.002 sec)
|
|
10.6.0>XA END 'x';
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.6.0>LOAD INDEX INTO CACHE t;
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
| Table | Op | Msg_type | Msg_text |
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
| test.t | preload_keys | Error | XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state |
|
| test.t | preload_keys | error | Corrupt |
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
2 rows in set, 1 warning (0.000 sec)
|
|
10.6.0>SHOW WARNINGS\G
|
*************************** 1. row ***************************
|
Level: Warning
|
Code: 1196
|
Message: Some non-transactional changed tables couldn't be rolled back
|
1 row in set (0.000 sec)
|
Different output on InnoDB for the same testcase:
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
10.6.0>CREATE TABLE t(c INT) ENGINE=InnoDB;
|
Query OK, 0 rows affected (0.014 sec)
|
|
10.6.0>XA START 'x';
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.6.0>INSERT INTO t VALUES (1);
|
Query OK, 1 row affected (0.004 sec)
|
|
10.6.0>XA END 'x';
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.6.0>LOAD INDEX INTO CACHE t;
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
| Table | Op | Msg_type | Msg_text |
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
| test.t | preload_keys | Error | XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state |
|
| test.t | preload_keys | error | Corrupt |
|
+--------+--------------+----------+-------------------------------------------------------------------------------------------+
|
2 rows in set (0.001 sec)
|
|
10.6.0>SHOW WARNINGS;
|
Empty set (0.000 sec)
|
And (InnoDB, no XA):
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
10.6.0>CREATE TABLE t(c INT) ENGINE=InnoDB;
|
Query OK, 0 rows affected (0.009 sec)
|
|
10.6.0>INSERT INTO t VALUES (1);
|
Query OK, 1 row affected (0.004 sec)
|
|
10.6.0>LOAD INDEX INTO CACHE t;
|
+--------+--------------+----------+---------------------------------------------------------------+
|
| Table | Op | Msg_type | Msg_text |
|
+--------+--------------+----------+---------------------------------------------------------------+
|
| test.t | preload_keys | note | The storage engine for the table doesn't support preload_keys |
|
+--------+--------------+----------+---------------------------------------------------------------+
|
1 row in set (0.000 sec)
|
And (MyISAM, and no XA):
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
10.6.0>CREATE TABLE t(c INT) ENGINE=MyISAM;
|
Query OK, 0 rows affected (0.005 sec)
|
|
10.6.0>INSERT INTO t VALUES (1);
|
Query OK, 1 row affected (0.003 sec)
|
|
10.6.0>LOAD INDEX INTO CACHE t;
|
+--------+--------------+----------+----------+
|
| Table | Op | Msg_type | Msg_text |
|
+--------+--------------+----------+----------+
|
| test.t | preload_keys | status | OK |
|
+--------+--------------+----------+----------+
|
1 row in set (0.000 sec)
|
The first testcase I posted above only fails on MariaDB, not MySQL.
MS 8.0.22 (Debug) |
8.0.22>SET GLOBAL innodb_limit_optimistic_insert_debug=2;
|
Query OK, 0 rows affected (0.00 sec)
|
|
8.0.22>CREATE TABLE t (p1 POINT NOT NULL, p2 POINT NOT NULL, SPATIAL KEY k1 (p1), SPATIAL KEY k2 (p2)) ;
|
Query OK, 0 rows affected, 2 warnings (0.23 sec)
|
|
8.0.22>SHOW WARNINGS;
|
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Warning | 3674 | The spatial index on column 'p1' will not be used by the query optimizer since the column does not have an SRID attribute. Consider adding an SRID attribute to the column. |
|
| Warning | 3674 | The spatial index on column 'p2' will not be used by the query optimizer since the column does not have an SRID attribute. Consider adding an SRID attribute to the column. |
|
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
2 rows in set (0.00 sec)
|
|
8.0.22>XA START 'x';
|
Query OK, 0 rows affected (0.00 sec)
|
|
8.0.22>INSERT INTO t VALUES (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)')), (ST_PointFromText('POINT(1.1 1.1)'), ST_PointFromText('POINT(1.1 1.1)'));
|
Query OK, 4 rows affected (0.04 sec)
|
Records: 4 Duplicates: 0 Warnings: 0
|
|
8.0.22>XA END 'x';
|
Query OK, 0 rows affected (0.00 sec)
|
|
8.0.22>LOAD INDEX INTO CACHE t1 IGNORE LEAVES;
|
ERROR 1399 (XAE07): XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
|
I also retested the original testcase and it no longer affects MS either it seems:
SET @save_limit = @@innodb_limit_optimistic_insert_debug;
|
create table t1(a serial, b geometry not null, spatial index(b)) engine=innodb;
|
SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
|
begin;
|
insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1));
|
rollback;
|
check table t1;
|
drop table t1;
|
SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit;
|
Leads to:
10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) |
mysqld: /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:1989: void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*): Assertion `lock_rec_find_set_bit(lock) == ((ulint)(-1))' 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 0x152fb8163700 (LWP 3510620))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x00005611dfec00d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
|
#2 0x00005611df654ab1 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 0x0000152fcce10859 in __GI_abort () at abort.c:79
|
#6 0x0000152fcce10729 in __assert_fail_base (fmt=0x152fccfa6588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5611e0282f00 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=0x5611e0281330 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=1989, function=<optimized out>) at assert.c:92
|
#7 0x0000152fcce21f36 in __GI___assert_fail (assertion=assertion@entry=0x5611e0282f00 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=file@entry=0x5611e0281330 "/test/10.6_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=1989, function=function@entry=0x5611e0282f30 "void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*)") at assert.c:101
|
#8 0x00005611dfaeb776 in lock_rec_free_all_from_discard_page_low (id=<optimized out>, id@entry={m_id = 21474836496}, lock_hash=lock_hash@entry=0x5611e11e34d0 <lock_sys+272>) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:1989
|
#9 0x00005611dfaeff45 in lock_update_discard (heir_block=heir_block@entry=0x152fabe10640, heir_heap_no=heir_heap_no@entry=1, block=block@entry=0x152fabe108e0) at /test/10.6_dbg/storage/innobase/lock/lock0lock.cc:2974
|
#10 0x00005611dfcaf816 in btr_discard_page (cursor=cursor@entry=0x152fb81604e0, mtr=mtr@entry=0x152fb8160c20) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:4043
|
#11 0x00005611dfced41a in btr_cur_pessimistic_delete (err=err@entry=0x152fb816048c, has_reserved_extents=has_reserved_extents@entry=1, cursor=cursor@entry=0x152fb81604e0, flags=flags@entry=16, rollback=rollback@entry=false, mtr=mtr@entry=0x152fb8160c20) at /test/10.6_dbg/storage/innobase/btr/btr0cur.cc:5755
|
#12 0x00005611dfe0e4a1 in rtr_node_ptr_delete (cursor=cursor@entry=0x152fb81604e0, mtr=mtr@entry=0x152fb8160c20) at /test/10.6_dbg/storage/innobase/gis/gis0rtree.cc:1627
|
#13 0x00005611dfcb07c2 in btr_discard_page (cursor=cursor@entry=0x152fb81609a0, mtr=mtr@entry=0x152fb8160c20) at /test/10.6_dbg/storage/innobase/btr/btr0btr.cc:4023
|
#14 0x00005611dfced41a in btr_cur_pessimistic_delete (err=err@entry=0x152fb8160994, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x152fb81609a0, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x152fb8160c20) at /test/10.6_dbg/storage/innobase/btr/btr0cur.cc:5755
|
#15 0x00005611dfe33d98 in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x152f88022eb8, entry=entry@entry=0x152f8806db38, thr=thr@entry=0x152f8806b088) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:287
|
#16 0x00005611dfe34a90 in row_undo_ins_remove_sec (thr=0x152f8806b088, entry=0x152f8806db38, index=0x152f88022eb8) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:339
|
#17 row_undo_ins_remove_sec_rec (thr=0x152f8806b088, node=0x152f8806f418) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:503
|
#18 row_undo_ins (node=node@entry=0x152f8806f418, thr=thr@entry=0x152f8806b088) at /test/10.6_dbg/storage/innobase/row/row0uins.cc:555
|
#19 0x00005611dfc294a1 in row_undo (thr=0x152f8806b088, node=0x152f8806f418) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:432
|
#20 row_undo_step (thr=thr@entry=0x152f8806b088) at /test/10.6_dbg/storage/innobase/row/row0undo.cc:488
|
#21 0x00005611dfb6f27f in que_thr_step (thr=0x152f8806b088) at /test/10.6_dbg/storage/innobase/que/que0que.cc:934
|
#22 que_run_threads_low (thr=0x152f8806b088) at /test/10.6_dbg/storage/innobase/que/que0que.cc:997
|
#23 que_run_threads (thr=<optimized out>) at /test/10.6_dbg/storage/innobase/que/que0que.cc:1030
|
#24 0x00005611dfc7a86b in trx_t::rollback_low (this=this@entry=0x152fb81fc260, savept=savept@entry=0x0) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:119
|
#25 0x00005611dfc763fe in trx_rollback_for_mysql_low (trx=0x152fb81fc260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:186
|
#26 trx_rollback_for_mysql (trx=trx@entry=0x152fb81fc260) at /test/10.6_dbg/storage/innobase/trx/trx0roll.cc:216
|
#27 0x00005611dfa49a0a in innobase_rollback (hton=<optimized out>, thd=0x152f88000db8, rollback_trx=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:4106
|
#28 0x00005611df65a294 in ha_rollback_trans (thd=thd@entry=0x152f88000db8, all=all@entry=true) at /test/10.6_dbg/sql/handler.cc:2053
|
#29 0x00005611df4ff6a9 in trans_rollback (thd=thd@entry=0x152f88000db8) at /test/10.6_dbg/sql/transaction.cc:372
|
#30 0x00005611df39675a in mysql_execute_command (thd=thd@entry=0x152f88000db8) at /test/10.6_dbg/sql/sql_parse.cc:5531
|
#31 0x00005611df37c072 in mysql_parse (thd=thd@entry=0x152f88000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152fb81623d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
|
#32 0x00005611df38a1ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152f88000db8, packet=packet@entry=0x152f88008d39 "rollback", packet_length=packet_length@entry=8) at /test/10.6_dbg/sql/sql_class.h:1293
|
#33 0x00005611df38d52d in do_command (thd=0x152f88000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
|
#34 0x00005611df4e97fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5611e2b86cd8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
|
#35 0x00005611df4e9f03 in handle_one_connection (arg=arg@entry=0x5611e2b86cd8) at /test/10.6_dbg/sql/sql_connect.cc:1312
|
#36 0x00005611df99f88f in pfs_spawn_thread (arg=0x5611e2ac6898) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#37 0x0000152fcd31e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#38 0x0000152fccf0d293 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)
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 (dbg), 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 (opt)
MS 5.7.32 (Debug) |
5.7.32>SET @save_limit = @@innodb_limit_optimistic_insert_debug;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.32>create table t1(a serial, b geometry not null, spatial index(b)) engine=innodb;
|
Query OK, 0 rows affected (0.02 sec)
|
|
5.7.32>SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.32>begin;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.32>insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1));
|
Query OK, 5 rows affected (0.03 sec)
|
Records: 5 Duplicates: 0 Warnings: 0
|
|
5.7.32>rollback;
|
Query OK, 0 rows affected (0.01 sec)
|
|
5.7.32>check table t1;
|
+---------+-------+----------+----------+
|
| Table | Op | Msg_type | Msg_text |
|
+---------+-------+----------+----------+
|
| test.t1 | check | status | OK |
|
+---------+-------+----------+----------+
|
1 row in set (0.00 sec)
|
|
5.7.32>drop table t1;
|
Query OK, 0 rows affected (0.02 sec)
|
|
5.7.32>SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit;
|
Query OK, 0 rows affected (0.00 sec)
|
Same testcase (titled "original") as above. 1st Test: MS 5.7.29 Debug, crashes for me too:
(Debug) |
Core was generated by `/test/MS260221-mysql-5.7.29-linux-x86_64-dbg/bin/mysqld --no-defaults --core-fi'.
|
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 0x14f3d0055700 (LWP 4132105))]
|
(gdb) bt
|
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
|
#1 0x000055feaaca10a9 in my_write_core (sig=sig@entry=6) at /test/mysql-5.7.29_dbg/include/my_thread.h:105
|
#2 0x000055feaa38b75f in handle_fatal_signal (sig=6) at /test/mysql-5.7.29_dbg/sql/signal_handler.cc:227
|
#3 <signal handler called>
|
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#5 0x000014f3db8d9859 in __GI_abort () at abort.c:79
|
#6 0x000055feaaf673f8 in ut_dbg_assertion_failed (expr=expr@entry=0x0, file=file@entry=0x55feab5d30a8 "/test/mysql-5.7.29_dbg/storage/innobase/ut/ut0ut.cc", line=line@entry=918) at /test/mysql-5.7.29_dbg/storage/innobase/ut/ut0dbg.cc:75
|
#7 0x000055feaaf6a29d in ib::fatal::~fatal (this=0x14f3d0050d30, __in_chrg=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/ut/ut0ut.cc:918
|
#8 0x000055feab01e921 in dfield_check_typed (field=0x14f3c44580a8) at /test/mysql-5.7.29_dbg/storage/innobase/include/data0data.ic:102
|
#9 0x000055feab01e98b in dtuple_check_typed (tuple=tuple@entry=0x14f3889338d8) at /test/mysql-5.7.29_dbg/storage/innobase/data/data0data.cc:207
|
#10 0x000055feab0f6fdb in rec_get_converted_size (index=0x14f38800c9a0, dtuple=dtuple@entry=0x14f3889338d8, n_ext=n_ext@entry=0) at /test/mysql-5.7.29_dbg/storage/innobase/include/rem0rec.ic:1640
|
#11 0x000055feab0f97e8 in rtr_page_split_initialize_nodes (heap=<optimized out>, cursor=cursor@entry=0x14f3d0051450, offsets=offsets@entry=0x14f3d00513b8, tuple=tuple@entry=0x14f3889338d8, buf_pos=buf_pos@entry=0x14f3d0051080) at /test/mysql-5.7.29_dbg/storage/innobase/gis/gis0rtree.cc:121
|
#12 0x000055feab102fd9 in rtr_page_split_and_insert (flags=flags@entry=7, cursor=cursor@entry=0x14f3d0051450, offsets=offsets@entry=0x14f3d00513b8, heap=heap@entry=0x14f3d00513c0, tuple=tuple@entry=0x14f3889338d8, n_ext=n_ext@entry=0, mtr=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/gis/gis0rtree.cc:1070
|
#13 0x000055feaaf8b56d in btr_root_raise_and_insert (flags=flags@entry=7, cursor=cursor@entry=0x14f3d0051450, offsets=offsets@entry=0x14f3d00513b8, heap=heap@entry=0x14f3d00513c0, tuple=tuple@entry=0x14f3889338d8, n_ext=0, mtr=0x14f3d0051d50) at /test/mysql-5.7.29_dbg/storage/innobase/btr/btr0btr.cc:1776
|
#14 0x000055feaaf97a77 in btr_cur_pessimistic_insert (flags=flags@entry=7, cursor=cursor@entry=0x14f3d0051450, offsets=offsets@entry=0x14f3d00513b8, heap=heap@entry=0x14f3d00513c0, entry=entry@entry=0x14f3889338d8, rec=rec@entry=0x14f3d00513d0, big_rec=0x14f3d00513c8, n_ext=<optimized out>, thr=0x0, mtr=0x14f3d0051d50) at /test/mysql-5.7.29_dbg/storage/innobase/btr/btr0cur.cc:3454
|
#15 0x000055feab101541 in rtr_adjust_upper_level (sea_cur=sea_cur@entry=0x14f3d0051990, flags=flags@entry=0, block=block@entry=0x14f3c39e5758, new_block=new_block@entry=0x14f3c39e6a48, mbr=mbr@entry=0x14f3d0051640, new_mbr=new_mbr@entry=0x14f3d0051660, direction=<optimized out>, mtr=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/gis/gis0rtree.cc:738
|
#16 0x000055feab1049a4 in rtr_page_split_and_insert (flags=flags@entry=0, cursor=cursor@entry=0x14f3d0051990, offsets=offsets@entry=0x14f3d0051930, heap=heap@entry=0x14f3d0051928, tuple=tuple@entry=0x14f38800c2f8, n_ext=n_ext@entry=0, mtr=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/gis/gis0rtree.cc:1283
|
#17 0x000055feaaf89adb in btr_page_split_and_insert (flags=flags@entry=0, cursor=cursor@entry=0x14f3d0051990, offsets=offsets@entry=0x14f3d0051930, heap=heap@entry=0x14f3d0051928, tuple=tuple@entry=0x14f38800c2f8, n_ext=0, mtr=0x14f3d0051d50) at /test/mysql-5.7.29_dbg/storage/innobase/btr/btr0btr.cc:2554
|
#18 0x000055feaaf9799c in btr_cur_pessimistic_insert (flags=flags@entry=0, cursor=cursor@entry=0x14f3d0051990, offsets=offsets@entry=0x14f3d0051930, heap=heap@entry=0x14f3d0051928, entry=entry@entry=0x14f38800c2f8, rec=rec@entry=0x14f3d0051938, big_rec=0x14f3d0051960, n_ext=<optimized out>, thr=0x14f388021e00, mtr=0x14f3d0051d50) at /test/mysql-5.7.29_dbg/storage/innobase/btr/btr0cur.cc:3457
|
#19 0x000055feaae39c2d in row_ins_sec_index_entry_low (flags=flags@entry=0, mode=mode@entry=33, index=index@entry=0x14f38800c9a0, offsets_heap=<optimized out>, offsets_heap@entry=0x14f388934538, heap=heap@entry=0x14f388022548, entry=entry@entry=0x14f38800c2f8, trx_id=0, thr=0x14f388021e00, dup_chk_only=false) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3155
|
#20 0x000055feaae3aad5 in row_ins_sec_index_entry (index=index@entry=0x14f38800c9a0, entry=entry@entry=0x14f38800c2f8, thr=thr@entry=0x14f388021e00, dup_chk_only=dup_chk_only@entry=false) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3405
|
#21 0x000055feaae3acec in row_ins_index_entry (index=0x14f38800c9a0, entry=0x14f38800c2f8, thr=thr@entry=0x14f388021e00) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3439
|
#22 0x000055feaae3adbb in row_ins_index_entry_step (node=node@entry=0x14f388021b88, thr=thr@entry=0x14f388021e00) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3587
|
#23 0x000055feaae3aeaf in row_ins (node=node@entry=0x14f388021b88, thr=thr@entry=0x14f388021e00) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3725
|
#24 0x000055feaae3b92b in row_ins_step (thr=thr@entry=0x14f388021e00) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0ins.cc:3861
|
#25 0x000055feaae57366 in row_insert_for_mysql_using_ins_graph (mysql_rec=<optimized out>, prebuilt=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0mysql.cc:1746
|
#26 0x000055feaae5bd12 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x14f388019e30 "\005", prebuilt=<optimized out>) at /test/mysql-5.7.29_dbg/storage/innobase/row/row0mysql.cc:1866
|
#27 0x000055feaacf3652 in ha_innobase::write_row (this=0x14f388019b40, record=0x14f388019e30 "\005") at /test/mysql-5.7.29_dbg/storage/innobase/handler/ha_innodb.cc:7612
|
#28 0x000055feaa3ffb09 in handler::ha_write_row (this=0x14f388019b40, buf=0x14f388019e30 "\005") at /test/mysql-5.7.29_dbg/sql/handler.cc:8093
|
#29 0x000055feaab8d53d in write_record (thd=thd@entry=0x14f388000e10, table=table@entry=0x14f388020ba0, info=info@entry=0x14f3d00532a0, update=update@entry=0x14f3d0053320) at /test/mysql-5.7.29_dbg/sql/sql_insert.cc:1895
|
#30 0x000055feaab8ea5f in Sql_cmd_insert::mysql_insert (this=this@entry=0x14f3880069b0, thd=thd@entry=0x14f388000e10, table_list=table_list@entry=0x14f388006300) at /test/mysql-5.7.29_dbg/sql/sql_insert.cc:776
|
#31 0x000055feaab8f02a in Sql_cmd_insert::execute (this=0x14f3880069b0, thd=0x14f388000e10) at /test/mysql-5.7.29_dbg/sql/sql_insert.cc:3140
|
#32 0x000055feaa9a78f0 in mysql_execute_command (thd=thd@entry=0x14f388000e10, first_level=first_level@entry=true) at /test/mysql-5.7.29_dbg/sql/sql_parse.cc:3606
|
#33 0x000055feaa9accff in mysql_parse (thd=thd@entry=0x14f388000e10, parser_state=parser_state@entry=0x14f3d0054530) at /test/mysql-5.7.29_dbg/sql/sql_parse.cc:5584
|
#34 0x000055feaa9aee3e in dispatch_command (thd=thd@entry=0x14f388000e10, com_data=com_data@entry=0x14f3d0054df0, command=COM_QUERY) at /test/mysql-5.7.29_dbg/sql/sql_parse.cc:1491
|
#35 0x000055feaa9b0f5f in do_command (thd=thd@entry=0x14f388000e10) at /test/mysql-5.7.29_dbg/sql/sql_parse.cc:1032
|
#36 0x000055feaaaaa0ac in handle_connection (arg=arg@entry=0x55feadc79760) at /test/mysql-5.7.29_dbg/sql/conn_handler/connection_handler_per_thread.cc:313
|
#37 0x000055feab1a42ef in pfs_spawn_thread (arg=0x55feada247b0) at /test/mysql-5.7.29_dbg/storage/perfschema/pfs.cc:2197
|
#38 0x000014f3dbdfc609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#39 0x000014f3db9d6293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
2nd Test: MS 5.7.30 Debug, does not crash:
(Debug) |
5.7.30>SET @save_limit = @@innodb_limit_optimistic_insert_debug;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.30>create table t1(a serial, b geometry not null, spatial index(b)) engine=innodb;
|
Query OK, 0 rows affected (0.02 sec)
|
|
5.7.30>SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.30>begin;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.30>insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1));
|
Query OK, 5 rows affected (0.02 sec)
|
Records: 5 Duplicates: 0 Warnings: 0
|
|
5.7.30>rollback;
|
Query OK, 0 rows affected (0.00 sec)
|
|
5.7.30>check table t1;
|
+---------+-------+----------+----------+
|
| Table | Op | Msg_type | Msg_text |
|
+---------+-------+----------+----------+
|
| test.t1 | check | status | OK |
|
+---------+-------+----------+----------+
|
1 row in set (0.01 sec)
|
|
5.7.30>drop table t1;
|
Query OK, 0 rows affected (0.01 sec)
|
|
5.7.30>SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit;
|
Query OK, 0 rows affected (0.00 sec)
|
Found an additional testcase, 10.4 debug and 10.5 debug affected only. A C-based client like pquery is required, does not replay to crash at the CLI.
CREATE TABLE t (fid INT KEY,g POLYGON NOT NULL,a INT,SPATIAL INDEX (g)); |
XA START 'b'; |
SET GLOBAL innodb_limit_optimistic_insert_debug=2; |
INSERT INTO t VALUES (300,ST_POLYGONFROMTEXT ('POLYGON ((183670 10,2470 10,20 249380,10 254760,183670 10))'),12),(301,ST_POLYGONFROMTEXT ('POLYGON ((10 10,20 10,20 20,10 20,10 10))'),2),(302,ST_POLYGONFROMTEXT ('POLYGON ((110 10,320 310,2550 8520,1059 2590,110 10))'),2),(303,ST_POLYGONFROMTEXT ('POLYGON ((180 160,55620 5610,240 206560,10 285960,180 160))'),2); |
Leads to:
10.5.17 2840d7750db11a8d2ab3f212a05f5afefaef6d4d (Debug) |
mysqld: /test/10.5_dbg/storage/innobase/lock/lock0lock.cc:2221: void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*): Assertion `lock_rec_find_set_bit(lock) == ((ulint)(-1))' failed.
|
10.5.17 2840d7750db11a8d2ab3f212a05f5afefaef6d4d (Debug) |
Core was generated by `/test/MD310522-mariadb-10.5.17-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 0x1509cc19d700 (LWP 3259440))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x00001509e4f8d859 in __GI_abort () at abort.c:79
|
#2 0x00001509e4f8d729 in __assert_fail_base (fmt=0x1509e5123588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5593c6ef7418 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=0x5593c6ef6250 "/test/10.5_dbg/storage/innobase/lock/lock0lock.cc", line=2221, function=<optimized out>) at assert.c:92
|
#3 0x00001509e4f9efd6 in __GI___assert_fail (assertion=assertion@entry=0x5593c6ef7418 "lock_rec_find_set_bit(lock) == ((ulint)(-1))", file=file@entry=0x5593c6ef6250 "/test/10.5_dbg/storage/innobase/lock/lock0lock.cc", line=line@entry=2221, function=function@entry=0x5593c6ef7448 "void lock_rec_free_all_from_discard_page_low(page_id_t, hash_table_t*)") at assert.c:101
|
#4 0x00005593c67438ac in lock_rec_free_all_from_discard_page_low (id=<optimized out>, id@entry={m_id = 21474836494}, lock_hash=lock_hash@entry=0x5593c7dd45f0 <lock_sys+240>) at /test/10.5_dbg/storage/innobase/lock/lock0lock.cc:2221
|
#5 0x00005593c674e745 in lock_update_discard (heir_block=heir_block@entry=0x1509d001b800, heir_heap_no=heir_heap_no@entry=1, block=block@entry=0x1509d001b960) at /test/10.5_dbg/storage/innobase/lock/lock0lock.cc:3210
|
#6 0x00005593c6932cfe in btr_discard_page (cursor=cursor@entry=0x1509cc19b4c0, mtr=mtr@entry=0x1509cc19bbf0) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:4092
|
#7 0x00005593c696988c in btr_cur_pessimistic_delete (err=err@entry=0x1509cc19b46c, has_reserved_extents=has_reserved_extents@entry=1, cursor=cursor@entry=0x1509cc19b4c0, flags=flags@entry=16, rollback=rollback@entry=false, mtr=mtr@entry=0x1509cc19bbf0) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:5816
|
#8 0x00005593c6a94143 in rtr_node_ptr_delete (cursor=cursor@entry=0x1509cc19b4c0, mtr=mtr@entry=0x1509cc19bbf0) at /test/10.5_dbg/storage/innobase/gis/gis0rtree.cc:1608
|
#9 0x00005593c6933cbb in btr_discard_page (cursor=cursor@entry=0x1509cc19b980, mtr=mtr@entry=0x1509cc19bbf0) at /test/10.5_dbg/storage/innobase/btr/btr0btr.cc:4072
|
#10 0x00005593c696988c in btr_cur_pessimistic_delete (err=err@entry=0x1509cc19b95c, has_reserved_extents=has_reserved_extents@entry=0, cursor=cursor@entry=0x1509cc19b980, flags=flags@entry=0, rollback=rollback@entry=false, mtr=mtr@entry=0x1509cc19bbf0) at /test/10.5_dbg/storage/innobase/btr/btr0cur.cc:5816
|
#11 0x00005593c6abbc56 in row_undo_ins_remove_sec_low (mode=<optimized out>, mode@entry=65569, index=index@entry=0x15097c022620, entry=entry@entry=0x15097c074260, thr=thr@entry=0x15097c0217a0) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:283
|
#12 0x00005593c6abd23e in row_undo_ins_remove_sec (thr=0x15097c0217a0, entry=0x15097c074260, index=0x15097c022620) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:335
|
#13 row_undo_ins_remove_sec_rec (thr=0x15097c0217a0, node=0x15097c0732a0) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:499
|
#14 row_undo_ins (node=node@entry=0x15097c0732a0, thr=thr@entry=0x15097c0217a0) at /test/10.5_dbg/storage/innobase/row/row0uins.cc:551
|
#15 0x00005593c688bfc0 in row_undo (thr=0x15097c0217a0, node=0x15097c0732a0) at /test/10.5_dbg/storage/innobase/row/row0undo.cc:420
|
#16 row_undo_step (thr=thr@entry=0x15097c0217a0) at /test/10.5_dbg/storage/innobase/row/row0undo.cc:476
|
#17 0x00005593c67d20bc in que_thr_step (thr=0x15097c0217a0) at /test/10.5_dbg/storage/innobase/que/que0que.cc:944
|
#18 que_run_threads_low (thr=0x15097c0217a0) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1008
|
#19 que_run_threads (thr=<optimized out>) at /test/10.5_dbg/storage/innobase/que/que0que.cc:1048
|
#20 0x00005593c68f0cab in trx_t::rollback_low (savept=0x0, this=0x1509dc806188) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:124
|
#21 trx_rollback_for_mysql_low (trx=trx@entry=0x1509dc806188) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:192
|
#22 0x00005593c68f1386 in trx_rollback_for_mysql (trx=trx@entry=0x1509dc806188) at /test/10.5_dbg/storage/innobase/trx/trx0roll.cc:223
|
#23 0x00005593c66a1c24 in innobase_rollback (hton=<optimized out>, thd=0x15097c000db8, rollback_trx=<optimized out>) at /test/10.5_dbg/storage/innobase/handler/ha_innodb.cc:4480
|
#24 0x00005593c635df21 in ha_rollback_trans (thd=thd@entry=0x15097c000db8, all=all@entry=true) at /test/10.5_dbg/sql/handler.cc:2083
|
#25 0x00005593c62c1ce6 in xa_trans_force_rollback (thd=thd@entry=0x15097c000db8) at /test/10.5_dbg/sql/xa.cc:393
|
#26 0x00005593c62c30a9 in trans_xa_detach (thd=thd@entry=0x15097c000db8) at /test/10.5_dbg/sql/xa.cc:830
|
#27 0x00005593c60549ef in THD::cleanup (this=this@entry=0x15097c000db8) at /test/10.5_dbg/sql/sql_class.cc:1542
|
#28 0x00005593c5fbedd3 in unlink_thd (thd=0x15097c000db8) at /test/10.5_dbg/sql/mysqld.cc:2608
|
#29 0x00005593c61fcf0f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5593c8983fe8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1429
|
#30 0x00005593c61fd23d in handle_one_connection (arg=0x5593c8983fe8) at /test/10.5_dbg/sql/sql_connect.cc:1312
|
#31 0x00001509e549e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#32 0x00001509e508a133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.4.26 (dbg), 10.5.17 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.3.36 (dbg), 10.3.36 (opt), 10.4.26 (opt), 10.5.17 (opt), 10.6.9 (dbg), 10.6.9 (opt), 10.7.5 (dbg), 10.7.5 (opt), 10.8.4 (dbg), 10.8.4 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.0 (dbg), 10.10.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 8.0.29 (dbg), 8.0.29 (opt)
I've tested MySQL 5.7.29 (debug build) and for me this test case from Marko:
openxs@ao756:~/dbs/5.7d/mysql-test$ cat t/marko.test
--source include/have_innodb.inc
--source include/have_debug.inc
SET @save_limit = @@innodb_limit_optimistic_insert_debug;
create table t1(a serial, b geometry not null, spatial index(b)) engine=innodb;
SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
begin;
insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1));
rollback;
check table t1;
drop table t1;
SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit;
openxs@ao756:~/dbs/5.7d/mysql-test$
Leads to assertion failure:
...
2020-01-17T15:39:30.273537Z 0 [Note] /home/openxs/dbs/5.7d/bin/mysqld: ready for connections.
Version: '5.7.29-debug-log' socket: '/home/openxs/dbs/5.7d/mysql-test/var/tmp/mysqld.1.sock' port: 13000 MySQL Community Server (GPL)
2020-01-17T15:39:31.551226Z 3 [ERROR] [FATAL] InnoDB: Data field type 0, len 1072693248
2020-01-17 18:39:31 0x7fab00751700 InnoDB: Assertion failure in thread 140372423808768 in file ut0ut.cc line 918
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
15:39:31 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61093 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7faab81201a0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fab00750e38 thread_stack 0x40000
/home/openxs/dbs/5.7d/bin/mysqld(my_print_stacktrace+0x47)[0x19871c2]
/home/openxs/dbs/5.7d/bin/mysqld(handle_fatal_signal+0x425)[0xf16956]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fab079e8390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fab06da1428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fab06da302a]
/home/openxs/dbs/5.7d/bin/mysqld[0x1c88217]
/home/openxs/dbs/5.7d/bin/mysqld(_ZN2ib5fatalD1Ev+0x71)[0x1c8d0d9]
/home/openxs/dbs/5.7d/bin/mysqld(_Z18dfield_check_typedPK8dfield_t+0x11a)[0x1d20e71]
/home/openxs/dbs/5.7d/bin/mysqld(_Z18dtuple_check_typedPK8dtuple_t+0x4e)[0x1d20f01]
/home/openxs/dbs/5.7d/bin/mysqld[0x1de0554]
/home/openxs/dbs/5.7d/bin/mysqld[0x1de2e19]
/home/openxs/dbs/5.7d/bin/mysqld(_Z25rtr_page_split_and_insertmP9btr_cur_tPPmPP16mem_block_info_tPK8dtuple_tmP5mtr_t+0x3d8)[0x1de5712]
/home/openxs/dbs/5.7d/bin/mysqld(_Z25btr_root_raise_and_insertmP9btr_cur_tPPmPP16mem_block_info_tPK8dtuple_tmP5mtr_t+0x8dd)[0x1ca1a83]
/home/openxs/dbs/5.7d/bin/mysqld(_Z26btr_cur_pessimistic_insertmP9btr_cur_tPPmPP16mem_block_info_tP8dtuple_tPPhPP9big_rec_tmP9que_thr_tP5mtr_t+0x45b)[0x1cbd4df]
/home/openxs/dbs/5.7d/bin/mysqld[0x1de4708]
/home/openxs/dbs/5.7d/bin/mysqld(_Z25rtr_page_split_and_insertmP9btr_cur_tPPmPP16mem_block_info_tPK8dtuple_tmP5mtr_t+0xe28)[0x1de6162]
/home/openxs/dbs/5.7d/bin/mysqld(_Z25btr_page_split_and_insertmP9btr_cur_tPPmPP16mem_block_info_tPK8dtuple_tmP5mtr_t+0xc9)[0x1ca399b]
/home/openxs/dbs/5.7d/bin/mysqld(_Z26btr_cur_pessimistic_insertmP9btr_cur_tPPmPP16mem_block_info_tP8dtuple_tPPhPP9big_rec_tmP9que_thr_tP5mtr_t+0x4a1)[0x1cbd525]
/home/openxs/dbs/5.7d/bin/mysqld(_Z27row_ins_sec_index_entry_lowmmP12dict_index_tP16mem_block_info_tS2_P8dtuple_tmP9que_thr_tb+0xee2)[0x1b7a05c]
/home/openxs/dbs/5.7d/bin/mysqld(_Z23row_ins_sec_index_entryP12dict_index_tP8dtuple_tP9que_thr_tb+0x26e)[0x1b7ab62]
/home/openxs/dbs/5.7d/bin/mysqld[0x1b7ac5a]
/home/openxs/dbs/5.7d/bin/mysqld[0x1b7b1d0]
/home/openxs/dbs/5.7d/bin/mysqld[0x1b7b565]
/home/openxs/dbs/5.7d/bin/mysqld(_Z12row_ins_stepP9que_thr_t+0x2cb)[0x1b7b9d9]
/home/openxs/dbs/5.7d/bin/mysqld[0x1b9b44b]
/home/openxs/dbs/5.7d/bin/mysqld(_Z20row_insert_for_mysqlPKhP14row_prebuilt_t+0x4c)[0x1b9ba37]
/home/openxs/dbs/5.7d/bin/mysqld(_ZN11ha_innobase9write_rowEPh+0x740)[0x1a30ab8]
/home/openxs/dbs/5.7d/bin/mysqld(_ZN7handler12ha_write_rowEPh+0x224)[0xfa8fce]
/home/openxs/dbs/5.7d/bin/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0xfee)[0x185cd2e]
/home/openxs/dbs/5.7d/bin/mysqld(_ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST+0xf21)[0x1859b57]
/home/openxs/dbs/5.7d/bin/mysqld(_ZN14Sql_cmd_insert7executeEP3THD+0x19f)[0x1860c6b]
/home/openxs/dbs/5.7d/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x2d7a)[0x1617db1]
/home/openxs/dbs/5.7d/bin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x5d5)[0x161dbfd]
/home/openxs/dbs/5.7d/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xc39)[0x1612b07]
/home/openxs/dbs/5.7d/bin/mysqld(_Z10do_commandP3THD+0x51a)[0x1611996]
/home/openxs/dbs/5.7d/bin/mysqld(handle_connection+0x1ee)[0x17561a1]
/home/openxs/dbs/5.7d/bin/mysqld(pfs_spawn_thread+0x173)[0x1e515e2]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fab079de6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fab06e7341d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7faab8012710): insert into t1 (b) values (Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1)),(Point(1,1))
Connection ID (thread ID): 3
Status: NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file
safe_process[7006]: Child process: 7007, killed by signal: 6