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

Assertion `!join->conds || !join->cond_equal || !join->cond_equal->current_level.elements || (join->conds->type() == Item::COND_ITEM && ((Item_cond*) (join->conds))->functype() == Item_func::COND_AND_FUNC && join->cond_equal == &((Item_cond_and *)...

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • N/A
    • 5.3.13
    • None

    Description

      The problem appeared on 5.3 tree with the recent merge from 5.2 (even though it is not reproducible on 5.2):

      revno: 3773 [merge]
      revision-id: sergii@pisem.net-20140316200301-s6v5h1t6d9feqwo9
      branch nick: 5.3
      timestamp: Sun 2014-03-16 21:03:01 +0100
      message:
        5.2 merge

      mysqld: sql_select.cc:3682: bool make_join_statistics(JOIN*, List<TABLE_LIST>&, COND*, DYNAMIC_ARRAY*): Assertion `!join->conds || !join->cond_equal || !join->cond_equal->current_level.elements || (join->conds->type() == Item::COND_ITEM && ((Item_cond*) (join->conds))->functype() == Item_func::COND_AND_FUNC && join->cond_equal == &((Item_cond_and *) (join->conds))->cond_equal) || (join->conds->type() == Item::FUNC_ITEM && ((Item_func*) (join->conds))->functype() == Item_func::MULT_EQUAL_FUNC && join->cond_equal->current_level.elements == 1 && join->cond_equal->current_level.head() == join->conds)' failed.
      140321 21:14:07 [ERROR] mysqld got signal 6 ;

      #6  0x00007faaa60a0621 in *__GI___assert_fail (assertion=0xd3de38 "!join->conds || !join->cond_equal || !join->cond_equal->current_level.elements || (join->conds->type() == Item::COND_ITEM && ((Item_cond*) (join->conds))->functype() == Item_func::COND_AND_FUNC && joi"..., file=<optimized out>, line=3682, function=0xd41040 "bool make_join_statistics(JOIN*, List<TABLE_LIST>&, COND*, DYNAMIC_ARRAY*)") at assert.c:81
      #7  0x0000000000731b18 in make_join_statistics (join=0x28eee10, tables_list=..., conds=0x28efac0, keyuse_array=0x28ef0f0) at sql_select.cc:3671
      #8  0x0000000000728c14 in JOIN::optimize (this=0x28eee10) at sql_select.cc:1165
      #9  0x000000000072f5c5 in mysql_select (thd=0x2837b68, rref_pointer_array=0x283a868, tables=0x28bbd28, wild_num=0, fields=..., conds=0x28bcfa0, og_num=0, order=0x0, group=0x0, having=0x28eec20, proc_param=0x0, select_options=2147764736, result=0x28eedf0, unit=0x283a0f8, select_lex=0x283a600) at sql_select.cc:2993
      #10 0x00000000007260c1 in handle_select (thd=0x2837b68, lex=0x283a058, result=0x28eedf0, setup_tables_done_option=0) at sql_select.cc:288
      #11 0x00000000006b4c87 in execute_sqlcom_select (thd=0x2837b68, all_tables=0x28bbd28) at sql_parse.cc:5174
      #12 0x00000000006abe23 in mysql_execute_command (thd=0x2837b68) at sql_parse.cc:2307
      #13 0x00000000006b75ee in mysql_parse (thd=0x2837b68, rawbuf=0x28bb990 "SELECT a, b FROM t1 WHERE 1 IN ( SELECT c FROM t2 )    \nHAVING b <> 'qux' AND a IN ( SELECT 6 )", length=95, found_semicolon=0x7faa9d5bdcb8) at sql_parse.cc:6175
      #14 0x00000000006a9603 in dispatch_command (command=COM_QUERY, thd=0x2837b68, packet=0x28b2549 "SELECT a, b FROM t1 WHERE 1 IN ( SELECT c FROM t2 )    \nHAVING b <> 'qux' AND a IN ( SELECT 6 )", packet_length=95) at sql_parse.cc:1245
      #15 0x00000000006a88ac in do_command (thd=0x2837b68) at sql_parse.cc:923
      #16 0x00000000006a573d in handle_one_connection (arg=0x2837b68) at sql_connect.cc:1231
      #17 0x00007faaa6dacb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #18 0x00007faaa614fa7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Stack trace from:

      revision-id: sanja@askmonty.org-20140321102309-tk38sm477ne6ayqr
      date: 2014-03-21 12:23:09 +0200
      build-date: 2014-03-21 21:18:48 +0400
      revno: 3775
      branch-nick: 5.3
      BUILD/compile-pentium-debug-max-no-ndb


      Test case (different from the one where the first stack trace happened):

      --source include/have_innodb.inc
      CREATE TABLE t1 (pk INT PRIMARY KEY, f INT NOT NULL, INDEX(f)) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1,0),(2,8);
       
      SELECT * FROM t1 WHERE f = 2 HAVING ( pk IN ( SELECT 9 ) AND f != 0 );

      Stack trace:

      mysqld: sql_select.cc:3682: bool make_join_statistics(JOIN*, List<TABLE_LIST>&, COND*, DYNAMIC_ARRAY*): Assertion `!join->conds || !join->cond_equal || !join->cond_equal->current_level.elements || (join->conds->type() == Item::COND_ITEM && ((Item_cond*) (join->conds))->functype() == Item_func::COND_AND_FUNC && join->cond_equal == &((Item_cond_and *) (join->conds))->cond_equal) || (join->conds->type() == Item::FUNC_ITEM && ((Item_func*) (join->conds))->functype() == Item_func::MULT_EQUAL_FUNC && join->cond_equal->current_level.elements == 1 && join->cond_equal->current_level.head() == join->conds)' failed.
      140416 11:57:25 [ERROR] mysqld got signal 6 ;

      #6  0x00007f50238cb621 in *__GI___assert_fail (assertion=0xd3de38 "!join->conds || !join->cond_equal || !join->cond_equal->current_level.elements || (join->conds->type() == Item::COND_ITEM && ((Item_cond*) (join->conds))->functype() == Item_func::COND_AND_FUNC && joi"..., file=<optimized out>, line=3682, function=0xd41040 "bool make_join_statistics(JOIN*, List<TABLE_LIST>&, COND*, DYNAMIC_ARRAY*)") at assert.c:81
      #7  0x0000000000731b20 in make_join_statistics (join=0x2fef378, tables_list=..., conds=0x301b348, keyuse_array=0x2fef658) at sql_select.cc:3671
      #8  0x0000000000728c1c in JOIN::optimize (this=0x2fef378) at sql_select.cc:1165
      #9  0x000000000072f5cd in mysql_select (thd=0x2f69c18, rref_pointer_array=0x2f6c918, tables=0x2fedb78, wild_num=1, fields=..., conds=0x2fee128, og_num=0, order=0x0, group=0x0, having=0x2fef190, proc_param=0x0, select_options=2147764736, result=0x2fef358, unit=0x2f6c1a8, select_lex=0x2f6c6b0) at sql_select.cc:2993
      #10 0x00000000007260c9 in handle_select (thd=0x2f69c18, lex=0x2f6c108, result=0x2fef358, setup_tables_done_option=0) at sql_select.cc:288
      #11 0x00000000006b4c8f in execute_sqlcom_select (thd=0x2f69c18, all_tables=0x2fedb78) at sql_parse.cc:5174
      #12 0x00000000006abe2b in mysql_execute_command (thd=0x2f69c18) at sql_parse.cc:2307
      #13 0x00000000006b75f6 in mysql_parse (thd=0x2f69c18, rawbuf=0x2fed930 "SELECT * FROM t1 WHERE f = 2 HAVING ( pk IN ( SELECT 9 ) AND f != 0 )", length=69, found_semicolon=0x7f501ade8cb8) at sql_parse.cc:6175
      #14 0x00000000006a960b in dispatch_command (command=COM_QUERY, thd=0x2f69c18, packet=0x2fe44c9 "SELECT * FROM t1 WHERE f = 2 HAVING ( pk IN ( SELECT 9 ) AND f != 0 )", packet_length=69) at sql_parse.cc:1245
      #15 0x00000000006a88b4 in do_command (thd=0x2f69c18) at sql_parse.cc:923
      #16 0x00000000006a5745 in handle_one_connection (arg=0x2f69c18) at sql_connect.cc:1231
      #17 0x00007f50245d7b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #18 0x00007f502397aa7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Stack trace from:

      elenst@wheezy-64:~/bzr/5.3/mysql-test$ bzr version-info
      revision-id: bar@mariadb.org-20140323120256-eld0j8vryj3jep8w
      date: 2014-03-23 16:02:56 +0400
      build-date: 2014-04-16 12:00:01 +0400
      revno: 3776
      branch-nick: 5.3

      Attachments

        Activity

          People

            igor Igor Babaev
            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.