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

Server crash in Time_and_counter_tracker::incr_loops or Assertion failure in JOIN::save_explain_data

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.5, 10.6, 10.11, 11.1(EOL), 11.2, 10.4(EOL), 10.10(EOL), 11.0(EOL)
    • N/A
    • Optimizer
    • None

    Description

      Note: The server crash and the assertion failure look so different that I'm not even sure they are the same issue. If it turns they are not, please split the report as needed.

      CREATE TABLE t1 (a date);
      INSERT INTO t1 VALUES ('2012-12-12'),('2000-01-01'); # Optional, fails either way
      CREATE TABLE t2 (f datetime);
      INSERT INTO t2 VALUES ('0000-00-00 00:00:00'),('0000-00-00 00:00:00');
       
      SELECT a FROM t1 GROUP BY a HAVING (a = '' OR a = 0) AND a = (SELECT MIN(f) FROM t2);
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.4 non-debug 7d89dcf1

      #2  <signal handler called>
      #3  0x000055938dab0aab in Time_and_counter_tracker::incr_loops (this=0x90) at /data/src/10.4/sql/sql_analyze_stmt.h:97
      #4  JOIN::exec (this=0x7f525012a838) at /data/src/10.4/sql/sql_select.cc:4386
      #5  0x000055938dcd53a5 in subselect_single_select_engine::exec (this=0x7f5250013300) at /data/src/10.4/sql/item_subselect.cc:4032
      #6  0x000055938dcd40fd in Item_subselect::exec (this=0x7f5250013178) at /data/src/10.4/sql/item_subselect.cc:758
      #7  0x000055938dcd3d18 in Item_singlerow_subselect::get_date (this=0x7f5250013178, thd=0x7f5250000c58, ltime=0x7f5260a3a680, fuzzydate=...) at /data/src/10.4/sql/item_subselect.cc:1509
      #8  0x000055938db9cc62 in Temporal_with_date::make_from_item (this=this@entry=0x7f5260a3a680, thd=thd@entry=0x7f5250000c58, item=item@entry=0x7f5250013178, fuzzydate=...) at /data/src/10.4/sql/sql_type.cc:904
      #9  0x000055938d9a3b5a in Temporal_with_date::Temporal_with_date (fuzzydate=..., item=0x7f5250013178, thd=0x7f5250000c58, this=0x7f5260a3a680) at /data/src/10.4/sql/sql_type.h:1971
      #10 Datetime::Datetime (fuzzydate=..., item=0x7f5250013178, thd=0x7f5250000c58, this=0x7f5260a3a680) at /data/src/10.4/sql/sql_type.h:2250
      #11 Item::val_datetime_packed (this=0x7f5250013178, thd=0x7f5250000c58) at /data/src/10.4/sql/item.h:1799
      #12 0x000055938dc601fc in Arg_comparator::compare_datetime (this=0x7f525012a170) at /data/src/10.4/sql/item_cmpfunc.cc:753
      #13 0x000055938dc6270b in Arg_comparator::compare (this=<optimized out>) at /data/src/10.4/sql/item_cmpfunc.h:104
      #14 Item_func_eq::val_int (this=<optimized out>) at /data/src/10.4/sql/item_cmpfunc.cc:1790
      #15 0x000055938db8fb30 in Type_handler_int_result::Item_val_bool (this=<optimized out>, item=<optimized out>) at /data/src/10.4/sql/sql_type.cc:4638
      #16 0x000055938dc5fac5 in Item_cond_or::val_int (this=0x7f5250038c28) at /data/src/10.4/sql/item_cmpfunc.cc:5377
      #17 0x000055938db8fb30 in Type_handler_int_result::Item_val_bool (this=<optimized out>, item=<optimized out>) at /data/src/10.4/sql/sql_type.cc:4638
      #18 0x000055938dc5fa2c in Item_cond_and::val_int (this=0x7f5250038b10) at /data/src/10.4/sql/item_cmpfunc.cc:5359
      #19 0x000055938da77096 in evaluate_join_record (join=join@entry=0x7f5250014020, join_tab=join_tab@entry=0x7f5250037cc0, error=<optimized out>) at /data/src/10.4/sql/sql_select.cc:20997
      #20 0x000055938da86b7f in sub_select (join=0x7f5250014020, join_tab=0x7f5250037cc0, end_of_records=<optimized out>) at /data/src/10.4/sql/sql_select.cc:20902
      #21 0x000055938dab082f in do_select (procedure=0x0, join=0x7f5250014020) at /data/src/10.4/sql/sql_select.cc:20423
      #22 JOIN::exec_inner (this=this@entry=0x7f5250014020) at /data/src/10.4/sql/sql_select.cc:4605
      #23 0x000055938dab0ac4 in JOIN::exec (this=this@entry=0x7f5250014020) at /data/src/10.4/sql/sql_select.cc:4387
      #24 0x000055938daaeb44 in mysql_select (thd=thd@entry=0x7f5250000c58, tables=0x7f5250010850, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f5250011070, having=0x7f5250013580, proc_param=0x0, select_options=2147748608, result=0x7f5250013ff8, unit=0x7f52500049d0, select_lex=0x7f5250010228) at /data/src/10.4/sql/sql_select.cc:4826
      #25 0x000055938daaf533 in handle_select (thd=thd@entry=0x7f5250000c58, lex=lex@entry=0x7f5250004910, result=result@entry=0x7f5250013ff8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.4/sql/sql_select.cc:442
      #26 0x000055938da43b9c in execute_sqlcom_select (thd=thd@entry=0x7f5250000c58, all_tables=0x7f5250010850) at /data/src/10.4/sql/sql_parse.cc:6475
      #27 0x000055938da4ff1b in mysql_execute_command (thd=thd@entry=0x7f5250000c58) at /data/src/10.4/sql/sql_parse.cc:3978
      #28 0x000055938da51797 in mysql_parse (thd=thd@entry=0x7f5250000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f5260a3b540, is_com_multi=is_com_multi@entry=false, is_next_command=<optimized out>) at /data/src/10.4/sql/sql_parse.cc:8012
      #29 0x000055938da534a5 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f5250000c58, packet=packet@entry=0x7f5250007d79 "", packet_length=packet_length@entry=84, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #30 0x000055938da54fa8 in do_command (thd=0x7f5250000c58) at /data/src/10.4/sql/sql_parse.cc:1378
      #31 0x000055938db3a7c4 in do_handle_one_connection (connect=connect@entry=0x5593908aa0e8) at /data/src/10.4/sql/sql_connect.cc:1420
      #32 0x000055938db3a914 in handle_one_connection (arg=arg@entry=0x5593908aa0e8) at /data/src/10.4/sql/sql_connect.cc:1324
      #33 0x000055938de5a5c0 in pfs_spawn_thread (arg=0x559390802298) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #34 0x00007f5266aa7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #35 0x00007f5266b285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      10.4 debug 7d89dcf1

      mysqld: /data/src/10.4/sql/sql_select.cc:4324: bool JOIN::save_explain_data(Explain_query*, bool, bool, bool, bool): Assertion `select_lex->select_number == (0x7fffffff * 2U + 1U) || select_lex->select_number == 0x7fffffff || !output || !output->get_select(select_lex->select_number) || output->get_select(select_lex->select_number)->select_lex == select_lex' failed.
      231021 17:01:44 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007fa494f74df2 in __GI___assert_fail (assertion=0x558685a13560 "select_lex->select_number == (0x7fffffff * 2U + 1U) || select_lex->select_number == 0x7fffffff || !output || !output->get_select(select_lex->select_number) || output->get_select(select_lex->select_num"..., file=0x558685a10800 "/data/src/10.4/sql/sql_select.cc", line=4324, function=0x558685a13680 "bool JOIN::save_explain_data(Explain_query*, bool, bool, bool, bool)") at ./assert/assert.c:101
      #10 0x00005586839e96c1 in JOIN::save_explain_data (this=0x62900024b880, output=0x62b000066880, can_overwrite=false, need_tmp_table=false, need_order=false, distinct=false) at /data/src/10.4/sql/sql_select.cc:4324
      #11 0x00005586839cc927 in JOIN::build_explain (this=0x62900024b880) at /data/src/10.4/sql/sql_select.cc:1660
      #12 0x00005586839cd2d8 in JOIN::optimize (this=0x62900024b880) at /data/src/10.4/sql/sql_select.cc:1717
      #13 0x00005586838aa838 in st_select_lex::optimize_unflattened_subqueries (this=0x62b000062340, const_only=false) at /data/src/10.4/sql/sql_lex.cc:4232
      #14 0x0000558683e08acb in JOIN::optimize_unflattened_subqueries (this=0x62b000066308) at /data/src/10.4/sql/opt_subselect.cc:5610
      #15 0x00005586839da616 in JOIN::optimize_stage2 (this=0x62b000066308) at /data/src/10.4/sql/sql_select.cc:2942
      #16 0x00005586839d458b in JOIN::optimize_inner (this=0x62b000066308) at /data/src/10.4/sql/sql_select.cc:2394
      #17 0x00005586839cd229 in JOIN::optimize (this=0x62b000066308) at /data/src/10.4/sql/sql_select.cc:1711
      #18 0x00005586839ee0f5 in mysql_select (thd=0x62b00005b208, tables=0x62b0000629a8, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x62b0000631f0, having=0x62b000065818, proc_param=0x0, select_options=2147748608, result=0x62b0000662d8, unit=0x62b00005f140, select_lex=0x62b000062340) at /data/src/10.4/sql/sql_select.cc:4812
      #19 0x00005586839bee4b in handle_select (thd=0x62b00005b208, lex=0x62b00005f080, result=0x62b0000662d8, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:442
      #20 0x000055868392e36d in execute_sqlcom_select (thd=0x62b00005b208, all_tables=0x62b0000629a8) at /data/src/10.4/sql/sql_parse.cc:6475
      #21 0x000055868391b882 in mysql_execute_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:3978
      #22 0x00005586839375bd in mysql_parse (thd=0x62b00005b208, rawbuf=0x62b000062228 "SELECT a FROM t1 GROUP BY a HAVING (a = '' OR a = 0) AND a = (SELECT MIN(f) FROM t2)", length=84, parser_state=0x7fa48d1ca860, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8012
      #23 0x000055868390d84c in dispatch_command (command=COM_QUERY, thd=0x62b00005b208, packet=0x629000230209 "SELECT a FROM t1 GROUP BY a HAVING (a = '' OR a = 0) AND a = (SELECT MIN(f) FROM t2)", packet_length=84, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #24 0x000055868390a3bb in do_command (thd=0x62b00005b208) at /data/src/10.4/sql/sql_parse.cc:1378
      #25 0x0000558683d09ee2 in do_handle_one_connection (connect=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1420
      #26 0x0000558683d097f9 in handle_one_connection (arg=0x6080000009a8) at /data/src/10.4/sql/sql_connect.cc:1324
      #27 0x000055868497b54a in pfs_spawn_thread (arg=0x615000003508) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #28 0x00007fa494fc8fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #29 0x00007fa4950495bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.