Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.7.0, 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.1(EOL), 11.2(EOL), 11.4, 11.5(EOL), 11.6(EOL)
-
None
Description
CREATE TABLE t1 (s TIMESTAMP); |
INSERT INTO t1 VALUES ('2033-06-06'),('2015-09-10'); |
SELECT NULLIF( s, NULL ) AS f FROM t1 GROUP BY s WITH ROLLUP; |
|
# Cleanup
|
DROP TABLE t1; |
10.4 non-debug bf2a2444 |
SELECT NULLIF( s, NULL ) AS f FROM t1 GROUP BY s WITH ROLLUP; |
f
|
2033-06-06 00:00:00
|
2033-06-06 00:00:00
|
NULL |
The expected result is
10.3 |
SELECT NULLIF( s, NULL ) AS f FROM t1 GROUP BY s WITH ROLLUP; |
f
|
2015-09-10 00:00:00
|
2033-06-06 00:00:00
|
NULL |
10.4 debug bf2a2444 |
mysqld: /data/src/10.4/sql/item.h:1344: virtual bool Item::val_native(THD*, Native*): Assertion `0' failed.
|
200613 17:07:15 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f158b3e1f12 in __GI___assert_fail (assertion=0x560fb2c5a400 "0", file=0x560fb2c5a3d3 "/data/src/10.4/sql/item.h", line=1344, function=0x560fb2c5a940 <Item::val_native(THD*, Native*)::__PRETTY_FUNCTION__> "virtual bool Item::val_native(THD*, Native*)") at assert.c:101
|
#8 0x0000560fb1e6e770 in Item::val_native (this=0x7f1574017150, thd=0x7f1574000af0, to=0x7f1585589da0) at /data/src/10.4/sql/item.h:1344
|
#9 0x0000560fb2027fcf in Item::val_native_from_item (this=0x7f1574015658, thd=0x7f1574000af0, item=0x7f1574017150, to=0x7f1585589da0) at /data/src/10.4/sql/item.h:867
|
#10 0x0000560fb231ccec in Item_ref::val_native (this=0x7f1574015658, thd=0x7f1574000af0, to=0x7f1585589da0) at /data/src/10.4/sql/item.cc:8268
|
#11 0x0000560fb21b9b49 in Type_handler_timestamp_common::Item_val_native_with_conversion (this=0x560fb375ac00 <type_handler_timestamp2>, thd=0x7f1574000af0, item=0x7f1574015658, to=0x7f1585589da0) at /data/src/10.4/sql/sql_type.cc:8261
|
#12 0x0000560fb2257390 in Item::val_native_with_conversion (this=0x7f1574015658, thd=0x7f1574000af0, to=0x7f1585589da0, th=0x560fb375ac00 <type_handler_timestamp2>) at /data/src/10.4/sql/item.h:1302
|
#13 0x0000560fb2257342 in Item::val_native_with_conversion_from_item (this=0x7f15740138d0, thd=0x7f1574000af0, item=0x7f1574015658, to=0x7f1585589da0, handler=0x560fb375ac00 <type_handler_timestamp2>) at /data/src/10.4/sql/item.h:881
|
#14 0x0000560fb2337da6 in Item_func_nullif::native_op (this=0x7f15740138d0, thd=0x7f1574000af0, to=0x7f1585589da0) at /data/src/10.4/sql/item_cmpfunc.cc:2934
|
#15 0x0000560fb1f7515f in Item_func_hybrid_field_type::val_native (this=0x7f15740138d0, thd=0x7f1574000af0, to=0x7f1585589da0) at /data/src/10.4/sql/item_func.h:783
|
#16 0x0000560fb21b9f32 in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null (this=0x7f1585589da0, thd=0x7f1574000af0, item=0x7f15740138d0, conv=false) at /data/src/10.4/sql/sql_type.cc:8305
|
#17 0x0000560fb21be70b in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null (this=0x7f1585589da0, thd=0x7f1574000af0, item=0x7f15740138d0) at /data/src/10.4/sql/sql_type.h:2521
|
#18 0x0000560fb21b474b in Type_handler::Item_send_timestamp (this=0x560fb375ac00 <type_handler_timestamp2>, item=0x7f15740138d0, protocol=0x7f15740010b8, buf=0x7f1585589eb0) at /data/src/10.4/sql/sql_type.cc:6832
|
#19 0x0000560fb21c20fc in Type_handler_timestamp_common::Item_send (this=0x560fb375ac00 <type_handler_timestamp2>, item=0x7f15740138d0, protocol=0x7f15740010b8, buf=0x7f1585589eb0) at /data/src/10.4/sql/sql_type.h:5656
|
#20 0x0000560fb1e6e4ec in Item::send (this=0x7f15740138d0, protocol=0x7f15740010b8, buffer=0x7f1585589eb0) at /data/src/10.4/sql/item.h:1038
|
#21 0x0000560fb1e68637 in Protocol::send_result_set_row (this=0x7f15740010b8, row_items=0x7f15740154a0) at /data/src/10.4/sql/protocol.cc:1035
|
#22 0x0000560fb1f1d2a2 in select_send::send_data (this=0x7f1574014cc0, items=...) at /data/src/10.4/sql/sql_class.cc:2998
|
#23 0x0000560fb201d7c1 in JOIN::rollup_send_data (this=0x7f1574014ce8, idx=0) at /data/src/10.4/sql/sql_select.cc:25938
|
#24 0x0000560fb2012937 in end_send_group (join=0x7f1574014ce8, join_tab=0x7f1574016718, end_of_records=true) at /data/src/10.4/sql/sql_select.cc:21730
|
#25 0x0000560fb200ee31 in sub_select (join=0x7f1574014ce8, join_tab=0x7f1574016370, end_of_records=true) at /data/src/10.4/sql/sql_select.cc:20329
|
#26 0x0000560fb200e55a in do_select (join=0x7f1574014ce8, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:19920
|
#27 0x0000560fb1fe33bd in JOIN::exec_inner (this=0x7f1574014ce8) at /data/src/10.4/sql/sql_select.cc:4470
|
#28 0x0000560fb1fe24fa in JOIN::exec (this=0x7f1574014ce8) at /data/src/10.4/sql/sql_select.cc:4252
|
#29 0x0000560fb1fe3c0f in mysql_select (thd=0x7f1574000af0, tables=0x7f1574013b90, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f1574014380, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1574014cc0, unit=0x7f1574004a18, select_lex=0x7f1574013278) at /data/src/10.4/sql/sql_select.cc:4684
|
#30 0x0000560fb1fd36f2 in handle_select (thd=0x7f1574000af0, lex=0x7f1574004958, result=0x7f1574014cc0, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:422
|
#31 0x0000560fb1f9a21c in execute_sqlcom_select (thd=0x7f1574000af0, all_tables=0x7f1574013b90) at /data/src/10.4/sql/sql_parse.cc:6360
|
#32 0x0000560fb1f908a9 in mysql_execute_command (thd=0x7f1574000af0) at /data/src/10.4/sql/sql_parse.cc:3898
|
#33 0x0000560fb1f9e1c9 in mysql_parse (thd=0x7f1574000af0, rawbuf=0x7f1574013198 "SELECT NULLIF( s, NULL ) AS f FROM t1 GROUP BY s WITH ROLLUP", length=61, parser_state=0x7f158558b570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7901
|
#34 0x0000560fb1f8a753 in dispatch_command (command=COM_QUERY, thd=0x7f1574000af0, packet=0x7f15740083a1 "", packet_length=61, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
|
#35 0x0000560fb1f88ef5 in do_command (thd=0x7f1574000af0) at /data/src/10.4/sql/sql_parse.cc:1360
|
#36 0x0000560fb2111aa8 in do_handle_one_connection (connect=0x560fb496cce0) at /data/src/10.4/sql/sql_connect.cc:1412
|
#37 0x0000560fb21117f7 in handle_one_connection (arg=0x560fb496cce0) at /data/src/10.4/sql/sql_connect.cc:1316
|
#38 0x0000560fb2b0fda1 in pfs_spawn_thread (arg=0x560fb4988900) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#39 0x00007f158d36a4a4 in start_thread (arg=0x7f158558c700) at pthread_create.c:456
|
#40 0x00007f158b49ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible with at least InnoDB, MyISAM, Aria.
The assertion failure appeared in 10.4 branch after this commit:
commit ea7830eef48333e28f98a9b91f05a95735b465a3
|
Author: Alexander Barkov
|
Date: Fri May 22 16:31:16 2020 +0400
|
|
MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
|
However the wrong result was there before.
Attachments
Issue Links
- relates to
-
MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion
-
- Closed
-
-
MDEV-26732 Assertion `0' failed in Item::val_native
-
- Closed
-
Leads to:
10.5.4 4080e3acefd7e58d88c2f3539fb6a0fb359cf057
mysqld: /test/10.5_dbg/sql/item.h:1362: virtual bool Item::val_native(THD*, Native*): Assertion `0' failed.
10.5.4 4080e3acefd7e58d88c2f3539fb6a0fb359cf057
Core was generated by `/test/MD150620-mariadb-10.5.4-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x15169a50c700 (LWP 3214203))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1 0x00005627771a64c6 in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
#2 0x0000562776948d60 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:330
#3 <signal handler called>
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5 0x00001516a2848801 in __GI_abort () at abort.c:79
#6 0x00001516a283839a in __assert_fail_base (fmt=0x1516a29bf7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5627774e056f "0", file=file@entry=0x5627772fe974 "/test/10.5_dbg/sql/item.h", line=line@entry=1362, function=function@entry=0x5627772feda0 <Item::val_native(THD*, Native*)::__PRETTY_FUNCTION__> "virtual bool Item::val_native(THD*, Native*)") at assert.c:92
#7 0x00001516a2838412 in __GI___assert_fail (assertion=assertion@entry=0x5627774e056f "0", file=file@entry=0x5627772fe974 "/test/10.5_dbg/sql/item.h", line=line@entry=1362, function=function@entry=0x5627772feda0 <Item::val_native(THD*, Native*)::__PRETTY_FUNCTION__> "virtual bool Item::val_native(THD*, Native*)") at assert.c:101
#8 0x00005627765b1405 in Item::val_native (this=0x15167f0783d0, thd=<optimized out>, to=<optimized out>) at /test/10.5_dbg/sql/item.h:1362
#9 0x000056277698b308 in Item::val_native_from_item (this=0x15167f076620, thd=0x15167f015088, item=0x15167f0783d0, to=0x15167f076508) at /test/10.5_dbg/sql/item.h:879
#10 0x000056277696face in Item_ref::val_native (this=<optimized out>, thd=<optimized out>, to=<optimized out>) at /test/10.5_dbg/sql/item.cc:8332
#11 0x0000562776885bd7 in Type_handler_timestamp_common::Item_val_native_with_conversion (this=0x562777f28b00 <type_handler_timestamp2>, thd=0x15167f015088, item=0x15167f076620, to=0x15167f076508) at /test/10.5_dbg/sql/sql_type.cc:8684
#12 0x000056277699418b in Item::val_native_with_conversion (th=<optimized out>, to=0x15167f076508, thd=<optimized out>, this=0x15167f076620) at /test/10.5_dbg/sql/item.h:1320
#13 cmp_item_timestamp::store_value (this=0x15167f0764f0, item=0x15167f076620) at /test/10.5_dbg/sql/item_cmpfunc.cc:4246
#14 0x0000562776995a67 in Predicant_to_list_comparator::cmp_arg (i=0, args=0x15167f074aa0, this=0x15167f074b10) at /test/10.5_dbg/sql/item_cmpfunc.h:1936
#15 Predicant_to_list_comparator::cmp (found_unknown_values=0x0, idx=<synthetic pointer>, args=0x15167f074aa0, this=0x15167f074b10) at /test/10.5_dbg/sql/item_cmpfunc.h:2126
#16 Item_func_case_simple::find_item (this=0x15167f074a10) at /test/10.5_dbg/sql/item_cmpfunc.cc:3026
#17 0x0000562776998985 in Item_func_case::native_op (this=0x15167f074a10, thd=0x15167f015088, to=0x15169a509e60) at /test/10.5_dbg/sql/item_cmpfunc.cc:3136
#18 0x00005627769a61c5 in Item_func_hybrid_field_type::val_native (this=0x15167f074a10, thd=0x15167f015088, to=0x15169a509e60) at /test/10.5_dbg/sql/item_func.h:907
#19 0x0000562776885de1 in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null (this=0x15169a509e60, thd=0x15167f015088, item=0x15167f074a10, conv=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:8728
#20 0x0000562776886622 in Timestamp_or_zero_datetime_native_null::Timestamp_or_zero_datetime_native_null (item=0x15167f074a10, thd=<optimized out>, this=0x15169a509e60) at /test/10.5_dbg/sql/sql_type.h:2666
#21 Type_handler::Item_send_timestamp (this=<optimized out>, item=0x15167f074a10, protocol=0x15167f015650, buf=0x15169a509f40) at /test/10.5_dbg/sql/sql_type.cc:7210
#22 0x00005627767d9da3 in Type_handler_timestamp_common::Item_send (this=<optimized out>, item=<optimized out>, protocol=<optimized out>, buf=<optimized out>) at /test/10.5_dbg/sql/sql_type.h:6351
#23 0x00005627765b07a9 in Item::send (this=0x15167f074a10, protocol=0x15167f015650, buffer=0x15169a509f40) at /test/10.5_dbg/sql/item.h:1056
#24 0x00005627765ae519 in Protocol::send_result_set_row (this=this@entry=0x15167f015650, row_items=row_items@entry=0x15167f076560) at /test/10.5_dbg/sql/protocol.cc:1082
#25 0x000056277664013a in select_send::send_data (this=0x15167f075d78, items=@0x15167f076560: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15167f076610, last = 0x15167f076610, elements = 1}, <No data fields>}) at /test/10.5_dbg/sql/sql_class.cc:3004
#26 0x00005627766f78b9 in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=<optimized out>, this=<optimized out>) at /test/10.5_dbg/sql/sql_class.h:5286
#27 JOIN::rollup_send_data (this=this@entry=0x15167f075da0, idx=idx@entry=0) at /test/10.5_dbg/sql/sql_select.cc:26156
#28 0x00005627766f845e in end_send_group (join=0x15167f075da0, join_tab=<optimized out>, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:21957
#29 0x00005627766e3b83 in sub_select (join=0x15167f075da0, join_tab=0x15167f0775c0, end_of_records=<optimized out>) at /test/10.5_dbg/sql/sql_select.cc:20545
#30 0x000056277671cf20 in do_select (procedure=<optimized out>, join=0x15167f075da0) at /test/10.5_dbg/sql/sql_select.cc:20136
#31 JOIN::exec_inner (this=this@entry=0x15167f075da0) at /test/10.5_dbg/sql/sql_select.cc:4444
#32 0x000056277671d289 in JOIN::exec (this=this@entry=0x15167f075da0) at /test/10.5_dbg/sql/sql_select.cc:4225
#33 0x000056277671b59e in mysql_select (thd=thd@entry=0x15167f015088, tables=<optimized out>, fields=@0x15167f0742d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15167f074ba0, last = 0x15167f074ba0, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=<optimized out>, group=0x15167f075438, having=0x0, proc_param=0x0, select_options=2147748608, result=0x15167f075d78, unit=0x15167f0190a0, select_lex=0x15167f074180) at /test/10.5_dbg/sql/sql_select.cc:4649
#34 0x000056277671b8cd in handle_select (thd=thd@entry=0x15167f015088, lex=lex@entry=0x15167f018fd8, result=result@entry=0x15167f075d78, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:417
#35 0x00005627766a51ed in execute_sqlcom_select (thd=thd@entry=0x15167f015088, all_tables=0x15167f074c08) at /test/10.5_dbg/sql/sql_parse.cc:6209
#36 0x000056277669e312 in mysql_execute_command (thd=thd@entry=0x15167f015088) at /test/10.5_dbg/sql/sql_parse.cc:3939
#37 0x00005627766ab15c in mysql_parse (thd=thd@entry=0x15167f015088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15169a50b350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:7993
#38 0x0000562776697c60 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x15167f015088, packet=packet@entry=0x15167f067089 "", packet_length=packet_length@entry=61, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:1874
#39 0x000056277669643a in do_command (thd=0x15167f015088) at /test/10.5_dbg/sql/sql_parse.cc:1355
#40 0x00005627767f1c47 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x151683d7a808, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1411
#41 0x00005627767f2363 in handle_one_connection (arg=arg@entry=0x151683d7a808) at /test/10.5_dbg/sql/sql_connect.cc:1313
#42 0x0000562776c53902 in pfs_spawn_thread (arg=0x1516a1446c88) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#43 0x00001516a352b6db in start_thread (arg=0x15169a50c700) at pthread_create.c:463
#44 0x00001516a292988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.4.14 (dbg), 10.5.4 (dbg)
Bug confirmed not present in:
MariaDB: 10.1.46 (dbg), 10.1.46 (opt), 10.2.33 (dbg), 10.2.33 (opt), 10.3.24 (dbg), 10.3.24 (opt), 10.4.14 (opt), 10.5.4 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)