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

Assertion `!result' failed in convert_const_to_int upon using SEQUENCE in subquery

    XMLWordPrintable

Details

    Description

      CREATE SEQUENCE s MINVALUE = -1;
      SELECT '1' IN ( SELECT start_value FROM s );
       
      # Cleanup
      DROP TABLE s;
      

      10.3 19da9a51

      mysqld: /data/src/10.3/sql/item_cmpfunc.cc:393: bool convert_const_to_int(THD*, Item_field*, Item**): Assertion `!result' failed.
      200530  0:39:08 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fba7b4aaf12 in __GI___assert_fail (assertion=0x563e14c21750 "!result", file=0x563e14c21710 "/data/src/10.3/sql/item_cmpfunc.cc", line=393, function=0x563e14c223e0 <convert_const_to_int(THD*, Item_field*, Item**)::__PRETTY_FUNCTION__> "bool convert_const_to_int(THD*, Item_field*, Item**)") at assert.c:101
      #8  0x0000563e1418a752 in convert_const_to_int (thd=0x7fba64000af0, field_item=0x7fba64013530, item=0x7fba64015bf0) at /data/src/10.3/sql/item_cmpfunc.cc:393
      #9  0x0000563e1418a9ed in Item_func::convert_const_compared_to_int_field (this=0x7fba64015b60, thd=0x7fba64000af0) at /data/src/10.3/sql/item_cmpfunc.cc:424
      #10 0x0000563e1418abbd in Item_func::setup_args_and_comparator (this=0x7fba64015b60, thd=0x7fba64000af0, cmp=0x7fba64015c20) at /data/src/10.3/sql/item_cmpfunc.cc:444
      #11 0x0000563e1418ad84 in Item_bool_rowready_func2::fix_length_and_dec (this=0x7fba64015b60) at /data/src/10.3/sql/item_cmpfunc.cc:477
      #12 0x0000563e141c9d11 in Item_func::fix_fields (this=0x7fba64015b60, thd=0x7fba64000af0, ref=0x0) at /data/src/10.3/sql/item_func.cc:370
      #13 0x0000563e13d2794a in Item::fix_fields_if_needed (this=0x7fba64015b60, thd=0x7fba64000af0, ref=0x0) at /data/src/10.3/sql/item.h:825
      #14 0x0000563e1422336a in Item_in_subselect::create_single_in_to_exists_cond (this=0x7fba64013cf8, join=0x7fba640146e8, where_item=0x7fba64014be8, having_item=0x7fba64014bf0) at /data/src/10.3/sql/item_subselect.cc:2212
      #15 0x0000563e14225516 in Item_in_subselect::create_in_to_exists_cond (this=0x7fba64013cf8, join_arg=0x7fba640146e8) at /data/src/10.3/sql/item_subselect.cc:2591
      #16 0x0000563e14001cd7 in JOIN::choose_subquery_plan (this=0x7fba640146e8, join_tables=0) at /data/src/10.3/sql/opt_subselect.cc:5791
      #17 0x0000563e13e7f395 in make_join_statistics (join=0x7fba640146e8, tables_list=..., keyuse_array=0x7fba640149d8) at /data/src/10.3/sql/sql_select.cc:5192
      #18 0x0000563e13e739f2 in JOIN::optimize_inner (this=0x7fba640146e8) at /data/src/10.3/sql/sql_select.cc:1948
      #19 0x0000563e13e71f1d in JOIN::optimize (this=0x7fba640146e8) at /data/src/10.3/sql/sql_select.cc:1494
      #20 0x0000563e13e01ec7 in st_select_lex::optimize_unflattened_subqueries (this=0x7fba64005140, const_only=true) at /data/src/10.3/sql/sql_lex.cc:4085
      #21 0x0000563e14000a2b in JOIN::optimize_constant_subqueries (this=0x7fba640140b8) at /data/src/10.3/sql/opt_subselect.cc:5373
      #22 0x0000563e13e72878 in JOIN::optimize_inner (this=0x7fba640140b8) at /data/src/10.3/sql/sql_select.cc:1689
      #23 0x0000563e13e71f1d in JOIN::optimize (this=0x7fba640140b8) at /data/src/10.3/sql/sql_select.cc:1494
      #24 0x0000563e13e7bff2 in mysql_select (thd=0x7fba64000af0, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fba64014090, unit=0x7fba640049b8, select_lex=0x7fba64005140) at /data/src/10.3/sql/sql_select.cc:4298
      #25 0x0000563e13e6d672 in handle_select (thd=0x7fba64000af0, lex=0x7fba640048f8, result=0x7fba64014090, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
      #26 0x0000563e13e35004 in execute_sqlcom_select (thd=0x7fba64000af0, all_tables=0x7fba64013688) at /data/src/10.3/sql/sql_parse.cc:6294
      #27 0x0000563e13e2b757 in mysql_execute_command (thd=0x7fba64000af0) at /data/src/10.3/sql/sql_parse.cc:3820
      #28 0x0000563e13e3930f in mysql_parse (thd=0x7fba64000af0, rawbuf=0x7fba64012818 "SELECT '1' IN ( SELECT start_value FROM s )", length=43, parser_state=0x7fba756a95e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7818
      #29 0x0000563e13e25b57 in dispatch_command (command=COM_QUERY, thd=0x7fba64000af0, packet=0x7fba641234e1 "SELECT '1' IN ( SELECT start_value FROM s )", packet_length=43, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #30 0x0000563e13e2446f in do_command (thd=0x7fba64000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #31 0x0000563e13f9caaf in do_handle_one_connection (connect=0x563e16fc22e0) at /data/src/10.3/sql/sql_connect.cc:1403
      #32 0x0000563e13f9c811 in handle_one_connection (arg=0x563e16fc22e0) at /data/src/10.3/sql/sql_connect.cc:1308
      #33 0x0000563e14951e18 in pfs_spawn_thread (arg=0x563e16fdd390) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #34 0x00007fba7d4334a4 in start_thread (arg=0x7fba756aa700) at pthread_create.c:456
      #35 0x00007fba7b567d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible with at least InnoDB, MyISAM, Aria.
      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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