Bug #75718 Failing assertion: btr_op == BTR_NO_OP || !dict_table_is_temporary(index->table)
Submitted: 2 Feb 2015 5:13 Modified: 5 Feb 2015 16:12
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.7.5-m15, 5.7.6 OS:Any
Assigned to: CPU Architecture:Any

[2 Feb 2015 5:13] Roel Van de Paar
Description:
2015-02-02T05:08:48.299061Z 0 [Note] /sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.7.5-m15-debug'  socket: '/sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/socket.sock'  port: 16633  MySQL Community Server (GPL)
2015-02-02 16:08:56 0x7f5aad02e700  InnoDB: Assertion failure in thread 140027426432768 in file btr0cur.cc line 858
InnoDB: Failing assertion: btr_op == BTR_NO_OP || !dict_table_is_temporary(index->table)

(gdb) bt
#0  0x00007f5aacb45771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000e15cd8 in my_write_core (sig=6) at /bzr/testbuild/mysql-5.7.5-m15_dbg/mysys/stacktrace.c:247
#2  0x0000000000822044 in handle_fatal_signal (sig=6) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/signal_handler.cc:219
#3  <signal handler called>
#4  0x00007f5aab7495c9 in raise () from /lib64/libc.so.6
#5  0x00007f5aab74acd8 in abort () from /lib64/libc.so.6
#6  0x00000000010d4a9b in ut_dbg_assertion_failed (expr=0x14f4f30 "btr_op == BTR_NO_OP || !dict_table_is_temporary(index->table)", file=0x14f48b8 "/bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/btr/btr0cur.cc", line=858) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/ut/ut0dbg.cc:68
#7  0x00000000010ffbae in btr_cur_search_to_nth_level (index=0x7f59ef8d0898, level=0, tuple=0x7f59ef846698, mode=13, latch_mode=151554, cursor=0x7f5aad028430, has_search_latch=0, file=0x14c8ab0 "/bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0row.cc", line=916, mtr=0x7f5aad028520) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/btr/btr0cur.cc:858
#8  0x0000000001203717 in rtr_pcur_open_low (index=0x7f59ef8d0898, level=0, tuple=0x7f59ef846698, mode=13, latch_mode=151554, cursor=0x7f5aad028430, file=0x14c8ab0 "/bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0row.cc", line=916, mtr=0x7f5aad028520) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/gis/gis0sea.cc:582
#9  0x00000000010437a0 in row_search_index_entry (index=0x7f59ef8d0898, entry=0x7f59ef846698, mode=151554, pcur=0x7f5aad028430, mtr=0x7f5aad028520) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0row.cc:916
#10 0x000000000121734a in row_undo_ins_remove_sec_low (mode=151554, index=0x7f59ef8d0898, entry=0x7f59ef846698, thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0uins.cc:231
#11 0x0000000001217539 in row_undo_ins_remove_sec (index=0x7f59ef8d0898, entry=0x7f59ef846698, thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0uins.cc:297
#12 0x00000000012178ac in row_undo_ins_remove_sec_rec (node=0x7f59ef8eca98, thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0uins.cc:426
#13 0x0000000001217b13 in row_undo_ins (node=0x7f59ef8eca98, thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0uins.cc:481
#14 0x00000000010683ea in row_undo (node=0x7f59ef8eca98, thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0undo.cc:311
#15 0x000000000106852e in row_undo_step (thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0undo.cc:358
#16 0x0000000000fd16b4 in que_thr_step (thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/que/que0que.cc:1051
#17 0x0000000000fd18cf in que_run_threads_low (thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/que/que0que.cc:1115
#18 0x0000000000fd1a8b in que_run_threads (thr=0x7f59ef87d970) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/que/que0que.cc:1156
#19 0x00000000010b492f in trx_rollback_to_savepoint_low (trx=0x7f5a87800868, savept=0x7f5aad028d10) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/trx/trx0roll.cc:115
#20 0x00000000010b4c66 in trx_rollback_to_savepoint (trx=0x7f5a87800868, savept=0x7f5aad028d10) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/trx/trx0roll.cc:157
#21 0x000000000101be66 in row_mysql_handle_errors (new_err=0x7f5aad028d0c, trx=0x7f5a87800868, thr=0x7f59ef8c2828, savept=0x7f5aad028d10) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0mysql.cc:731
#22 0x000000000101d946 in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7f59ef8cff38 "", prebuilt=0x7f59ef8c2098) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0mysql.cc:1591
#23 0x000000000101dc4c in row_insert_for_mysql (mysql_rec=0x7f59ef8cff38 "", prebuilt=0x7f59ef8c2098) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/row/row0mysql.cc:1695
#24 0x0000000000f1139a in ha_innobase::write_row (this=0x7f59ef8cfc20, record=0x7f59ef8cff38 "") at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/innobase/handler/ha_innodb.cc:6755
#25 0x000000000088cbf5 in handler::ha_write_row (this=0x7f59ef8cfc20, buf=0x7f59ef8cff38 "") at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/handler.cc:7423
#26 0x0000000000bc9662 in copy_data_between_tables (psi=0x0, from=0x7f59ef93bc10, to=0x7f59ef93ca10, create=..., copied=0x7f5aad02b150, deleted=0x7f5aad02b148,keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7f5aad02a680) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_table.cc:9196
#27 0x0000000000bc80c5 in mysql_alter_table (thd=0x7f59ef81c000, new_db=0x7f59ef827f08 "test", new_name=0x0, create_info=0x7f5aad02b510, table_list=0x7f59ef827990, alter_info=0x7f5aad02b460) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_table.cc:8728
#28 0x0000000000d061ab in Sql_cmd_alter_table::execute (this=0x7f59ef828098, thd=0x7f59ef81c000) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_alter.cc:315
#29 0x0000000000b4e222 in mysql_execute_command (thd=0x7f59ef81c000) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_parse.cc:4815
#30 0x0000000000b4fcc1 in mysql_parse (thd=0x7f59ef81c000, parser_state=0x7f5aad02ce60) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_parse.cc:5427
#31 0x0000000000b44814 in dispatch_command (command=COM_QUERY, thd=0x7f59ef81c000, packet=0x7f59ef833011 "ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b)", packet_length=60) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_parse.cc:1250
#32 0x0000000000b4354d in do_command (thd=0x7f59ef81c000) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/sql_parse.cc:834
#33 0x0000000000c4d4ce in handle_connection (arg=0x7f5a8ebffee0) at /bzr/testbuild/mysql-5.7.5-m15_dbg/sql/conn_handler/connection_handler_per_thread.cc:298
#34 0x0000000000e394b8 in pfs_spawn_thread (arg=0x7f5a8f3f8a50) at /bzr/testbuild/mysql-5.7.5-m15_dbg/storage/perfschema/pfs.cc:2137
#35 0x00007f5aacb40df3 in start_thread () from /lib64/libpthread.so.0
#36 0x00007f5aab80a1ad in clone () from /lib64/libc.so.6

