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

Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed in sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 10.1
    • Fix Version/s: 10.1.15
    • Component/s: Optimizer
    • Labels:
      None
    • Sprint:
      10.1.15

      Description

      Started happening from commit 7d3d75895d9d29d52c34dd3559cec59731d8d267 on 10.1 tree.

      mysqld: /src/10.1/sql/opt_range.cc:8315: bool sel_trees_can_be_ored(RANGE_OPT_PARAM*, SEL_TREE*, SEL_TREE*, key_map*): Assertion `tree1->keys[key_no] && tree2->keys[key_no]' failed.
      

      #7  0x00007fd3418cb1d2 in __assert_fail () from /lib64/libc.so.6
      #8  0x000055ffa4ff3b52 in sel_trees_can_be_ored (param=0x7fd343b975f0, tree1=0x7fd3380658c0, tree2=0x7fd338065f50, common_keys=0x7fd343b97310) at /src/10.1/sql/opt_range.cc:8315
      #9  0x000055ffa4ff430a in tree_or (param=0x7fd343b975f0, tree1=0x7fd3380658c0, tree2=0x7fd338065f50) at /src/10.1/sql/opt_range.cc:8571
      #10 0x000055ffa4ff1744 in Item_cond::get_mm_tree (this=0x7fd338053f78, param=0x7fd343b975f0, cond_ptr=0x7fd338055ec8) at /src/10.1/sql/opt_range.cc:7407
      #11 0x000055ffa4fe69e2 in SQL_SELECT::test_quick_select (this=0x7fd338055ec0, thd=0x7fd33d7c9bf0, keys_to_use=..., prev_tables=0, limit=18446744073709551615, force_quick_range=false, ordered_output=false, remove_false_parts_of_where=true) at /src/10.1/sql/opt_range.cc:2551
      #12 0x000055ffa4cd0095 in get_quick_record_count (thd=0x7fd33d7c9bf0, select=0x7fd338055ec0, table=0x7fd337e2da70, keys=0x7fd338054f08, limit=18446744073709551615) at /src/10.1/sql/sql_select.cc:3488
      #13 0x000055ffa4cd250a in make_join_statistics (join=0x7fd338054450, tables_list=..., keyuse_array=0x7fd338054780) at /src/10.1/sql/sql_select.cc:4108
      #14 0x000055ffa4cc88aa in JOIN::optimize_inner (this=0x7fd338054450) at /src/10.1/sql/sql_select.cc:1374
      #15 0x000055ffa4cc7770 in JOIN::optimize (this=0x7fd338054450) at /src/10.1/sql/sql_select.cc:1036
      #16 0x000055ffa4ccfe05 in mysql_select (thd=0x7fd33d7c9bf0, rref_pointer_array=0x7fd33d7cdf80, tables=0x7fd3380530d0, wild_num=1, fields=..., conds=0x7fd338053f78, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fd338054430, unit=0x7fd33d7cd608, select_lex=0x7fd33d7cdd08) at /src/10.1/sql/sql_select.cc:3437
      #17 0x000055ffa4cc593d in handle_select (thd=0x7fd33d7c9bf0, lex=0x7fd33d7cd540, result=0x7fd338054430, setup_tables_done_option=0) at /src/10.1/sql/sql_select.cc:384
      #18 0x000055ffa4c95b8c in execute_sqlcom_select (thd=0x7fd33d7c9bf0, all_tables=0x7fd3380530d0) at /src/10.1/sql/sql_parse.cc:5894
      #19 0x000055ffa4c8ba76 in mysql_execute_command (thd=0x7fd33d7c9bf0) at /src/10.1/sql/sql_parse.cc:2960
      #20 0x000055ffa4c992a4 in mysql_parse (thd=0x7fd33d7c9bf0, rawbuf=0x7fd338052e88 "SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5", length=76, parser_state=0x7fd343b995e0) at /src/10.1/sql/sql_parse.cc:7314
      #21 0x000055ffa4c87cdd in dispatch_command (command=COM_QUERY, thd=0x7fd33d7c9bf0, packet=0x7fd33c9c9571 "SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5", packet_length=76) at /src/10.1/sql/sql_parse.cc:1486
      #22 0x000055ffa4c86a0f in do_command (thd=0x7fd33d7c9bf0) at /src/10.1/sql/sql_parse.cc:1107
      #23 0x000055ffa4dbd07f in do_handle_one_connection (thd_arg=0x7fd33d7c9bf0) at /src/10.1/sql/sql_connect.cc:1350
      #24 0x000055ffa4dbcde3 in handle_one_connection (arg=0x7fd33d7c9bf0) at /src/10.1/sql/sql_connect.cc:1262
      #25 0x000055ffa54c7454 in pfs_spawn_thread (arg=0x7fd33c3b0bf0) at /src/10.1/storage/perfschema/pfs.cc:1860
      #26 0x00007fd3438140a4 in start_thread () from /lib64/libpthread.so.0
      #27 0x00007fd34198204d in clone () from /lib64/libc.so.6
      

      CREATE TABLE t1 (pk INT PRIMARY KEY);
      INSERT INTO t1 VALUES (1),(2);
      SELECT * FROM t1 WHERE pk != 1000 OR pk IN ( 1000, 0, 1, 100, 2 ) OR pk >= 5;
      

        Attachments

          Activity

            People

            Assignee:
            psergey Sergei Petrunia
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: