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

Assertion `((Item_cond *) cond)->functype() == ((Item_cond *) new_item)->functype()' fails on a query with LEFT JOIN and IS NULL conditions

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.0.5, 5.5.33, 5.3.13
    • Component/s: None
    • Labels:
      None

      Description

      This is the test case that was discussed on IRC. It looks similar to MDEV-4942, but the fix for the latter is already in the tree, and this one still fails.

      CREATE TABLE t1 (a1 INT, b1 INT NOT NULL) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1, 10), (2, 11);
       
      CREATE TABLE t2 (dt DATETIME NOT NULL, a2 INT, b2 INT) ENGINE=MyISAM;
      INSERT INTO t2 VALUES ('2006-10-08 09:34:54', 1, 100), ('2001-01-19 01:04:43', 2, 200);
       
      SELECT * FROM t1 LEFT JOIN t2 ON a1 = a2 WHERE ( dt IS NULL OR b1 IS NULL ) AND b2 IS NULL;

      mysqld: sql_select.cc:13357: COND* remove_eq_conds(THD*, COND*, Item::cond_result*): Assertion `((Item_cond *) cond)->functype() == ((Item_cond *) new_item)->functype()' failed.
      130827  0:39:11 [ERROR] mysqld got signal 6 ;

      #7  0x00007fae6d341192 in __GI___assert_fail (assertion=0xd2fad0 "((Item_cond *) cond)->functype() == ((Item_cond *) new_item)->functype()", file=0xd2ebff "sql_select.cc", line=13357, function=0xd314c0 "COND* remove_eq_conds(THD*, COND*, Item::cond_result*)") at assert.c:103
      #8  0x00000000007277f3 in remove_eq_conds (thd=0x2a1a8c8, cond=0x7fae5401a900, cond_value=0x7fae54038090) at sql_select.cc:13356
      #9  0x00000000007271af in optimize_cond (join=0x7fae54037da0, conds=0x7fae5401a900, join_list=0x2a1d4d0, ignore_on_conds=false, cond_value=0x7fae54038090, cond_equal=0x7fae540381b0) at sql_select.cc:13142
      #10 0x0000000000707bb4 in JOIN::optimize (this=0x7fae54037da0) at sql_select.cc:1019
      #11 0x000000000070ef81 in mysql_select (thd=0x2a1a8c8, rref_pointer_array=0x2a1d5b8, tables=0x7fae540191b8, wild_num=1, fields=..., conds=0x7fae5401a900, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x7fae5401aad8, unit=0x2a1ce58, select_lex=0x2a1d360) at sql_select.cc:2990
      #12 0x0000000000705989 in handle_select (thd=0x2a1a8c8, lex=0x2a1cdb8, result=0x7fae5401aad8, setup_tables_done_option=0) at sql_select.cc:288
      #13 0x0000000000691c62 in execute_sqlcom_select (thd=0x2a1a8c8, all_tables=0x7fae540191b8) at sql_parse.cc:5172
      #14 0x0000000000688a2a in mysql_execute_command (thd=0x2a1a8c8) at sql_parse.cc:2305
      #15 0x00000000006946ec in mysql_parse (thd=0x2a1a8c8, rawbuf=0x7fae54018f40 "SELECT * FROM t1 LEFT JOIN t2 ON a1 = a2 WHERE ( dt IS NULL OR b1 IS NULL ) AND b2 IS NULL", length=90, found_semicolon=0x7fae605477e0) at sql_parse.cc:6173
      #16 0x0000000000686147 in dispatch_command (command=COM_QUERY, thd=0x2a1a8c8, packet=0x2a94b29 "SELECT * FROM t1 LEFT JOIN t2 ON a1 = a2 WHERE ( dt IS NULL OR b1 IS NULL ) AND b2 IS NULL", packet_length=90) at sql_parse.cc:1243
      #17 0x00000000006853b8 in do_command (thd=0x2a1a8c8) at sql_parse.cc:923
      #18 0x0000000000682252 in handle_one_connection (arg=0x2a1a8c8) at sql_connect.cc:1231
      #19 0x00007fae6dedce9a in start_thread (arg=0x7fae60548700) at pthread_create.c:308
      #20 0x00007fae6d405cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      bzr version-info
      revision-id: igor@askmonty.org-20130824051702-jp6c9dwdstk3i83u
      revno: 3683
      branch-nick: 5.3

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: