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

Assertion failure in Item_func_or_sum::do_build_clone (Item_func_not_all)

    XMLWordPrintable

Details

    Description

      CREATE VIEW t AS SELECT 0 AS a;
      SELECT * FROM t WHERE a=ALL (SELECT 0);
      

      Leads to

      10.5.27 ae02999cdbea0ebb57cafc8c6b09878b8ea8a3be (Debug)

      mariadbd: /test/10.5_dbg/sql/item.h:1677: Item* Item::get_copy(THD*) const: Assertion `typeid(*copy) == typeid(*this)' failed.
      

      10.5.27 ae02999cdbea0ebb57cafc8c6b09878b8ea8a3be (Debug)

      Core was generated by `/test/MD200824-mariadb-10.5.27-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14a290467700 (LWP 3439361))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014a2a5b95859 in __GI_abort () at abort.c:79
      #2  0x000014a2a5b95729 in __assert_fail_base (fmt=0x14a2a5d2b588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55978cfcd6d0 "typeid(*copy) == typeid(*this)", file=0x55978cfcd308 "/test/10.5_dbg/sql/item.h", line=1677, function=<optimized out>) at assert.c:92
      #3  0x000014a2a5ba6fd6 in __GI___assert_fail (assertion=assertion@entry=0x55978cfcd6d0 "typeid(*copy) == typeid(*this)", file=file@entry=0x55978cfcd308 "/test/10.5_dbg/sql/item.h", line=line@entry=1677, function=function@entry=0x55978cfcd6a8 "Item* Item::get_copy(THD*) const") at assert.c:101
      #4  0x000055978c5a48e0 in Item::get_copy (thd=0x14a254000d48, this=0x14a254014d88) at /test/10.5_dbg/sql/item.h:1677
      #5  Item_func_or_sum::do_build_clone (this=0x14a254014d88, thd=0x14a254000d48) at /test/10.5_dbg/sql/item.cc:2736
      #6  0x000055978c5b4748 in Item::build_clone (thd=0x14a254000d48, this=0x14a254014d88) at /test/10.5_dbg/sql/item.h:1691
      #7  Item::build_pushable_cond (this=this@entry=0x14a254014d88, thd=thd@entry=0x14a254000d48, checker=<optimized out>, arg=0x14a2540215f0 "\001") at /test/10.5_dbg/sql/item.cc:7798
      #8  0x000055978c261a39 in pushdown_cond_for_derived (thd=0x14a254000d48, cond=0x14a254014d88, derived=derived@entry=0x14a2540134c0) at /test/10.5_dbg/sql/sql_derived.cc:1526
      #9  0x000055978c33269c in JOIN::optimize_inner (this=this@entry=0x14a2540187c0) at /test/10.5_dbg/sql/sql_select.cc:2229
      #10 0x000055978c3331a5 in JOIN::optimize (this=this@entry=0x14a2540187c0) at /test/10.5_dbg/sql/sql_select.cc:1765
      #11 0x000055978c33327d in mysql_select (thd=thd@entry=0x14a254000d48, tables=0x14a2540134c0, fields=@0x14a254012fd0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a254013478, last = 0x14a254013478, elements = 1}, <No data fields>}, conds=0x14a254014d88, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14a254018798, unit=0x14a254004ef8, select_lex=0x14a254012e68) at /test/10.5_dbg/sql/sql_select.cc:4900
      #12 0x000055978c333dd3 in handle_select (thd=thd@entry=0x14a254000d48, lex=lex@entry=0x14a254004e30, result=result@entry=0x14a254018798, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.5_dbg/sql/sql_select.cc:449
      #13 0x000055978c2ac236 in execute_sqlcom_select (thd=thd@entry=0x14a254000d48, all_tables=0x14a2540134c0) at /test/10.5_dbg/sql/sql_parse.cc:6431
      #14 0x000055978c2b92ac in mysql_execute_command (thd=thd@entry=0x14a254000d48) at /test/10.5_dbg/sql/sql_parse.cc:4030
      #15 0x000055978c2a5572 in mysql_parse (thd=thd@entry=0x14a254000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a2904662c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8229
      #16 0x000055978c2b42b7 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a254000d48, packet=packet@entry=0x14a25400aa19 "SELECT * FROM t WHERE a=ALL (SELECT 0)", packet_length=packet_length@entry=38, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
      #17 0x000055978c2b6ff0 in do_command (thd=0x14a254000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
      #18 0x000055978c404092 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55978f9ebc58, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
      #19 0x000055978c404730 in handle_one_connection (arg=arg@entry=0x55978f9ebc58) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #20 0x000055978c88557d in pfs_spawn_thread (arg=0x55978f9ce9c8) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #21 0x000014a2a60a6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x000014a2a5c92133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.