drop table if exists `t1`; create table `t1`(`a` int)engine=myisam; create or replace view `v1` as select 1 from `t1` group by substring(1 from (select 3 from `t1` where `a`>=any(select 1))); Version: '5.6.1-m4-valgrind-max-debug' socket: '/tmp/mysql.sock' port: 3307 Source distribution [New Thread 0x7ffff429f710 (LWP 26340)] mysqld: /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:846: virtual longlong Item_in_subselect::val_int(): Assertion `0' failed. Program received signal SIGABRT, Aborted. [Switching to Thread 0x7ffff429f710 (LWP 26340)] 0x00000030e14329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) bt #0 0x00000030e14329a5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x00000030e1434185 in abort () at abort.c:92 #2 0x00000030e142b935 in __assert_fail (assertion=0xba0faf "0", file=, line=846, function=) at assert.c:81 #3 0x0000000000783de5 in Item_in_subselect::val_int (this=0x7fffd4005a20) at /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:846 #4 0x00000000007313f4 in Item_func_nop_all::val_int (this=0x7fffd400c2d0) at /home/sbester/build/bzr/mysql-trunk/sql/item_cmpfunc.cc:359 #5 0x000000000075569d in eval_const_cond (cond=0x7fffd400c2d0) at /home/sbester/build/bzr/mysql-trunk/sql/item_func.cc:78 #6 0x00000000005fe6cc in internal_remove_eq_conds (thd=0x1e34a00, cond=0x7fffd400c2d0, cond_value=0x7fffd4006888) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:9440 #7 0x00000000005fea0e in remove_eq_conds (thd=0x1e34a00, cond=0x7fffd400c2d0, cond_value=0x7fffd4006888) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:9533 #8 0x00000000005fe1a3 in optimize_cond (join=0x7fffd4011ad0, conds=0x7fffd400c2d0, join_list=0x7fffd4006948, cond_value=0x7fffd4006888) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:9315 #9 0x00000000005e8383 in JOIN::optimize (this=0x7fffd4011ad0) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:909 #10 0x00000000007875d6 in subselect_single_select_engine::exec (this=0x7fffd400c4e0) at /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:1905 #11 0x0000000000782605 in Item_subselect::exec (this=0x7fffd400c3b0) at /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:288 #12 0x00000000007833a8 in Item_singlerow_subselect::val_int (this=0x7fffd400c3b0) at /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:601 #13 0x00000000007773b0 in Item_func_substr::fix_length_and_dec (this=0x7fffd400c540) at /home/sbester/build/bzr/mysql-trunk/sql/item_strfunc.cc:1417 #14 0x0000000000755ce0 in Item_func::fix_fields (this=0x7fffd400c540, thd=0x1e34a00, ref=0x7fffd400c640) at /home/sbester/build/bzr/mysql-trunk/sql/item_func.cc:219 #15 0x0000000000772b25 in Item_str_func::fix_fields (this=0x7fffd400c540, thd=0x1e34a00, ref=0x7fffd400c640) at /home/sbester/build/bzr/mysql-trunk/sql/item_strfunc.cc:117 #16 0x000000000060c289 in find_order_in_list (thd=0x1e34a00, ref_pointer_array=0x7fffd4011a10, tables=0x7fffd40071a0, order=0x7fffd400c630, fields=..., all_fields=..., is_group_field=true) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:14720 #17 0x000000000060c4a4 in setup_group (thd=0x1e34a00, ref_pointer_array=0x7fffd4011a10, tables=0x7fffd40071a0, fields=..., all_fields=..., order=0x7fffd400c630, hidden_group_fields=0x7fffd40117f7) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:14796 #18 0x000000000061761b in setup_without_group (thd=0x1e34a00, ref_pointer_array=0x7fffd4011a10, tables=0x7fffd40071a0, leaves=0x7fffd40071a0, fields=..., all_fields=..., conds=0x7fffd4011938, order=0x0, group=0x7fffd400c630, hidden_group_fields=0x7fffd40117f7) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:466 #19 0x00000000005e6fb0 in JOIN::prepare (this=0x7fffd4010230, rref_pointer_array=0x1e36db0, tables_init=0x7fffd40071a0, wild_num=0, conds_init=0x0, og_num=1, order_init=0x0, group_init=0x7fffd400c630, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x1e36bb8, unit_arg=0x1e365a8) at /home/sbester/build/bzr/mysql-trunk/sql/sql_select.cc:536 #20 0x00000000006502ca in st_select_lex_unit::prepare (this=0x1e365a8, thd_arg=0x1e34a00, sel_result=0x0, additional_options=0) at /home/sbester/build/bzr/mysql-trunk/sql/sql_union.cc:266 #21 0x00000000006595d7 in mysql_create_view (thd=0x1e34a00, views=0x7fffd4004ca0, mode=VIEW_CREATE_OR_REPLACE) at /home/sbester/build/bzr/mysql-trunk/sql/sql_view.cc:553 #22 0x00000000005c91a1 in mysql_execute_command (thd=0x1e34a00) at /home/sbester/build/bzr/mysql-trunk/sql/sql_parse.cc:4244 #23 0x00000000005cc1df in mysql_parse (thd=0x1e34a00, rawbuf=0x7fffd4005c50 "create or replace view `v1` as \nselect 1 from `t1` group by\nsubstring(1 from (select 3 from `t1` where"..., length=123, parser_state=0x7ffff429e710) at /home/sbester/build/bzr/mysql-trunk/sql/sql_parse.cc:5586 #24 0x00000000005c0a7f in dispatch_command (command=COM_QUERY, thd=0x1e34a00, packet=0x1e712b1 "create or replace view `v1` as \nselect 1 from `t1` group by\nsubstring(1 from (select 3 from `t1` where"..., packet_length=123) at /home/sbester/build/bzr/mysql-trunk/sql/sql_parse.cc:1130 #25 0x00000000005bfd24 in do_command (thd=0x1e34a00) at /home/sbester/build/bzr/mysql-trunk/sql/sql_parse.cc:802 #26 0x000000000068e950 in do_handle_one_connection (thd_arg=0x1e34a00) at /home/sbester/build/bzr/mysql-trunk/sql/sql_connect.cc:1192 #27 0x000000000068e7ad in handle_one_connection (arg=0x1e34a00) at /home/sbester/build/bzr/mysql-trunk/sql/sql_connect.cc:1131 #28 0x00000030e1807761 in start_thread (arg=0x7ffff429f710) at pthread_create.c:301 #29 0x00000030e14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 (gdb) (gdb) frame 3 #3 0x0000000000783de5 in Item_in_subselect::val_int (this=0x7fffd4005a20) at /home/sbester/build/bzr/mysql-trunk/sql/item_subselect.cc:846 846 DBUG_ASSERT(0); (gdb) list 841 { 842 /* 843 As far as Item_in_subselect called only from Item_in_optimizer this 844 method should not be used 845 */ 846 DBUG_ASSERT(0); 847 DBUG_ASSERT(fixed == 1); 848 null_value= was_null= FALSE; 849 if (exec()) 850 { (gdb) frame 4 #4 0x00000000007313f4 in Item_func_nop_all::val_int (this=0x7fffd400c2d0) at /home/sbester/build/bzr/mysql-trunk/sql/item_cmpfunc.cc:359 359 longlong value= args[0]->val_int(); (gdb) list 354 */ 355 356 longlong Item_func_nop_all::val_int() 357 { 358 DBUG_ASSERT(fixed == 1); 359 longlong value= args[0]->val_int(); 360 361 /* 362 return FALSE if there was records in underlying select in max/min 363 optimization (SAME/ANY subquery) (gdb) print *args[0] $1 = (Item_allany_subselect) { = { = { = { = { = { _vptr.Item = 0xba2310, rsize = 0, str_value = { Ptr = 0x0, str_length = 0, Alloced_length = 0, alloced = false, str_charset = 0xf69840 }, name = 0x0, orig_name = 0x0, next = 0x7fffd4007010, max_length = 1, name_length = 0, marker = 0 '\000', decimals = 0 '\000', maybe_null = 0 '\000', null_value = 0 '\000', unsigned_flag = 0 '\000', with_sum_func = 0 '\000', fixed = 1 '\001', is_autogenerated_name = 1 '\001', collation = warning: can't find linker symbol for virtual table for `DTCollation' value { collation = 0xf69840, derivation = DERIVATION_COERCIBLE, repertoire = 3 }, with_subselect = 1 '\001', cmp_context = 4294967295 }, members of Item_result_field: result_field = 0x0 }, members of Item_subselect: value_assigned = 0 '\000', thd = 0x1e34a00, substitution = 0x0, unit = 0x7fffd400bca0, engine = 0x7fffd4005b80, old_engine = 0x0, used_tables_cache = 0, max_columns = 1, parsing_place = IN_WHERE, have_to_be_excluded = false, const_item_cache = true, engine_changed = false, changed = true, is_correlated = false }, members of Item_exists_subselect: value = false }, members of Item_in_subselect: left_expr = 0x7fffd4005920, expr = 0x0, optimizer = 0x0, was_null = false, abort_on_null = false, transformed = false, pushed_cond_guards = 0x0, upper_item = 0x7fffd400c2d0 }, members of Item_allany_subselect: func_creator = 0x5ce08a , func = 0x11ffb60, all = false } (gdb)