Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.3.0
-
None
-
Ubuntu 20.04
Description
Run these queries in debug build:
CREATE TABLE x ( x INT ) ;
INSERT INTO x ( x ) VALUES ( 1 ) ;
UPDATE x SET x = 1 WHERE x = 1 ;
INSERT INTO x WITH x AS ( WITH x AS ( SELECT * FROM x WHERE ( x , x ) NOT IN ( SELECT x , x FROM x ) ) SELECT * FROM x ) SELECT * FROM x WHERE x IN ( SELECT x ) ORDER BY x ;
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 0x0000555557b9c112 in Item_field::fix_outer_field (this=0x629000168e30, thd=0x62c0001d0288, from_field=0x7fffd193c640, reference=0x629000168c78) at /home/wx/mariadb-11.3.0/sql/item.cc:5657
#5 0x0000555557ba011b in Item_field::fix_fields (this=0x629000168e30, thd=0x62c0001d0288, reference=0x629000168c78) at /home/wx/mariadb-11.3.0/sql/item.cc:6124
#6 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x629000168e30, thd=0x62c0001d0288, ref=0x629000168c78) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#7 0x0000555557c6c9f2 in Item_func::fix_fields (this=0x629000168bf8, thd=0x62c0001d0288, ref=0x6290001691c0) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#8 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x629000168bf8, thd=0x62c0001d0288, ref=0x6290001691c0) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#9 0x0000555556f04089 in Item::fix_fields_if_needed_for_scalar (this=0x629000168bf8, thd=0x62c0001d0288, ref=0x6290001691c0) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#10 0x000055555703235b in Item::fix_fields_if_needed_for_bool (this=0x629000168bf8, thd=0x62c0001d0288, ref=0x6290001691c0) at /home/wx/mariadb-11.3.0/sql/item.h:1160
#11 0x0000555557c13a3b in Item_cond::fix_fields (this=0x629000169098, thd=0x62c0001d0288, ref=0x629000163f80) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:4941
#12 0x00005555572bf5f9 in JOIN::optimize_inner (this=0x629000163ae8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2309
#13 0x00005555572bbba6 in JOIN::optimize (this=0x629000163ae8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
#14 0x00005555570d7fb4 in mysql_derived_optimize (thd=0x62c0001d0288, lex=0x62c0001d45f8, derived=0x62900015e9e8) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1037
#15 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001d45f8, derived=0x62900015e9e8, phases=4) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#16 0x00005555572c10e1 in JOIN::optimize_inner (this=0x6290001659d8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2442
#17 0x00005555572bbba6 in JOIN::optimize (this=0x6290001659d8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
#18 0x00005555572dd9ba in mysql_select (thd=0x62c0001d0288, tables=0x6290001600e0, fields=..., conds=0x6290001617b8, og_num=1, order=0x629000161bb0, group=0x0, having=0x0, proc_param=0x0, select_options=37385560394240, result=0x629000165910, unit=0x62c0001d46d8, select_lex=0x62900015fa88) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5235
#19 0x00005555572ad18a in handle_select (thd=0x62c0001d0288, lex=0x62c0001d45f8, result=0x629000165910, setup_tables_done_option=35184372088832) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:628
#20 0x00005555571c3659 in mysql_execute_command (thd=0x62c0001d0288, is_called_from_prepared_stmt=false) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:4566
#21 0x00005555571d95e2 in mysql_parse (thd=0x62c0001d0288, rawbuf=0x6290000f52a8 "INSERT INTO x WITH x AS ( WITH x AS ( SELECT * FROM x WHERE ( x , x ) NOT IN ( SELECT x , x FROM x ) ) SELECT * FROM x ) SELECT * FROM x WHERE x IN ( SELECT x ) ORDER BY x", length=171, parser_state=0x7fffd193e870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#22 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001d0288, packet=0x6290000fa289 " INSERT INTO x WITH x AS ( WITH x AS ( SELECT * FROM x WHERE ( x , x ) NOT IN ( SELECT x , x FROM x ) ) SELECT * FROM x ) SELECT * FROM x WHERE x IN ( SELECT x ) ORDER BY x ;\n", packet_length=175, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#23 0x00005555571adf7c in do_command (thd=0x62c0001d0288, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#24 0x000055555768e557 in do_handle_one_connection (connect=0x611000066008, put_in_cache=true) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#25 0x000055555768deb4 in handle_one_connection (arg=0x611000065ec8) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#26 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005108) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#27 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#28 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
- duplicates
-
MDEV-32705 Assertion `outer_context || !*from_field || *from_field == not_found_field' failed in Item_field::fix_outer_field
- Confirmed