Assertio n `part_rec_buf_ptr' failed in int Partition_helper::handle_ordered_index_scan(uchar*)
Description
Environment
Smart Checklist
Activity

KennT April 4, 2017 at 6:11 AM
Filed upstream bug:
https://bugs.launchpad.net/percona-server/+bug/1679478

KennT April 4, 2017 at 5:43 AMEdited
The same failure occurs in PS (5.7) also:
mysql> select @@version;
-----------
@@version |
-----------
5.7.17-11 |
-----------
1 row in set (0.00 sec)
mysql> CREATE TABLE t1 ( a int not null, b int not null, c int not null, primary key(a,b)) partition by range (a) (partition x1 values less than (1));
Query OK, 0 rows affected (0.01 sec)
mysql> select * FROM t1 where (a = 1 and b = 1 and c = 'b') or (a > 2) order by a desc;
(segfault)
==== GDB output ====
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdb73d700 (LWP 113356)]
Partition_helper::handle_ordered_index_scan (this=0x7fffb4019d50, buf=0x7fffb4019ed0 "\377")
at /home/kennt/dev/ps/sql/partitioning/partition_handler.cc:3248
3248 m_queue->clear();
(gdb) bt
#0 Partition_helper::handle_ordered_index_scan (this=0x7fffb4019d50, buf=0x7fffb4019ed0 "\377")
at /home/kennt/dev/ps/sql/partitioning/partition_handler.cc:3248
#1 0x000000000081cfb7 in handler::ha_index_last (this=0x7fffb4019850, buf=0x7fffb4019ed0 "\377")
at /home/kennt/dev/ps/sql/handler.cc:3502
#2 0x0000000000dfb82d in QUICK_SELECT_DESC::get_next (this=0x7fffb40116f0)
at /home/kennt/dev/ps/sql/opt_range.cc:11479
#3 0x0000000000c25efa in rr_quick (info=0x7fffb4936998) at /home/kennt/dev/ps/sql/records.cc:398
#4 0x0000000000c94d5b in sub_select (join=0x7fffb49302a8, qep_tab=0x7fffb4936948,
end_of_records=<optimized out>) at /home/kennt/dev/ps/sql/sql_executor.cc:1271
#5 0x0000000000c8db47 in do_select (join=0x7fffb49302a8) at /home/kennt/dev/ps/sql/sql_executor.cc:944
#6 JOIN::exec (this=0x7fffb49302a8) at /home/kennt/dev/ps/sql/sql_executor.cc:199
#7 0x0000000000cfd3ed in handle_query (thd=thd@entry=0x7fffb4000ae0, lex=lex@entry=0x7fffb4002ed0,
result=result@entry=0x7fffb4007770, added_options=added_options@entry=0,
removed_options=removed_options@entry=0) at /home/kennt/dev/ps/sql/sql_select.cc:185
#8 0x00000000007779b7 in execute_sqlcom_select (thd=thd@entry=0x7fffb4000ae0, all_tables=<optimized out>)
at /home/kennt/dev/ps/sql/sql_parse.cc:5482
#9 0x0000000000cc0626 in mysql_execute_command (thd=thd@entry=0x7fffb4000ae0,
first_level=first_level@entry=true) at /home/kennt/dev/ps/sql/sql_parse.cc:2941
#10 0x0000000000cc3835 in mysql_parse (thd=thd@entry=0x7fffb4000ae0,
parser_state=parser_state@entry=0x7fffdb73c180) at /home/kennt/dev/ps/sql/sql_parse.cc:5927
#11 0x0000000000cc437a in dispatch_command (thd=thd@entry=0x7fffb4000ae0,
com_data=com_data@entry=0x7fffdb73cdc0, command=COM_QUERY) at /home/kennt/dev/ps/sql/sql_parse.cc:1493
#12 0x0000000000cc5cf7 in do_command (thd=thd@entry=0x7fffb4000ae0)
at /home/kennt/dev/ps/sql/sql_parse.cc:1021
#13 0x0000000000d89bd0 in handle_connection (arg=arg@entry=0x2541f30)
at /home/kennt/dev/ps/sql/conn_handler/connection_handler_per_thread.cc:312
#14 0x0000000000efbf64 in pfs_spawn_thread (arg=0x252f850)
at /home/kennt/dev/ps/storage/perfschema/pfs.cc:2188
#15 0x00007ffff7164184 in start_thread (arg=0x7fffdb73d700) at pthread_create.c:312
#16 0x00007ffff6671bed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) p m_queue
$2 = (Partition_helper::Prio_queue *) 0x0

KennT March 31, 2017 at 12:25 AM
This variable, part_rec_buf_ptr, is initialized to m_ordered_rec_buffer. This is initialized only in Partition_helper::init_record_priority_queue(). And is cleared when the Partition_helper::destroy_record_priority_queue() is called.
Details
Details
Assignee

Reporter

Labels
Affects versions
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist

GDB info