Assertion `!m_ordered_rec_buffer' failed in ha_partition::init_record_priority_queue()

Description

1 2 10.0/sql/ha_partition.cc:5090: bool ha_partition::init_record_priority_queue(): Assertion `!m_ordered_rec_buffer' failed. 150916 0:05:40 [ERROR] mysqld got signal 6 ;

Stack trace from 10.0 commit 0ce0b88080fd39f6841206b64d8723af9779e849

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #6 0x00007f0ab8d0c311 in *__GI___assert_fail (assertion=0x11313f1 "!m_ordered_rec_buffer", file=<optimized out>, line=5090, function=0x11340e0 "bool ha_partition::init_record_priority_queue()") at assert.c:81 #7 0x0000000000e23bc8 in ha_partition::init_record_priority_queue (this=0x7f0aad702088) at 10.0/sql/ha_partition.cc:5090 #8 0x0000000000e24086 in ha_partition::index_init (this=0x7f0aad702088, inx=0, sorted=true) at 10.0/sql/ha_partition.cc:5216 #9 0x000000000061570b in handler::ha_index_init (this=0x7f0aad702088, idx=0, sorted=true) at 10.0/sql/handler.h:2618 #10 0x00000000006e0252 in join_read_first (tab=0x7f0ab1c54990) at 10.0/sql/sql_select.cc:18756 #11 0x00000000006ddfd6 in sub_select (join=0x7f0ab1c53928, join_tab=0x7f0ab1c54990, end_of_records=false) at 10.0/sql/sql_select.cc:17822 #12 0x00000000006dd89d in do_select (join=0x7f0ab1c53928, fields=0x7f0aad6b51d8, table=0x0, procedure=0x0) at 10.0/sql/sql_select.cc:17487 #13 0x00000000006baa54 in JOIN::exec_inner (this=0x7f0ab1c53928) at 10.0/sql/sql_select.cc:3082 #14 0x00000000006b7f20 in JOIN::exec (this=0x7f0ab1c53928) at 10.0/sql/sql_select.cc:2371 #15 0x00000000006bb307 in mysql_select (thd=0x7f0aad6b1070, rref_pointer_array=0x7f0aad6b5338, tables=0x7f0ab1c53270, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2148797184, result=0x7f0ab1c53908, unit=0x7f0aad6b49d0, select_lex=0x7f0aad6b50c0) at 10.0/sql/sql_select.cc:3311 #16 0x00000000006b17d1 in handle_select (thd=0x7f0aad6b1070, lex=0x7f0aad6b4908, result=0x7f0ab1c53908, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:373 #17 0x0000000000685edf in execute_sqlcom_select (thd=0x7f0aad6b1070, all_tables=0x7f0ab1c53270) at 10.0/sql/sql_parse.cc:5274 #18 0x000000000067e210 in mysql_execute_command (thd=0x7f0aad6b1070) at 10.0/sql/sql_parse.cc:2562 #19 0x0000000000688a42 in mysql_parse (thd=0x7f0aad6b1070, rawbuf=0x7f0ab1c53088 "SELECT * FROM t1", length=16, parser_state=0x7f0abadf1600) at 10.0/sql/sql_parse.cc:6531 #20 0x000000000067b423 in dispatch_command (command=COM_QUERY, thd=0x7f0aad6b1070, packet=0x7f0aad6f9071 "", packet_length=16) at 10.0/sql/sql_parse.cc:1308 #21 0x000000000067a709 in do_command (thd=0x7f0aad6b1070) at 10.0/sql/sql_parse.cc:999 #22 0x0000000000798d22 in do_handle_one_connection (thd_arg=0x7f0aad6b1070) at 10.0/sql/sql_connect.cc:1378 #23 0x0000000000798a81 in handle_one_connection (arg=0x7f0aad6b1070) at 10.0/sql/sql_connect.cc:1293 #24 0x0000000000cdb41b in pfs_spawn_thread (arg=0x7f0ab2ff57f0) at 10.0/storage/perfschema/pfs.cc:1860 #25 0x00007f0abab06b50 in start_thread (arg=<optimized out>) at pthread_create.c:304 #26 0x00007f0ab8dbc95d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

The test case below is non-deterministic. It fails for me all right, but if it does not for you, try running with --repeat=N, it might help.

Test case

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 --source include/have_innodb.inc --source include/have_partition.inc --enable_connect_log SET GLOBAL innodb_lock_wait_timeout = 3; CREATE TABLE t1 (pk int auto_increment primary key) ENGINE=InnoDB PARTITION BY key (pk) partitions 2; CREATE TABLE t2 (pk int auto_increment primary key) ENGINE=InnoDB; CREATE TABLE t3 (f int) ENGINE=InnoDB; INSERT INTO t3 VALUES (1),(2); --connect (con1,localhost,root,,test) --connect (con2,localhost,root,,test) --send ALTER TABLE t1 FORCE; --connect (con3,localhost,root,,test) START TRANSACTION; INSERT INTO t2 VALUES (1),(2); --connection con1 --send UPDATE t3 SET f = 5; --connection con3 SELECT f FROM t3; --connection con1 --reap --error ER_LOCK_WAIT_TIMEOUT DELETE FROM t2; --connection con3 --error 0,ER_TABLE_DEF_CHANGED REPLACE INTO t2 (pk) SELECT NULL FROM t1; SELECT * FROM t1;

Environment

None

Status

Assignee

Sergey Vojtovich

Reporter

Elena Stepanova

Labels

None

External issue ID

None

External issue ID

None

Components

Sprint

None

Fix versions

Affects versions

10.0
10.1

Priority

Major