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

Assertion `!is_cond()' failed in Item_bool_func::val_int / do_select

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT) ENGINE=MyISAM;
      INSERT INTO t VALUES (1);
      SELECT VARIANCE(a) AS f1, VARIANCE(a) AS f2 FROM t WHERE ROWNUM() = 2 HAVING f1 > 1;
       
      # Cleanup
      DROP TABLE t;
      

      10.6 cd97caef84a842cf388866cfc0a0ec32b86a9c13

      mariadbd: /data/bld/10.6-asan/sql/item_cmpfunc.h:247: virtual longlong Item_bool_func::val_int(): Assertion `!is_cond()' failed.
      241013 19:38:04 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007f5c45253e32 in __GI___assert_fail (assertion=0x5638cbcb03c0 "!is_cond()", file=0x5638cbcb0300 "/data/bld/10.6-asan/sql/item_cmpfunc.h", line=247, function=0x5638cbcb0400 "virtual longlong Item_bool_func::val_int()") at ./assert/assert.c:101
      #10 0x00005638c99e52d6 in Item_bool_func::val_int (this=0x62b000086a28) at /data/bld/10.6-asan/sql/item_cmpfunc.h:247
      #11 0x00005638c9cb389d in do_select (join=0x62b0000875a8, procedure=0x0) at /data/bld/10.6-asan/sql/sql_select.cc:21813
      #12 0x00005638c9c3b01a in JOIN::exec_inner (this=0x62b0000875a8) at /data/bld/10.6-asan/sql/sql_select.cc:4934
      #13 0x00005638c9c384d2 in JOIN::exec (this=0x62b0000875a8) at /data/bld/10.6-asan/sql/sql_select.cc:4712
      #14 0x00005638c9c3c951 in mysql_select (thd=0x62b00007e218, tables=0x62b000085dc0, fields=..., conds=0x62b000086650, og_num=0, order=0x0, group=0x0, having=0x62b000086a28, proc_param=0x0, select_options=2147748608, result=0x62b000087578, unit=0x62b000082600, select_lex=0x62b000085350) at /data/bld/10.6-asan/sql/sql_select.cc:5191
      #15 0x00005638c9c0b5b2 in handle_select (thd=0x62b00007e218, lex=0x62b000082538, result=0x62b000087578, setup_tables_done_option=0) at /data/bld/10.6-asan/sql/sql_select.cc:573
      #16 0x00005638c9b6cba0 in execute_sqlcom_select (thd=0x62b00007e218, all_tables=0x62b000085dc0) at /data/bld/10.6-asan/sql/sql_parse.cc:6396
      #17 0x00005638c9b5acf9 in mysql_execute_command (thd=0x62b00007e218, is_called_from_prepared_stmt=false) at /data/bld/10.6-asan/sql/sql_parse.cc:3988
      #18 0x00005638c9b779d6 in mysql_parse (thd=0x62b00007e218, rawbuf=0x62b000085238 "SELECT VARIANCE(a) AS f1, VARIANCE(a) AS f2 FROM t WHERE ROWNUM() = 2 HAVING f1 > 1", length=83, parser_state=0x7f5c3bd2ca30) at /data/bld/10.6-asan/sql/sql_parse.cc:8181
      #19 0x00005638c9b4cee5 in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900023f219 "", packet_length=83, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1897
      #20 0x00005638c9b49c19 in do_command (thd=0x62b00007e218, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1410
      #21 0x00005638c9fc9f4c in do_handle_one_connection (connect=0x608000002d38, put_in_cache=true) at /data/bld/10.6-asan/sql/sql_connect.cc:1417
      #22 0x00005638c9fc9908 in handle_one_connection (arg=0x608000002cb8) at /data/bld/10.6-asan/sql/sql_connect.cc:1319
      #23 0x00005638cac4152a in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/10.6-asan/storage/perfschema/pfs.cc:2201
      #24 0x00007f5c452a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #25 0x00007f5c4532861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The assertion was added by this commit in 10.6:

      commit a931da82fac9f856a8e66b17063bc0b3d3ffdf52
      Author: Alexander Barkov
      Date:   Tue May 14 09:19:34 2024 +0400
       
          MDEV-34123 CONCAT Function Returns Unexpected Empty Set in Query
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.