Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.3.0, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
-
None
-
Ubuntu 20.04
Description
Run these queries in debug build:
CREATE TABLE t0 ( c56 INT , c12 CHAR ) ;
INSERT INTO t0 VALUES ( DEFAULT , DEFAULT ) , ( DEFAULT , DEFAULT ) ;
CREATE VIEW v0 AS SELECT c56 AS c33 , c56 AS c16 , -81 AS c45 FROM t0 ;
SELECT VARIANCE( c45 ) AS c36 FROM v0 GROUP BY c45 , c16 HAVING c16 = 61 IN ( 33 , -36 , LENGTH ( REVERSE ( c45 ) = 48 IN ( SELECT CONVERT ( c16 , UNSIGNED ) AS c60 FROM v0 ) ) = 47 ) ;
Will trigger Assertion Failed.
GDB info:
#0 0x00007ffff6c0c00b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6beb859 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff6beb729 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff6bfcfd6 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x0000555557bd2143 in Item_direct_view_ref::check_null_ref (this=0x629000188890) at /home/wx/mariadb-11.3.0/sql/item.h:6054
#5 0x0000555557bd2b5e in Item_direct_view_ref::val_str (this=0x629000188890, tmp=0x6290000f6bf8) at /home/wx/mariadb-11.3.0/sql/item.h:6145
#6 0x0000555557d0a838 in Item_func_reverse::val_str (this=0x6290000f6b48, str=0x7fffd1629ea0) at /home/wx/mariadb-11.3.0/sql/item_strfunc.cc:1286
#7 0x0000555557cffcb7 in Item_str_func::val_decimal (this=0x6290000f6b48, decimal_value=0x629000190458) at /home/wx/mariadb-11.3.0/sql/item_strfunc.cc:147
#8 0x0000555556e14c67 in Item::val_decimal_result (this=0x6290000f6b48, val=0x629000190458) at /home/wx/mariadb-11.3.0/sql/item.h:1796
#9 0x0000555557bc6422 in Item_cache_decimal::cache_value (this=0x6290001903b8) at /home/wx/mariadb-11.3.0/sql/item.cc:10455
#10 0x00005555578eb11e in Item_cache::has_value (this=0x6290001903b8) at /home/wx/mariadb-11.3.0/sql/item.h:7171
#11 0x0000555557bc66ea in Item_cache_decimal::val_decimal (this=0x6290001903b8, val=0x7fffd162a078) at /home/wx/mariadb-11.3.0/sql/item.cc:10480
#12 0x000055555789a036 in VDec::VDec (this=0x7fffd162a070, item=0x6290001903b8) at /home/wx/mariadb-11.3.0/sql/sql_type.cc:293
#13 0x0000555557beaf4b in Arg_comparator::compare_decimal (this=0x6290000f86e8) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:865
#14 0x0000555557c2e1d4 in Arg_comparator::compare (this=0x6290000f86e8) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:104
#15 0x0000555557bf5bdb in Item_func_eq::val_int (this=0x6290000f8630) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1780
#16 0x0000555557c706e4 in Item_int_func::val_str (this=0x6290000f8630, str=0x6290000f8a40) at /home/wx/mariadb-11.3.0/sql/item_func.cc:760
#17 0x0000555557c8d29b in Item_func_octet_length::val_int (this=0x6290000f8990) at /home/wx/mariadb-11.3.0/sql/item_func.cc:3108
#18 0x0000555557bec903 in Arg_comparator::compare_int_signed (this=0x6290000f8bb8) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:944
#19 0x0000555557c2e1d4 in Arg_comparator::compare (this=0x6290000f8bb8) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:104
#20 0x0000555557bf5bdb in Item_func_eq::val_int (this=0x6290000f8b00) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1780
#21 0x0000555557c32038 in cmp_item_int::cmp (this=0x62900018a1d8, arg=0x6290000f8b00) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:1783
#22 0x0000555557c3338a in Predicant_to_list_comparator::cmp_arg (this=0x6290000f8e58, args=0x6290000f8df8, i=2) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:2083
#23 0x0000555557c343a3 in Predicant_to_list_comparator::cmp (this=0x6290000f8e58, args=0x6290000f8df8, idx=0x7fffd162a3f0, found_unknown_values=0x6290000f8dec) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:2260
#24 0x0000555557c127bd in Item_func_in::val_int (this=0x6290000f8d80) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:4761
#25 0x00005555578cc1de in Type_handler_int_result::Item_eq_value (this=0x55555b7b6a00 <type_handler_slonglong>, thd=0x62c0001e0288, attr=0x62d0000d28b8, a=0x6290000f8d80, b=0x6290000f8d80) at /home/wx/mariadb-11.3.0/sql/sql_type.cc:8689
#26 0x0000555557c235d4 in Item_equal::add_const (this=0x62d0000d2808, thd=0x62c0001e0288, c=0x6290000f8d80) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:6849
#27 0x0000555557c23c81 in Item_equal::merge_with_check (this=0x62d0000d2808, thd=0x62c0001e0288, item=0x62d0000d2808, save_merged=true) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:6974
#28 0x00005555573410d3 in propagate_new_equalities (thd=0x62c0001e0288, cond=0x62d0000d2808, new_equalities=0x62d0000d2930, inherited=0x0, is_simplifiable_cond=0x7fffd162a900) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:19844
#29 0x00005555577ba9a8 in and_new_conditions_to_optimized_cond (thd=0x62c0001e0288, cond=0x62d0000d2808, cond_eq=0x629000187070, new_conds=..., cond_value=0x629000186f48) at /home/wx/mariadb-11.3.0/sql/opt_subselect.cc:6331
#30 0x00005555572c0873 in JOIN::optimize_inner (this=0x629000186ba8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2384
#31 0x00005555572bbba6 in JOIN::optimize (this=0x629000186ba8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
#32 0x00005555572dd9ba in mysql_select (thd=0x62c0001e0288, tables=0x6290000f5c58, fields=..., conds=0x0, og_num=2, order=0x0, group=0x6290000f64d8, having=0x6290000f8f30, proc_param=0x0, select_options=2165049856, result=0x629000186b78, unit=0x62c0001e46d8, select_lex=0x6290000f5480) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5235
#33 0x00005555572ad18a in handle_select (thd=0x62c0001e0288, lex=0x62c0001e45f8, result=0x629000186b78, setup_tables_done_option=0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:628
#34 0x00005555571ce583 in execute_sqlcom_select (thd=0x62c0001e0288, all_tables=0x6290000f5c58) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:6013
#35 0x00005555571becf6 in mysql_execute_command (thd=0x62c0001e0288, is_called_from_prepared_stmt=false) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:3912
#36 0x00005555571d95e2 in mysql_parse (thd=0x62c0001e0288, rawbuf=0x6290000f52a8 "SELECT VARIANCE( c45 ) AS c36 FROM v0 GROUP BY c45 , c16 HAVING c16 = 61 IN ( 33 , -36 , LENGTH ( REVERSE ( c45 ) = 48 IN ( SELECT CONVERT ( c16 , UNSIGNED ) AS c60 FROM v0 ) ) = 47 )", length=183, parser_state=0x7fffd162c870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#37 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0288, packet=0x6290000fa289 "SELECT VARIANCE( c45 ) AS c36 FROM v0 GROUP BY c45 , c16 HAVING c16 = 61 IN ( 33 , -36 , LENGTH ( REVERSE ( c45 ) = 48 IN ( SELECT CONVERT ( c16 , UNSIGNED ) AS c60 FROM v0 ) ) = 47 ) ;\n", packet_length=186, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#38 0x00005555571adf7c in do_command (thd=0x62c0001e0288, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#39 0x000055555768e557 in do_handle_one_connection (connect=0x61100008c708, put_in_cache=true) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#40 0x000055555768deb4 in handle_one_connection (arg=0x61100008c5c8) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#41 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005108) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#42 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#43 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
- is duplicated by
-
MDEV-33688 Simplified SQL Query for Problem Diagnosis
- Closed