How to repeat:
DROP DATABASE transforms;CREATE DATABASE transforms;DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
CREATE TEMPORARY TABLE IF NOT EXISTS t1 (primary key (a)) engine=innodb select * FROM t1 ;
SELECT 1 FROM t1  GROUP BY b HAVING b = 2 OR b = 3 OR SUM(a) > 12;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b); ;
[2 Feb 2015 6:17] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.7.6 debug build is affected.

Thanks,
Umesh
[2 Feb 2015 6:19] MySQL Verification Team
// Extract from error log

2015-02-02T05:42:02.337478Z 0 [Note] bin/mysqld-debug: ready for connections.
Version: '5.7.6-m16-enterprise-commercial-advanced-debug'  socket: '/tmp/mysql_ushastry.sock'  port: 15000  MySQL Enterprise Server - Advanced Edition Debug (Commercial)
2015-02-02 06:42:21 0x7f6118a5e700  InnoDB: Assertion failure in thread 140055002081024 in file btr0cur.cc line 858
InnoDB: Failing assertion: btr_op == BTR_NO_OP || !dict_table_is_temporary(index->table)

(gdb) bt
#0  0x00007f612df72771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000012bc5f8 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/mysys/stacktrace.c:247
#2  0x0000000000b3254e in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f612cb785c9 in raise () from /lib64/libc.so.6
#5  0x00007f612cb79cd8 in abort () from /lib64/libc.so.6
#6  0x00000000015a98fb in ut_dbg_assertion_failed (expr=0x1bdb5c0 "btr_op == BTR_NO_OP || !dict_table_is_temporary(index->table)",
    file=0x1bdaed0 "/export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/btr/btr0cur.cc", line=858)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/ut/ut0dbg.cc:67
#7  0x00000000015d4bc9 in btr_cur_search_to_nth_level (index=0x7f60b40300d8, level=0, tuple=0x7f60b4035e08, mode=PAGE_CUR_RTREE_LOCATE, latch_mode=151554, cursor=0x7f6118a56cc0,
    has_search_latch=0, file=0x1ba9ea0 "/export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0row.cc", line=899, mtr=0x7f6118a56db0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/btr/btr0cur.cc:858
#8  0x00000000016e420d in rtr_pcur_open_low (index=0x7f60b40300d8, level=0, tuple=0x7f60b4035e08, mode=PAGE_CUR_RTREE_LOCATE, latch_mode=151554, cursor=0x7f6118a56cc0,
    file=0x1ba9ea0 "/export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0row.cc", line=899, mtr=0x7f6118a56db0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/gis/gis0sea.cc:581
