|
I don't want to create yet another issue for this assertion, so I'll extend this one in hope that this all has the same root cause.
CREATE TABLE t1 (d DATE);
|
INSERT INTO t1 VALUES ('2020-12-12'),('1900-11-11');
|
SELECT * FROM t1 ORDER BY CASE 1 WHEN 1 THEN (IS_FREE_LOCK('x') DIV (1 << 2)) WHEN 2 THEN WEEKDAY(d) END;
|
|
# Cleanup
|
DROP TABLE t1;
|
|
10.3 75538f94
|
mysqld: /data/src/10.3/strings/decimal.c:1484: decimal_bin_size: Assertion `precision > 0' failed.
|
210127 1:36:55 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f74f9138f36 in __GI___assert_fail (assertion=0x5604e833b525 "precision > 0", file=0x5604e833b2a0 "/data/src/10.3/strings/decimal.c", line=1484, function=0x5604e833b790 <__PRETTY_FUNCTION__.14235> "decimal_bin_size") at assert.c:101
|
#8 0x00005604e7e3f32f in decimal_bin_size (precision=0, scale=0) at /data/src/10.3/strings/decimal.c:1484
|
#9 0x00005604e72c8de9 in my_decimal_get_binary_size (precision=0, scale=0) at /data/src/10.3/sql/my_decimal.h:263
|
#10 0x00005604e755b7d6 in Type_handler_decimal_result::sortlength (this=0x5604e868a998 <type_handler_newdecimal>, thd=0x7f74d8000d90, item=0x7f74d8013c78, sortorder=0x7f74d80164c8) at /data/src/10.3/sql/filesort.cc:1914
|
#11 0x00005604e755b973 in sortlength (thd=0x7f74d8000d90, sortorder=0x7f74d80164c8, s_length=0, multi_byte_charset=0x7f74f4101faf) at /data/src/10.3/sql/filesort.cc:1960
|
#12 0x00005604e755639f in filesort (thd=0x7f74d8000d90, table=0x7f74d8036310, filesort=0x7f74d8015da8, tracker=0x7f74d8016448, join=0x7f74d8013fa0, first_table_bit=1) at /data/src/10.3/sql/filesort.cc:186
|
#13 0x00005604e72ba4f5 in create_sort_index (thd=0x7f74d8000d90, join=0x7f74d8013fa0, tab=0x7f74d80152c8, fsort=0x7f74d8015da8) at /data/src/10.3/sql/sql_select.cc:22923
|
#14 0x00005604e72b46c2 in st_join_table::sort_table (this=0x7f74d80152c8) at /data/src/10.3/sql/sql_select.cc:20686
|
#15 0x00005604e72b429a in join_init_read_record (tab=0x7f74d80152c8) at /data/src/10.3/sql/sql_select.cc:20627
|
#16 0x00005604e72b1fd2 in sub_select (join=0x7f74d8013fa0, join_tab=0x7f74d80152c8, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19708
|
#17 0x00005604e72b1507 in do_select (join=0x7f74d8013fa0, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:19251
|
#18 0x00005604e72884cf in JOIN::exec_inner (this=0x7f74d8013fa0) at /data/src/10.3/sql/sql_select.cc:4124
|
#19 0x00005604e728788e in JOIN::exec (this=0x7f74d8013fa0) at /data/src/10.3/sql/sql_select.cc:3918
|
#20 0x00005604e7288bab in mysql_select (thd=0x7f74d8000d90, tables=0x7f74d8012d50, wild_num=1, fields=..., conds=0x0, og_num=1, order=0x7f74d8013e50, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f74d8013f78, unit=0x7f74d8004c58, select_lex=0x7f74d80053e0) at /data/src/10.3/sql/sql_select.cc:4323
|
#21 0x00005604e727a13e in handle_select (thd=0x7f74d8000d90, lex=0x7f74d8004b98, result=0x7f74d8013f78, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
|
#22 0x00005604e7240804 in execute_sqlcom_select (thd=0x7f74d8000d90, all_tables=0x7f74d8012d50) at /data/src/10.3/sql/sql_parse.cc:6316
|
#23 0x00005604e7237011 in mysql_execute_command (thd=0x7f74d8000d90) at /data/src/10.3/sql/sql_parse.cc:3847
|
#24 0x00005604e7244b88 in mysql_parse (thd=0x7f74d8000d90, rawbuf=0x7f74d8012ab8 "SELECT * FROM t1 ORDER BY CASE 1 WHEN 1 THEN (IS_FREE_LOCK('x') DIV (1 << 2)) WHEN 2 THEN WEEKDAY(d) END", length=104, parser_state=0x7f74f41035c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7840
|
#25 0x00005604e72312ec in dispatch_command (command=COM_QUERY, thd=0x7f74d8000d90, packet=0x7f74d8008f11 "", packet_length=104, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
|
#26 0x00005604e722fc8c in do_command (thd=0x7f74d8000d90) at /data/src/10.3/sql/sql_parse.cc:1398
|
#27 0x00005604e73ae295 in do_handle_one_connection (connect=0x5604ea3d5070) at /data/src/10.3/sql/sql_connect.cc:1403
|
#28 0x00005604e73adff1 in handle_one_connection (arg=0x5604ea3d5070) at /data/src/10.3/sql/sql_connect.cc:1308
|
#29 0x00005604e7d7a027 in pfs_spawn_thread (arg=0x5604ea3b8440) at /data/src/10.3/storage/perfschema/pfs.cc:1869
|
#30 0x00007f74f9648609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#31 0x00007f74f9224293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
CREATE TABLE t1 (d DATE);
|
INSERT INTO t1 VALUES ('2020-12-12'),('1900-11-11');
|
SELECT d FROM t1 GROUP BY d ORDER BY CASE 1 WHEN 1 THEN (IS_FREE_LOCK('x') DIV (1 << 2)) WHEN 2 THEN WEEKDAY(d) END;
|
|
# Cleanup
|
DROP TABLE t1;
|
|
10.3 75538f94
|
mysqld: /data/src/10.3/strings/decimal.c:1484: decimal_bin_size: Assertion `precision > 0' failed.
|
210127 1:38:12 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f25b4ea2f36 in __GI___assert_fail (assertion=0x5594e9ff9525 "precision > 0", file=0x5594e9ff92a0 "/data/src/10.3/strings/decimal.c", line=1484, function=0x5594e9ff9790 <__PRETTY_FUNCTION__.14235> "decimal_bin_size") at assert.c:101
|
#8 0x00005594e9afd32f in decimal_bin_size (precision=0, scale=0) at /data/src/10.3/strings/decimal.c:1484
|
#9 0x00005594e8f86de9 in my_decimal_get_binary_size (precision=0, scale=0) at /data/src/10.3/sql/my_decimal.h:263
|
#10 0x00005594e91dfda1 in Field_new_decimal::Field_new_decimal (this=0x7f25940acc48, ptr_arg=0x0, len_arg=0, null_ptr_arg=0x5594e9b23233 "", null_bit_arg=0 '\000', unireg_check_arg=Field::NONE, field_name_arg=0x7f2594013e50, dec_arg=0 '\000', zero_arg=false, unsigned_arg=false) at /data/src/10.3/sql/field.cc:3137
|
#11 0x00005594e90f9f90 in Type_handler_newdecimal::make_table_field (this=0x5594ea348998 <type_handler_newdecimal>, name=0x7f2594013e50, addr=..., attr=..., table=0x7f25940390a8) at /data/src/10.3/sql/sql_type.cc:2206
|
#12 0x00005594e90f9645 in Type_handler::make_and_init_table_field (this=0x5594ea348998 <type_handler_newdecimal>, name=0x7f2594013e50, addr=..., attr=..., table=0x7f25940390a8) at /data/src/10.3/sql/sql_type.cc:2033
|
#13 0x00005594e8dde64d in Item::tmp_table_field_from_field_type (this=0x7f2594013e00, table=0x7f25940390a8) at /data/src/10.3/sql/item.h:707
|
#14 0x00005594e8ddfb4c in Item::create_tmp_field (this=0x7f2594013e00, group=false, table=0x7f25940390a8) at /data/src/10.3/sql/item.h:1948
|
#15 0x00005594e8f686f7 in create_tmp_field_from_item (thd=0x7f2594000d90, item=0x7f2594013e00, table=0x7f25940390a8, copy_func=0x7f25b0052f78, modify_item=true) at /data/src/10.3/sql/sql_select.cc:17117
|
#16 0x00005594e8f6907b in create_tmp_field (thd=0x7f2594000d90, table=0x7f25940390a8, item=0x7f2594013e00, type=Item::FUNC_ITEM, copy_func=0x7f25b0052f78, from_field=0x7f259403a1c0, default_field=0x7f259403a1a0, group=true, modify_item=true, table_cant_handle_bit_fields=false, make_copy_field=false) at /data/src/10.3/sql/sql_select.cc:17343
|
#17 0x00005594e8f6a5c3 in create_tmp_table (thd=0x7f2594000d90, param=0x7f2594016230, fields=..., group=0x7f25940134f8, distinct=false, save_sum_fields=false, select_options=2147748608, rows_limit=18446744073709551615, table_alias=0x5594ea20ef00 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /data/src/10.3/sql/sql_select.cc:17723
|
#18 0x00005594e8f43b67 in JOIN::create_postjoin_aggr_table (this=0x7f2594014130, tab=0x7f2594015750, table_fields=0x7f2594014450, table_group=0x7f25940134f8, save_sum_fields=false, distinct=false, keep_row_order=false) at /data/src/10.3/sql/sql_select.cc:3432
|
#19 0x00005594e8f421b0 in JOIN::make_aggr_tables_info (this=0x7f2594014130) at /data/src/10.3/sql/sql_select.cc:3032
|
#20 0x00005594e8f40ba0 in JOIN::optimize_stage2 (this=0x7f2594014130) at /data/src/10.3/sql/sql_select.cc:2679
|
#21 0x00005594e8f3e5f0 in JOIN::optimize_inner (this=0x7f2594014130) at /data/src/10.3/sql/sql_select.cc:1985
|
#22 0x00005594e8f3c9c0 in JOIN::optimize (this=0x7f2594014130) at /data/src/10.3/sql/sql_select.cc:1501
|
#23 0x00005594e8f46b12 in mysql_select (thd=0x7f2594000d90, tables=0x7f2594012d70, wild_num=0, fields=..., conds=0x0, og_num=2, order=0x7f2594013fe0, group=0x7f25940134f8, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f2594014108, unit=0x7f2594004c58, select_lex=0x7f25940053e0) at /data/src/10.3/sql/sql_select.cc:4309
|
#24 0x00005594e8f3813e in handle_select (thd=0x7f2594000d90, lex=0x7f2594004b98, result=0x7f2594014108, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
|
#25 0x00005594e8efe804 in execute_sqlcom_select (thd=0x7f2594000d90, all_tables=0x7f2594012d70) at /data/src/10.3/sql/sql_parse.cc:6316
|
#26 0x00005594e8ef5011 in mysql_execute_command (thd=0x7f2594000d90) at /data/src/10.3/sql/sql_parse.cc:3847
|
#27 0x00005594e8f02b88 in mysql_parse (thd=0x7f2594000d90, rawbuf=0x7f2594012ab8 "SELECT d FROM t1 GROUP BY d ORDER BY CASE 1 WHEN 1 THEN (IS_FREE_LOCK('x') DIV (1 << 2)) WHEN 2 THEN WEEKDAY(d) END", length=115, parser_state=0x7f25b00545c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7840
|
#28 0x00005594e8eef2ec in dispatch_command (command=COM_QUERY, thd=0x7f2594000d90, packet=0x7f2594008f11 "SELECT d FROM t1 GROUP BY d ORDER BY CASE 1 WHEN 1 THEN (IS_FREE_LOCK('x') DIV (1 << 2)) WHEN 2 THEN WEEKDAY(d) END", packet_length=115, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
|
#29 0x00005594e8eedc8c in do_command (thd=0x7f2594000d90) at /data/src/10.3/sql/sql_parse.cc:1398
|
#30 0x00005594e906c295 in do_handle_one_connection (connect=0x5594ec48d070) at /data/src/10.3/sql/sql_connect.cc:1403
|
#31 0x00005594e906bff1 in handle_one_connection (arg=0x5594ec48d070) at /data/src/10.3/sql/sql_connect.cc:1308
|
#32 0x00005594e9a38027 in pfs_spawn_thread (arg=0x5594ec470440) at /data/src/10.3/storage/perfschema/pfs.cc:1869
|
#33 0x00007f25b53b2609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#34 0x00007f25b4f8e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Unlike the test case in the description, both ones above don't fail on 10.2, but fail on 10.3+, including 10.5 and 10.6.
|