Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13193

Assertion `producing_item != __null' failure or server crash in Item_direct_view_ref::derived_field_transformer_for_where

    Details

      Description

      CREATE TABLE t1 (i1 INT, KEY(i1));
      INSERT INTO t1 VALUES (1),(2);
       
      CREATE TABLE t2 (i2 INT);
      INSERT INTO t2 VALUES (3),(4);
       
      CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
       
      SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 );
      

      10.2 29624ea304b5893d3bc81670807285a89fce1a33

      mysqld: /data/src/10.2/sql/item.cc:7235: virtual Item* Item_direct_view_ref::derived_field_transformer_for_where(THD*, uchar*): Assertion `producing_item != __null' failed.
      170627 16:25:40 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f567db9eee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055dea63c6dd3 in Item_direct_view_ref::derived_field_transformer_for_where (this=0x7f565c0404a8, thd=0x7f565c000b00, arg=0x7f565c0159f8 "\220\237\071\247\336U") at /data/src/10.2/sql/item.cc:7235
      #9  0x000055dea63c80f5 in Item_ref::transform (this=0x7f565c0404a8, thd=0x7f565c000b00, transformer=&virtual Item::derived_field_transformer_for_where(THD*, unsigned char*), arg=0x7f565c0159f8 "\220\237\071\247\336U") at /data/src/10.2/sql/item.cc:7744
      #10 0x000055dea64161f8 in Item_args::transform_args (this=0x7f565c040738, thd=0x7f565c000b00, transformer=&virtual table offset 1216, arg=0x7f565c0159f8 "\220\237\071\247\336U") at /data/src/10.2/sql/item_func.cc:328
      #11 0x000055dea64162df in Item_func::transform (this=0x7f565c0406b0, thd=0x7f565c000b00, transformer=&virtual table offset 1216, argument=0x7f565c0159f8 "\220\237\071\247\336U") at /data/src/10.2/sql/item_func.cc:364
      #12 0x000055dea6104cf6 in pushdown_cond_for_derived (thd=0x7f565c000b00, cond=0x7f565c03fae0, derived=0x7f565c013840) at /data/src/10.2/sql/sql_derived.cc:1231
      #13 0x000055dea6173f46 in JOIN::optimize_inner (this=0x7f565c0175a8) at /data/src/10.2/sql/sql_select.cc:1334
      #14 0x000055dea61731d1 in JOIN::optimize (this=0x7f565c0175a8) at /data/src/10.2/sql/sql_select.cc:1085
      #15 0x000055dea617c0ee in mysql_select (thd=0x7f565c000b00, tables=0x7f565c0125c8, wild_num=1, fields=..., conds=0x7f565c014f38, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f565c017588, unit=0x7f565c0045e0, select_lex=0x7f565c004d18) at /data/src/10.2/sql/sql_select.cc:3654
      #16 0x000055dea6170b02 in handle_select (thd=0x7f565c000b00, lex=0x7f565c004518, result=0x7f565c017588, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:373
      #17 0x000055dea613ca60 in execute_sqlcom_select (thd=0x7f565c000b00, all_tables=0x7f565c0125c8) at /data/src/10.2/sql/sql_parse.cc:6442
      #18 0x000055dea6132a9f in mysql_execute_command (thd=0x7f565c000b00) at /data/src/10.2/sql/sql_parse.cc:3457
      #19 0x000055dea6140432 in mysql_parse (thd=0x7f565c000b00, rawbuf=0x7f565c012368 "SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 )", length=83, parser_state=0x7f567867b200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7879
      #20 0x000055dea612e4df in dispatch_command (command=COM_QUERY, thd=0x7f565c000b00, packet=0x7f565c0087c1 "SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 )", packet_length=83, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #21 0x000055dea612ce20 in do_command (thd=0x7f565c000b00) at /data/src/10.2/sql/sql_parse.cc:1362
      #22 0x000055dea62784d9 in do_handle_one_connection (connect=0x55dea9431340) at /data/src/10.2/sql/sql_connect.cc:1354
      #23 0x000055dea6278266 in handle_one_connection (arg=0x55dea9431340) at /data/src/10.2/sql/sql_connect.cc:1260
      #24 0x000055dea6692e6a in pfs_spawn_thread (arg=0x55dea9469bb0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #25 0x00007f567fae3494 in start_thread (arg=0x7f567867c700) at pthread_create.c:333
      #26 0x00007f567dc5b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      The problem appeared in 10.2 tree with this revision:

      commit 9f3622191df074d9f4e512320effe86f06b250fb
      Author: Igor Babaev <igor@askmonty.org>
      Date:   Thu Jun 22 00:41:44 2017 -0700
       
          Fixed the bug mdev-12845.
      

      It is still reproducible after bugfix for MDEV-13166, so it is not the same problem.

      Non-debug build, 10.2 29624ea304b5893d3bc81670807285a89fce1a33

      #2  <signal handler called>
      #3  Item_direct_view_ref::derived_field_transformer_for_where (this=<optimized out>, thd=0x7fcfbc0009a8, arg=<optimized out>) at /data/src/10.2/sql/item.cc:7236
      #4  0x0000564a12dcc4bf in Item_args::transform_args (this=this@entry=0x7fcfbc08c890, thd=thd@entry=0x7fcfbc0009a8, transformer=<optimized out>, arg=arg@entry=0x7fcfbc012640 "\220\275\232\023JV") at /data/src/10.2/sql/item_func.cc:328
      #5  0x0000564a12dcc523 in Item_func::transform (this=0x7fcfbc08c808, thd=0x7fcfbc0009a8, transformer=<optimized out>, argument=0x7fcfbc012640 "\220\275\232\023JV") at /data/src/10.2/sql/item_func.cc:364
      #6  0x0000564a12bc4cbd in pushdown_cond_for_derived (thd=0x7fcfbc0009a8, cond=<optimized out>, derived=0x7fcfbc010488) at /data/src/10.2/sql/sql_derived.cc:1231
      #7  0x0000564a12c342f5 in JOIN::optimize_inner (this=0x7fcfbc0141f0) at /data/src/10.2/sql/sql_select.cc:1334
      #8  0x0000564a12c36c0a in JOIN::optimize (this=0x7fcfbc0141f0) at /data/src/10.2/sql/sql_select.cc:1085
      #9  0x0000564a12c38e62 in mysql_select (thd=thd@entry=0x7fcfbc0009a8, tables=0x7fcfbc00f210, wild_num=1, fields=..., conds=0x7fcfbc011b80, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcfbc0141d0, unit=0x7fcfbc004348, select_lex=0x7fcfbc004a80) at /data/src/10.2/sql/sql_select.cc:3654
      #10 0x0000564a12c39066 in handle_select (thd=thd@entry=0x7fcfbc0009a8, lex=lex@entry=0x7fcfbc004280, result=result@entry=0x7fcfbc0141d0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.2/sql/sql_select.cc:373
      #11 0x0000564a12bddcb6 in execute_sqlcom_select (thd=0x7fcfbc0009a8, all_tables=0x7fcfbc00f210) at /data/src/10.2/sql/sql_parse.cc:6442
      #12 0x0000564a12be89e5 in mysql_execute_command (thd=0x7fcfbc0009a8) at /data/src/10.2/sql/sql_parse.cc:3457
      #13 0x0000564a12beba79 in mysql_parse (thd=0x7fcfbc0009a8, rawbuf=<optimized out>, length=83, parser_state=0x7fcfd832b240, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:7879
      #14 0x0000564a12bee33d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fcfbc0009a8, packet=packet@entry=0x7fcfbc006c09 "SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 )", packet_length=packet_length@entry=83, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1817
      #15 0x0000564a12beeb77 in do_command (thd=0x7fcfbc0009a8) at /data/src/10.2/sql/sql_parse.cc:1362
      #16 0x0000564a12cb2a84 in do_handle_one_connection (connect=connect@entry=0x564a14a056e8) at /data/src/10.2/sql/sql_connect.cc:1354
      #17 0x0000564a12cb2c24 in handle_one_connection (arg=arg@entry=0x564a14a056e8) at /data/src/10.2/sql/sql_connect.cc:1260
      #18 0x0000564a12f6c584 in pfs_spawn_thread (arg=0x564a149bad08) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #19 0x00007fcfdefec494 in start_thread (arg=0x7fcfd832c700) at pthread_create.c:333
      #20 0x00007fcfdd16493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: