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

Assertion `args[0] == args[2] || thd->stmt_arena->is_stmt_execute()' failed in Item_func_nullif::fix_length_and_dec

    Details

      Description

      CREATE TABLE t (f VARCHAR(8));
      CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
       
      # Optional
      INSERT INTO t VALUES ('foo'),('bar');
       
      SELECT * FROM v WHERE f != NULLIF('a', COLLATION('b'));
       
      # Cleanup
      DROP VIEW v;
      DROP TABLE t;
      

      10.2 fe1dfe39

      mysqld: /data/src/10.2/sql/item_cmpfunc.cc:2627: virtual bool Item_func_nullif::fix_length_and_dec(): Assertion `args[0] == args[2] || thd->stmt_arena->is_stmt_execute()' failed.
      190331 18:52:16 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fd222c9eee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005638a6d0cf8f in Item_func_nullif::fix_length_and_dec (this=0x7fd20c016b88) at /data/src/10.2/sql/item_cmpfunc.cc:2627
      #9  0x00005638a6d3f963 in Item_func::fix_fields (this=0x7fd20c016b88, thd=0x7fd20c000b00, ref=0x7fd20c0169c0) at /data/src/10.2/sql/item_func.cc:228
      #10 0x00005638a6d3f6c7 in Item_func::fix_fields (this=0x7fd20c016928, thd=0x7fd20c000b00, ref=0x7fd20c0162c8) at /data/src/10.2/sql/item_func.cc:200
      #11 0x00005638a6a8d5bf in JOIN::optimize_inner (this=0x7fd20c015ec0) at /data/src/10.2/sql/sql_select.cc:1353
      #12 0x00005638a6a8c81f in JOIN::optimize (this=0x7fd20c015ec0) at /data/src/10.2/sql/sql_select.cc:1115
      #13 0x00005638a6a1c1aa in mysql_derived_optimize (thd=0x7fd20c000b00, lex=0x7fd20c004630, derived=0x7fd20c012680) at /data/src/10.2/sql/sql_derived.cc:897
      #14 0x00005638a6a1a8bf in mysql_handle_single_derived (lex=0x7fd20c004630, derived=0x7fd20c012680, phases=4) at /data/src/10.2/sql/sql_derived.cc:198
      #15 0x00005638a6a8d8d2 in JOIN::optimize_inner (this=0x7fd20c015898) at /data/src/10.2/sql/sql_select.cc:1401
      #16 0x00005638a6a8c81f in JOIN::optimize (this=0x7fd20c015898) at /data/src/10.2/sql/sql_select.cc:1115
      #17 0x00005638a6a95d30 in mysql_select (thd=0x7fd20c000b00, tables=0x7fd20c012680, wild_num=1, fields=..., conds=0x7fd20c0131b8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fd20c015878, unit=0x7fd20c0046f8, select_lex=0x7fd20c004e30) at /data/src/10.2/sql/sql_select.cc:3804
      #18 0x00005638a6a89fcd in handle_select (thd=0x7fd20c000b00, lex=0x7fd20c004630, result=0x7fd20c015878, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:376
      #19 0x00005638a6a55496 in execute_sqlcom_select (thd=0x7fd20c000b00, all_tables=0x7fd20c012680) at /data/src/10.2/sql/sql_parse.cc:6479
      #20 0x00005638a6a4b70b in mysql_execute_command (thd=0x7fd20c000b00) at /data/src/10.2/sql/sql_parse.cc:3537
      #21 0x00005638a6a59371 in mysql_parse (thd=0x7fd20c000b00, rawbuf=0x7fd20c012458 "SELECT * FROM v WHERE f != NULLIF('a', COLLATION('b'))", length=54, parser_state=0x7fd21cf7a200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8013
      #22 0x00005638a6a46e6e in dispatch_command (command=COM_QUERY, thd=0x7fd20c000b00, packet=0x7fd20c08dea1 "SELECT * FROM v WHERE f != NULLIF('a', COLLATION('b'))", packet_length=54, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1832
      #23 0x00005638a6a4578b in do_command (thd=0x7fd20c000b00) at /data/src/10.2/sql/sql_parse.cc:1386
      #24 0x00005638a6b98ef9 in do_handle_one_connection (connect=0x5638a95f4d80) at /data/src/10.2/sql/sql_connect.cc:1335
      #25 0x00005638a6b98c86 in handle_one_connection (arg=0x5638a95f4d80) at /data/src/10.2/sql/sql_connect.cc:1241
      #26 0x00005638a6fc0fbe in pfs_spawn_thread (arg=0x5638a965db20) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #27 0x00007fd224b8d494 in start_thread (arg=0x7fd21cf7b700) at pthread_create.c:333
      #28 0x00007fd222d5b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with at least MyISAM and InnoDB.
      Not reproducible on 10.1.
      No obvious problem on a non-debug build.

        Attachments

          Activity

            People

            • Assignee:
              bar Alexander Barkov
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: