Bug #81410 Assertion `multi_range_length > 0' failed. in QUICK_RANGE_SELECT::reset
Submitted: 13 May 2016 4:12 Modified: 23 Jan 2019 11:50
Reporter: Roel Van de Paar Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:5.5.49 OS:Any
Assigned to: CPU Architecture:Any

[13 May 2016 4:12] Roel Van de Paar
Description:
mysqld: /git/percona-server_dbg/sql/opt_range.cc:8727: virtual int QUICK_RANGE_SELECT::reset(): Assertion `multi_range_length > 0' failed.
01:36:07 UTC - mysqld got signal 6 ;

+bt
#0  0x00007f6e31183741 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007de0c8 in my_write_core (sig=6) at /git/mysql-server/mysys/stacktrace.c:433
#2  0x00000000006a1088 in handle_fatal_signal (sig=6) at /git/mysql-server/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f6e301a45f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f6e301a5ce8 in __GI_abort () at abort.c:90
#6  0x00007f6e3019d566 in __assert_fail_base (fmt=0x7f6e302ed228 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xb17c85 "multi_range_length > 0", file=file@entry=0xb16cc8 "/git/mysql-server/sql/opt_range.cc", line=line@entry=8727, function=function@entry=0xb18600 <QUICK_RANGE_SELECT::reset()::__PRETTY_FUNCTION__> "virtual int QUICK_RANGE_SELECT::reset()") at assert.c:92
#7  0x00007f6e3019d612 in __GI___assert_fail (assertion=0xb17c85 "multi_range_length > 0", file=0xb16cc8 "/git/mysql-server/sql/opt_range.cc", line=8727, function=0xb18600 <QUICK_RANGE_SELECT::reset()::__PRETTY_FUNCTION__> "virtual int QUICK_RANGE_SELECT::reset()") at assert.c:101
#8  0x000000000075fdd1 in QUICK_RANGE_SELECT::reset (this=0x7f6d974ad000) at /git/mysql-server/sql/opt_range.cc:8727
#9  0x00000000005aec4b in join_init_read_record (tab=0x7f6d974264d8) at /git/mysql-server/sql/sql_select.cc:12619
#10 0x00000000005b659d in sub_select (join=join@entry=0x7f6d9745e010, join_tab=join_tab@entry=0x7f6d974264d8, end_of_records=end_of_records@entry=false) at /git/mysql-server/sql/sql_select.cc:11848
#11 0x00000000005beaa4 in do_select (join=join@entry=0x7f6d9745e010, fields=fields@entry=0x7f6d9c1aa188, table=table@entry=0x0, procedure=0x0) at /git/mysql-server/sql/sql_select.cc:11614
#12 0x00000000005d27fd in JOIN::exec (this=this@entry=0x7f6d9745e010) at /git/mysql-server/sql/sql_select.cc:2400
#13 0x00000000005cc82d in mysql_select (thd=thd@entry=0x7f6d9c1a8000, rref_pointer_array=rref_pointer_array@entry=0x7f6d9c1aa260, tables=0x7f6d97425218, wild_num=1, fields=..., conds=<optimized out>, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=select_options@entry=2147748608, result=result@entry=0x7f6d97425af0, unit=unit@entry=0x7f6d9c1a9a58, select_lex=select_lex@entry=0x7f6d9c1aa078) at /git/mysql-server/sql/sql_select.cc:2619
#14 0x00000000005cca25 in handle_select (thd=thd@entry=0x7f6d9c1a8000, lex=lex@entry=0x7f6d9c1a99a8, result=result@entry=0x7f6d97425af0, setup_tables_done_option=setup_tables_done_option@entry=0) at /git/mysql-server/sql/sql_select.cc:297
#15 0x0000000000583b27 in execute_sqlcom_select (thd=thd@entry=0x7f6d9c1a8000, all_tables=<optimized out>) at /git/mysql-server/sql/sql_parse.cc:4625
#16 0x00000000005899c6 in mysql_execute_command (thd=thd@entry=0x7f6d9c1a8000) at /git/mysql-server/sql/sql_parse.cc:2176
#17 0x0000000000590ff6 in mysql_parse (thd=thd@entry=0x7f6d9c1a8000, rawbuf=<optimized out>, length=46, parser_state=parser_state@entry=0x7f6e31794680) at /git/mysql-server/sql/sql_parse.cc:5780
#18 0x0000000000592843 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f6d9c1a8000, packet=packet@entry=0x7f6d9c19ab01 "", packet_length=packet_length@entry=46) at /git/mysql-server/sql/sql_parse.cc:1038
#19 0x00000000005946cc in do_command (thd=0x7f6d9c1a8000) at /git/mysql-server/sql/sql_parse.cc:773
#20 0x000000000063c978 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f6d9c1a8000) at /git/mysql-server/sql/sql_connect.cc:862
#21 0x000000000063ca35 in handle_one_connection (arg=0x7f6d9c1a8000) at /git/mysql-server/sql/sql_connect.cc:781
#22 0x00007f6e3117edc5 in start_thread (arg=0x7f6e31795700) at pthread_create.c:308
#23 0x00007f6e3026521d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.multi_range_count=4294967296;
CREATE TABLE t1(C1 INT,C2 INT,KEY C1(C1),KEY C2(C2))ENGINE=InnoDB;
INSERT INTO t1 VALUES 0,"First row,p11");
INSERT INTO t1 VALUES 0,null);
SELECT * FROM t1 WHERE c1<'2010-00-01' LIMIT 2;
[13 May 2016 4:19] Roel Van de Paar
Perhaps some light connection with bug 81411
[13 May 2016 4:20] Roel Van de Paar
Ignore last comment, was meant for another bug
[13 May 2016 6:49] Umesh Shastry
Hello Roel,

Thank you for the report and test case.
Observed that 5.5.49(also, 5.5.51 daily build) debug build is
affected.

Thanks,
Umesh
[18 May 2016 19:21] Erlend Dahl
Posted by developer:
 
This looks like it was fixed sometime in 5.6. At least I can't repro, neither on 5.6, 5.7 nor trunk.

I suggest closing as "Can't repeat".
[19 May 2016 0:48] Roel Van de Paar
Erlend, this bug is logged against 5.5.49. The correct status is not "Can't repeat" as clearly Umesh "Can repeat" on 5.5. And as I understand, 5.5 is not EOL https://www.mysql.com/support/eol-notice.html
[23 Jan 2019 11:50] Erlend Dahl
5.5 is covered under Oracle Lifetime Sustaining Support and will no longer be supported with updates. See

https://www.mysql.com/support/eol-notice.html