#9  0x00000000015126d1 in row_search_index_entry (index=0x7f60b40300d8, entry=0x7f60b4035e08, mode=151554, pcur=0x7f6118a56cc0, mtr=0x7f6118a56db0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0row.cc:899
#10 0x00000000016f890d in row_undo_ins_remove_sec_low (mode=151554, index=0x7f60b40300d8, entry=0x7f60b4035e08, thr=0x7f60b40276d0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0uins.cc:230
#11 0x00000000016f8b81 in row_undo_ins_remove_sec (index=0x7f60b40300d8, entry=0x7f60b4035e08, thr=0x7f60b40276d0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0uins.cc:294
#12 0x00000000016f8f67 in row_undo_ins_remove_sec_rec (node=0x7f60b4035308, thr=0x7f60b40276d0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0uins.cc:420
#13 0x00000000016f91d3 in row_undo_ins (node=0x7f60b4035308, thr=0x7f60b40276d0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0uins.cc:474
#14 0x000000000153720a in row_undo (node=0x7f60b4035308, thr=0x7f60b40276d0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0undo.cc:309
#15 0x0000000001537361 in row_undo_step (thr=0x7f60b40276d0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0undo.cc:355
#16 0x000000000149a45d in que_thr_step (thr=0x7f60b40276d0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/que/que0que.cc:1037
#17 0x000000000149a678 in que_run_threads_low (thr=0x7f60b40276d0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/que/que0que.cc:1101
#18 0x000000000149a834 in que_run_threads (thr=0x7f60b40276d0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/que/que0que.cc:1141
#19 0x0000000001587f38 in trx_rollback_to_savepoint_low (trx=0x7f6118e1f8f8, savept=0x7f6118a57fa0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/trx/trx0roll.cc:118
#20 0x000000000158826f in trx_rollback_to_savepoint (trx=0x7f6118e1f8f8, savept=0x7f6118a57fa0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/trx/trx0roll.cc:159
#21 0x00000000014e7751 in row_mysql_handle_errors (new_err=0x7f6118a57f9c, trx=0x7f6118e1f8f8, thr=0x7f60b4034b78, savept=0x7f6118a57fa0)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0mysql.cc:719
#22 0x00000000014e99ec in row_insert_for_mysql_using_ins_graph (mysql_rec=0x7f60b402ec80 "", prebuilt=0x7f60b40343e8)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0mysql.cc:1687
#23 0x00000000014e9ec5 in row_insert_for_mysql (mysql_rec=0x7f60b402ec80 "", prebuilt=0x7f60b40343e8)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/row/row0mysql.cc:1786
#24 0x00000000013c9af3 in ha_innobase::write_row (this=0x7f60b402e9b0, record=0x7f60b402ec80 "")
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/innobase/handler/ha_innodb.cc:6685
#25 0x0000000000ba6a3d in handler::ha_write_row (this=0x7f60b402e9b0, buf=0x7f60b402ec80 "") at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/handler.cc:7323
#26 0x000000000105a6b5 in copy_data_between_tables (psi=0x0, from=0x7f60b4029030, to=0x7f60b40320b0, create=..., copied=0x7f6118a5b070, deleted=0x7f6118a5b068,
    keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7f6118a5a5a0) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_table.cc:9333
#27 0x0000000001059123 in mysql_alter_table (thd=0x7f60b4000c00, new_db=0x7f60b4006420 "test", new_name=0x0, create_info=0x7f6118a5b430, table_list=0x7f60b4005ea8, alter_info=0x7f6118a5b380)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_table.cc:8865
#28 0x000000000119c61f in Sql_cmd_alter_table::execute (this=0x7f60b40065b0, thd=0x7f60b4000c00)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_alter.cc:316
#29 0x0000000000fde845 in mysql_execute_command (thd=0x7f60b4000c00) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:4727
#30 0x0000000000fe03eb in mysql_parse (thd=0x7f60b4000c00, parser_state=0x7f6118a5ce50) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:5356
#31 0x0000000000fd517b in dispatch_command (command=COM_QUERY, thd=0x7f60b4000c00, packet=0x7f60b4009b91 "ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b)", packet_length=60)
    at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:1203
#32 0x0000000000fd3eca in do_command (thd=0x7f60b4000c00) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:789
---Type <return> to continue, or q <return> to quit---
#33 0x00000000010df974 in handle_connection (arg=0x36b9810) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/sql/conn_handler/connection_handler_per_thread.cc:298
#34 0x0000000001348de3 in pfs_spawn_thread (arg=0x3641b80) at /export/home/pb2/build/sb_0-14236670-1422462446.39/mysqlcom-pro-5.7.6-m16/storage/perfschema/pfs.cc:2137
#35 0x00007f612df6ddf3 in start_thread () from /lib64/libpthread.so.0
#36 0x00007f612cc3947d in clone () from /lib64/libc.so.6
[2 Feb 2015 6:20] MySQL Verification Team
// 5.7.6 - Build used

commit: 348792f557bf6d66fc8e794b938c4bb9b917fa5e
date: 2015-01-28 16:35:09 +0100
build-date: 2015-01-28 17:07:08 +0100
short: 348792f
branch: mysql-trunk

MySQL source 5.7.6
[5 Feb 2015 16:12] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.6 release, and here's the changelog entry:

The use of change buffering for a spatial index raised an assertion.
Change buffer flags should not be set for spatial indexes. 

Thank you for the bug report.