Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.1(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
None
Description
--source include/have_partition.inc
|
|
CREATE TABLE t1 (a INT PRIMARY KEY) PARTITION BY LIST(a) (PARTITION p1 VALUES IN (1,2)); |
INSERT INTO t1 VALUES (1),(2); |
SELECT MAX(a) FROM t1 WHERE a > 4; |
|
# Cleanup
|
DROP TABLE t1; |
10.2 fa6d710b |
mysqld: /data/src/10.2/sql/ha_partition.cc:6133: int ha_partition::handle_ordered_index_scan(uchar*, bool): Assertion `bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)' failed.
|
201126 0:15:01 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f8d48ed8f36 in __GI___assert_fail (assertion=0x55d5474ae440 "bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)", file=0x55d5474ac100 "/data/src/10.2/sql/ha_partition.cc", line=6133, function=0x55d5474ae400 "int ha_partition::handle_ordered_index_scan(uchar*, bool)") at assert.c:101
|
#8 0x000055d54713d710 in ha_partition::handle_ordered_index_scan (this=0x7f8d280a1258, buf=0x7f8d280068e0 "\377\004", reverse_order=false) at /data/src/10.2/sql/ha_partition.cc:6133
|
#9 0x000055d54713c577 in ha_partition::common_first_last (this=0x7f8d280a1258, buf=0x7f8d280068e0 "\377\004") at /data/src/10.2/sql/ha_partition.cc:5615
|
#10 0x000055d54713c4b1 in ha_partition::index_last (this=0x7f8d280a1258, buf=0x7f8d280068e0 "\377\004") at /data/src/10.2/sql/ha_partition.cc:5594
|
#11 0x000055d546a27bb5 in handler::ha_index_last (this=0x7f8d280a1258, buf=0x7f8d280068e0 "\377\004") at /data/src/10.2/sql/handler.cc:2828
|
#12 0x000055d546b9476b in get_index_max_value (table=0x7f8d280a0650, ref=0x7f8d3f00b570, range_fl=2) at /data/src/10.2/sql/opt_sum.cc:211
|
#13 0x000055d546b94f10 in opt_sum_query (thd=0x7f8d28000d90, tables=..., all_fields=..., conds=0x7f8d28013238) at /data/src/10.2/sql/opt_sum.cc:403
|
#14 0x000055d5467e0a4a in JOIN::optimize_inner (this=0x7f8d28013480) at /data/src/10.2/sql/sql_select.cc:1500
|
#15 0x000055d5467df416 in JOIN::optimize (this=0x7f8d28013480) at /data/src/10.2/sql/sql_select.cc:1117
|
#16 0x000055d5467e8954 in mysql_select (thd=0x7f8d28000d90, tables=0x7f8d28012a68, wild_num=0, fields=..., conds=0x7f8d28013238, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f8d28013460, unit=0x7f8d28004988, select_lex=0x7f8d280050c8) at /data/src/10.2/sql/sql_select.cc:3822
|
#17 0x000055d5467dcb5e in handle_select (thd=0x7f8d28000d90, lex=0x7f8d280048c8, result=0x7f8d28013460, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
|
#18 0x000055d5467a74c5 in execute_sqlcom_select (thd=0x7f8d28000d90, all_tables=0x7f8d28012a68) at /data/src/10.2/sql/sql_parse.cc:6249
|
#19 0x000055d54679de14 in mysql_execute_command (thd=0x7f8d28000d90) at /data/src/10.2/sql/sql_parse.cc:3558
|
#20 0x000055d5467ab253 in mysql_parse (thd=0x7f8d28000d90, rawbuf=0x7f8d280126f8 "SELECT MAX(a) FROM t1 WHERE a > 4", length=33, parser_state=0x7f8d3f00d5f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7761
|
#21 0x000055d5467994e8 in dispatch_command (command=COM_QUERY, thd=0x7f8d28000d90, packet=0x7f8d28008b51 "SELECT MAX(a) FROM t1 WHERE a > 4", packet_length=33, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
|
#22 0x000055d546797fe3 in do_command (thd=0x7f8d28000d90) at /data/src/10.2/sql/sql_parse.cc:1381
|
#23 0x000055d5468f2309 in do_handle_one_connection (connect=0x55d549ed78e0) at /data/src/10.2/sql/sql_connect.cc:1336
|
#24 0x000055d5468f206e in handle_one_connection (arg=0x55d549ed78e0) at /data/src/10.2/sql/sql_connect.cc:1241
|
#25 0x000055d547119a76 in pfs_spawn_thread (arg=0x55d549ebac70) at /data/src/10.2/storage/perfschema/pfs.cc:1869
|
#26 0x00007f8d493e8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#27 0x00007f8d48fc4293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Reproducible on 10.1+, including old releases, with at least MyISAM and InnoDB.
No obvious problem on a non-debug build.
Attachments
Issue Links
- relates to
-
MDEV-31878 Assertion `bit < map->n_bits' failed in bitmap_is_set
-
- Confirmed
-
There is an additional regression in 10.4+.(Ref next comment).The following testcase crashes in 10.4+ only:
Leads to:
10.10.0 081a284712bb661349e2e3802077b12211cede3e (Debug)
mysqld: /test/10.10_dbg/sql/ha_partition.cc:7814: int ha_partition::handle_ordered_index_scan(uchar*, bool): Assertion `bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)' failed.
10.10.0 081a284712bb661349e2e3802077b12211cede3e (Debug)
Core was generated by `/test/MD310522-mariadb-10.10.0-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 0x14c7eb52e700 (LWP 1184333))]
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000014c81cb04859 in __GI_abort () at abort.c:79
#2 0x000014c81cb04729 in __assert_fail_base (fmt=0x14c81cc9a588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x557d73a17da0 "bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)", file=0x557d73a16418 "/test/10.10_dbg/sql/ha_partition.cc", line=7814, function=<optimized out>) at assert.c:92
#3 0x000014c81cb15fd6 in __GI___assert_fail (assertion=assertion@entry=0x557d73a17da0 "bitmap_is_set(&m_part_info->read_partitions, m_part_spec.start_part)", file=file@entry=0x557d73a16418 "/test/10.10_dbg/sql/ha_partition.cc", line=line@entry=7814, function=function@entry=0x557d73a17de8 "int ha_partition::handle_ordered_index_scan(uchar*, bool)") at assert.c:101
#4 0x0000557d731c7c58 in ha_partition::handle_ordered_index_scan (this=this@entry=0x14c7a00281e0, buf=buf@entry=0x14c7a0027d68 "\377\001", reverse_order=reverse_order@entry=false) at /test/10.10_dbg/sql/ha_partition.cc:7814
#5 0x0000557d731c88b1 in ha_partition::common_first_last (this=0x14c7a00281e0, buf=0x14c7a0027d68 "\377\001") at /test/10.10_dbg/sql/ha_partition.cc:6042
#6 0x0000557d731c893a in ha_partition::index_last (this=<optimized out>, buf=<optimized out>) at /test/10.10_dbg/sql/ha_partition.cc:6017
#7 0x0000557d72f12353 in handler::ha_index_last (this=0x14c7a00281e0, buf=0x14c7a0027d68 "\377\001") at /test/10.10_dbg/sql/handler.cc:3586
#8 0x0000557d72b2aa5d in get_index_max_value (range_fl=<optimized out>, ref=0x14c7eb52bb60, table=0x14c7a001bb18) at /test/10.10_dbg/sql/handler.h:3428
#9 opt_sum_query (thd=0x14c7a0000db8, tables=@0x14c7a0013ee0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c7a0015de8, last = 0x14c7a0015de8, elements = 1}, <No data fields>}, all_fields=@0x14c7a0015b98: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c7a00143a0, last = 0x14c7a00143a0, elements = 1}, <No data fields>}, conds=0x14c7a0014ca0) at /test/10.10_dbg/sql/opt_sum.cc:410
#10 0x0000557d72cb0c98 in JOIN::optimize_inner (this=this@entry=0x14c7a0015830) at /test/10.10_dbg/sql/sql_select.cc:2411
#11 0x0000557d72cb1452 in JOIN::optimize (this=this@entry=0x14c7a0015830) at /test/10.10_dbg/sql/sql_select.cc:1845
#12 0x0000557d72cb1545 in mysql_select (thd=thd@entry=0x14c7a0000db8, tables=0x14c7a0014400, fields=@0x14c7a0013f68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c7a00143a0, last = 0x14c7a00143a0, elements = 1}, <No data fields>}, conds=0x14c7a0014ca0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14c7a0015808, unit=0x14c7a0004fd8, select_lex=0x14c7a0013cc8) at /test/10.10_dbg/sql/sql_select.cc:5030
#13 0x0000557d72cb1d8e in handle_select (thd=thd@entry=0x14c7a0000db8, lex=lex@entry=0x14c7a0004f00, result=result@entry=0x14c7a0015808, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.10_dbg/sql/sql_select.cc:578
#14 0x0000557d72c1db5e in execute_sqlcom_select (thd=thd@entry=0x14c7a0000db8, all_tables=0x14c7a0014400) at /test/10.10_dbg/sql/sql_parse.cc:6260
#15 0x0000557d72c29e70 in mysql_execute_command (thd=thd@entry=0x14c7a0000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.10_dbg/sql/sql_parse.cc:3944
#16 0x0000557d72c17e3a in mysql_parse (thd=thd@entry=0x14c7a0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c7eb52d470) at /test/10.10_dbg/sql/sql_parse.cc:8036
#17 0x0000557d72c25422 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c7a0000db8, packet=packet@entry=0x14c7a000b6d9 "SELECT MAX(c) FROM t WHERE c>1", packet_length=packet_length@entry=30, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_class.h:1364
#18 0x0000557d72c27b2c in do_command (thd=0x14c7a0000db8, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_parse.cc:1407
#19 0x0000557d72d873c0 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x557d75f80e58, put_in_cache=put_in_cache@entry=true) at /test/10.10_dbg/sql/sql_connect.cc:1418
#20 0x0000557d72d878c9 in handle_one_connection (arg=0x557d75f80e58) at /test/10.10_dbg/sql/sql_connect.cc:1312
#21 0x000014c81d015609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x000014c81cc01133 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), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (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 (opt), 10.8.4 (opt), 10.9.2 (opt), 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), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)