Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL)
Description
The test case is not very smart and the debug assertion wouldn't be really important, but the concern is a result which is very different on 10.4+ from 10.3 (and from MySQL 5.6-8.0). It is hard to say which is correct, but it needs to be checked whether the change was intentional.
CREATE TABLE t1 (a TIME, b INT); |
INSERT INTO t1 VALUES ('07:26:24',NULL),('23:55:04',NULL); |
SELECT MAX(ROUND(a, 0)) FROM t1 GROUP BY 1 << b; |
|
# Cleanup
|
DROP TABLE t1; |
10.4 non-debug 29847a37 |
SELECT MAX(ROUND(a, 0)) FROM t1 GROUP BY 1 << b; |
MAX(ROUND(a, 0)) |
07:26:24
|
DROP TABLE t1; |
Compare with the result on 10.3 (same on MySQL 5.6-8.0):
10.3 ade782c0 |
SELECT MAX(ROUND(a, 0)) FROM t1 GROUP BY 1 << b; |
MAX(ROUND(a, 0)) |
235504
|
DROP TABLE t1; |
Debug build of 10.4+ produces an assertion failure (10.3 doesn't).
10.4 29847a37 |
mysqld: /data/src/10.4/sql/item_func.h:1786: virtual bool Item_func_round::native_op(THD*, Native*): Assertion `0' failed.
|
200929 2:49:11 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f591cd40f36 in __GI___assert_fail (assertion=0x561aba060467 "0", file=0x561aba0607d0 "/data/src/10.4/sql/item_func.h", line=1786, function=0x561aba060ed0 "virtual bool Item_func_round::native_op(THD*, Native*)") at assert.c:101
|
#8 0x0000561ab95038d0 in Item_func_round::native_op (this=0x7f58fc013b58, thd=0x7f58fc000d90, to=0x7f58fc0159f8) at /data/src/10.4/sql/item_func.h:1786
|
#9 0x0000561ab90d5e27 in Item_func_hybrid_field_type::val_native (this=0x7f58fc013b58, thd=0x7f58fc000d90, to=0x7f58fc0159f8) at /data/src/10.4/sql/item_func.h:820
|
#10 0x0000561ab95627f4 in Arg_comparator::min_max_update_field_native (this=0x7f58fc015930, thd=0x7f58fc000d90, field=0x7f58fc0589a0, item=0x7f58fc013b58, cmp_sign=-1) at /data/src/10.4/sql/item_sum.cc:3113
|
#11 0x0000561ab9562ab6 in Item_sum_min_max::min_max_update_native_field (this=0x7f58fc013c28) at /data/src/10.4/sql/item_sum.cc:3136
|
#12 0x0000561ab95626a3 in Item_sum_min_max::update_field (this=0x7f58fc013c28) at /data/src/10.4/sql/item_sum.cc:3079
|
#13 0x0000561ab917e926 in update_tmptable_sum_func (func_ptr=0x7f58fc015ab8, tmp_table=0x7f58fc057038) at /data/src/10.4/sql/sql_select.cc:25435
|
#14 0x0000561ab9175706 in end_update (join=0x7f58fc0150b0, join_tab=0x7f58fc016a78, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:21919
|
#15 0x0000561ab91884dc in AGGR_OP::put_record (this=0x7f58fc017460, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:28674
|
#16 0x0000561ab918e9ef in AGGR_OP::put_record (this=0x7f58fc017460) at /data/src/10.4/sql/sql_select.h:1048
|
#17 0x0000561ab9171068 in sub_select_postjoin_aggr (join=0x7f58fc0150b0, join_tab=0x7f58fc016a78, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20128
|
#18 0x0000561ab9171cfa in evaluate_join_record (join=0x7f58fc0150b0, join_tab=0x7f58fc0166d0, error=0) at /data/src/10.4/sql/sql_select.cc:20628
|
#19 0x0000561ab917178c in sub_select (join=0x7f58fc0150b0, join_tab=0x7f58fc0166d0, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20447
|
#20 0x0000561ab9170a9c in do_select (join=0x7f58fc0150b0, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:19946
|
#21 0x0000561ab91457ab in JOIN::exec_inner (this=0x7f58fc0150b0) at /data/src/10.4/sql/sql_select.cc:4478
|
#22 0x0000561ab91448da in JOIN::exec (this=0x7f58fc0150b0) at /data/src/10.4/sql/sql_select.cc:4260
|
#23 0x0000561ab914602e in mysql_select (thd=0x7f58fc000d90, tables=0x7f58fc013e00, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f58fc014748, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f58fc015088, unit=0x7f58fc004cb8, select_lex=0x7f58fc0134f8) at /data/src/10.4/sql/sql_select.cc:4695
|
#24 0x0000561ab9135a3f in handle_select (thd=0x7f58fc000d90, lex=0x7f58fc004bf8, result=0x7f58fc015088, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:410
|
#25 0x0000561ab90fb4c4 in execute_sqlcom_select (thd=0x7f58fc000d90, all_tables=0x7f58fc013e00) at /data/src/10.4/sql/sql_parse.cc:6355
|
#26 0x0000561ab90f1b16 in mysql_execute_command (thd=0x7f58fc000d90) at /data/src/10.4/sql/sql_parse.cc:3889
|
#27 0x0000561ab90ff4cf in mysql_parse (thd=0x7f58fc000d90, rawbuf=0x7f58fc013438 "SELECT MAX(ROUND(a, 0)) FROM t1 GROUP BY 1 << b", length=47, parser_state=0x7f5912cff550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7896
|
#28 0x0000561ab90eb9de in dispatch_command (command=COM_QUERY, thd=0x7f58fc000d90, packet=0x7f58fc008791 "", packet_length=47, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1834
|
#29 0x0000561ab90ea246 in do_command (thd=0x7f58fc000d90) at /data/src/10.4/sql/sql_parse.cc:1352
|
#30 0x0000561ab9277e95 in do_handle_one_connection (connect=0x561abbe0b030) at /data/src/10.4/sql/sql_connect.cc:1412
|
#31 0x0000561ab9277bde in handle_one_connection (arg=0x561abbe0b030) at /data/src/10.4/sql/sql_connect.cc:1316
|
#32 0x0000561ab9c9230c in pfs_spawn_thread (arg=0x561abbd111b0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#33 0x00007f591d258609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#34 0x00007f591ce2c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Attachments
Issue Links
- is caused by
-
MDEV-23525 Wrong result of MIN(time_expr) and MAX(time_expr) with GROUP BY
-
- Closed
-
- relates to
-
MDEV-30721 Assertion `fixed()' or fixed == 1 failed in Item_cond_and::val_int on SELECT
-
- Confirmed
-
-
MDEV-31750 Assertion `0' failed in Item::val_native upon query with GROUP BY from Spider table
-
- Confirmed
-
similar test, slight variation
10.4 e9d86d80bef50e29a1f7cf7e7
Version: '10.4.18-MariaDB-debug-log'
mysqld: /10.4/sql/item_func.h:1730: virtual bool Item_func_int_val::native_op(THD*, Native*): Assertion `0' failed.
201214 14:48:47 [ERROR] mysqld got signal 6 ;
Server version: 10.4.18-MariaDB-debug-log
linux/raise.c:51(__GI_raise)[0x7f9aacf0f7bb]
stdlib/abort.c:81(__GI_abort)[0x7f9aacefa535]
intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f9aacefa40f]
/lib/x86_64-linux-gnu/libc.so.6(+0x30102)[0x7f9aacf08102]
sql/item_func.h:1731(Item_func_int_val::native_op(THD*, Native*))[0x55ad44c2ed33]
sql/item_func.h:821(Item_func_hybrid_field_type::val_native(THD*, Native*))[0x55ad4428ee79]
sql/item_sum.cc:3116(Arg_comparator::min_max_update_field_native(THD*, Field*, Item*, int))[0x55ad44d0d677]
sql/item_sum.cc:3140(Item_sum_min_max::min_max_update_native_field())[0x55ad44d0dd49]
sql/item_sum.cc:3082(Item_sum_min_max::update_field())[0x55ad44d0d2f4]
sql/sql_select.cc:25429(update_tmptable_sum_func(Item_sum**, TABLE*))[0x55ad4442cf76]
sql/sql_select.cc:21917(end_update(JOIN*, st_join_table*, bool))[0x55ad44413705]
sql/sql_select.cc:28669(AGGR_OP::put_record(bool))[0x55ad44445cc4]
sql/sql_select.h:1048(AGGR_OP::put_record())[0x55ad444546bb]
sql/sql_select.cc:20125(sub_select_postjoin_aggr(JOIN*, st_join_table*, bool))[0x55ad44405e00]
sql/sql_select.cc:20625(evaluate_join_record(JOIN*, st_join_table*, int))[0x55ad44408444]
sql/sql_select.cc:20444(sub_select(JOIN*, st_join_table*, bool))[0x55ad444074a8]
sql/sql_select.cc:19943(do_select(JOIN*, Procedure*))[0x55ad444050a0]
sql/sql_select.cc:4482(JOIN::exec_inner())[0x55ad443962af]
sql/sql_select.cc:4265(JOIN::exec())[0x55ad4439391e]
sql/sql_select.cc:4701(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55ad443978c8]
sql/sql_select.cc:410(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55ad443695fe]
sql/sql_parse.cc:6398(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55ad442dc997]
sql/sql_parse.cc:3925(mysql_execute_command(THD*))[0x55ad442ca27e]
sql/sql_parse.cc:7936(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55ad442e5a61]
sql/sql_parse.cc:1842(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55ad442bcd51]
sql/sql_parse.cc:1357(do_command(THD*))[0x55ad442b97d0]
sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x55ad4469897f]
sql/sql_connect.cc:1317(handle_one_connection)[0x55ad44698221]
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55ad45cd3cd5]
nptl/pthread_create.c:487(start_thread)[0x7f9aad9cafa3]
x86_64/clone.S:97(clone)[0x7f9aacfd14cf]
Query (0x62b000062290): select min(ceiling(a)) from t1 group by b