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

Assertion `real_type() != FIELD_ITEM' failed in Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1(EOL)
    • 10.1.18
    • Optimizer
    • None
    • 10.1.18

    Description

      CREATE TABLE t1 (i INT);
      INSERT INTO t1 VALUES (1),(2);
      SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i AND 1;
      

      Stack trace from 10.1 f6e47c0031 (post-10.1.17)

      mysqld: /data/src/10.1/sql/item.h:3927: virtual COND* Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**): Assertion `real_type() != FIELD_ITEM' failed.
      160901  2:16:55 [ERROR] mysqld got signal 6 ;
      

      #7  0x00007f37a6493312 in __GI___assert_fail (assertion=0x7f37a95a09a4 "real_type() != FIELD_ITEM", file=0x7f37a95a090e "/data/src/10.1/sql/item.h", line=3927, function=0x7f37a95a4340 <Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)::__PRETTY_FUNCTION__> "virtual COND* Item_ref::build_equal_items(THD*, COND_EQUAL*, bool, COND_EQUAL**)") at assert.c:101
      #8  0x00007f37a8c418c7 in Item_ref::build_equal_items (this=0x7f379d4e2be0, thd=0x7f379f7f9070, inherited=0x7f379d4e2e38, link_item_fields=false, cond_equal_ref=0x0) at /data/src/10.1/sql/item.h:3927
      #9  0x00007f37a8cf608e in Item_cond_and::build_equal_items (this=0x7f379d4e2d58, thd=0x7f379f7f9070, inherited=0x7f379d4e2e38, link_item_fields=false, cond_equal_ref=0x7f379d4e33e0) at /data/src/10.1/sql/sql_select.cc:13111
      #10 0x00007f37a8cf69af in build_equal_items (join=0x7f379d4e2f60, cond=0x7f379d4e2d58, inherited=0x0, join_list=0x7f379f7fd330, ignore_on_conds=true, cond_equal_ref=0x7f379d4e33e0, link_equal_fields=false) at /data/src/10.1/sql/sql_select.cc:13358
      #11 0x00007f37a8cfa2b4 in optimize_cond (join=0x7f379d4e2f60, conds=0x7f379d4e2d58, join_list=0x7f379f7fd330, ignore_on_conds=true, cond_value=0x7f379d4e32b4, cond_equal=0x7f379d4e33e0, flags=0) at /data/src/10.1/sql/sql_select.cc:15003
      #12 0x00007f37a8cd5946 in JOIN::optimize_inner (this=0x7f379d4e2f60) at /data/src/10.1/sql/sql_select.cc:1212
      #13 0x00007f37a8cd50c8 in JOIN::optimize (this=0x7f379d4e2f60) at /data/src/10.1/sql/sql_select.cc:1040
      #14 0x00007f37a8cdd704 in mysql_select (thd=0x7f379f7f9070, rref_pointer_array=0x7f379f7fd430, tables=0x7f379d4e2488, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f379d4e2b88, having=0x7f379d4e2d58, proc_param=0x0, select_options=2147748608, result=0x7f379d4e2f40, unit=0x7f379f7fcab8, select_lex=0x7f379f7fd1b8) at /data/src/10.1/sql/sql_select.cc:3424
      #15 0x00007f37a8cd3288 in handle_select (thd=0x7f379f7f9070, lex=0x7f379f7fc9f0, result=0x7f379d4e2f40, setup_tables_done_option=0) at /data/src/10.1/sql/sql_select.cc:384
      #16 0x00007f37a8ca34b5 in execute_sqlcom_select (thd=0x7f379f7f9070, all_tables=0x7f379d4e2488) at /data/src/10.1/sql/sql_parse.cc:5895
      #17 0x00007f37a8c993c2 in mysql_execute_command (thd=0x7f379f7f9070) at /data/src/10.1/sql/sql_parse.cc:2961
      #18 0x00007f37a8ca6c0e in mysql_parse (thd=0x7f379f7f9070, rawbuf=0x7f379d4e2088 "SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i AND 1", length=52, parser_state=0x7f37a9bf25e0) at /data/src/10.1/sql/sql_parse.cc:7319
      #19 0x00007f37a8c95617 in dispatch_command (command=COM_QUERY, thd=0x7f379f7f9070, packet=0x7f37a113e071 "SELECT i, COUNT(*) FROM t1 GROUP BY i HAVING i AND 1", packet_length=52) at /data/src/10.1/sql/sql_parse.cc:1487
      #20 0x00007f37a8c9434e in do_command (thd=0x7f379f7f9070) at /data/src/10.1/sql/sql_parse.cc:1108
      #21 0x00007f37a8dca1a5 in do_handle_one_connection (thd_arg=0x7f379f7f9070) at /data/src/10.1/sql/sql_connect.cc:1350
      #22 0x00007f37a8dc9f09 in handle_one_connection (arg=0x7f379f7f9070) at /data/src/10.1/sql/sql_connect.cc:1262
      #23 0x00007f37a90ac9cc in pfs_spawn_thread (arg=0x7f37a5c27ef0) at /data/src/10.1/storage/perfschema/pfs.cc:1860
      #24 0x00007f37a83950a4 in start_thread (arg=0x7f37a9bf3b00) at pthread_create.c:309
      #25 0x00007f37a654d87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Reproducible on previous versions of 10.1 (tried 10.1.14).
      10.2 is also affected. 5.5 and 10.0 are apparently not.

      Attachments

        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.