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

Server crashes in create_tmp_table / JOIN::create_postjoin_aggr_table

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Cannot Reproduce
    • 10.2
    • N/A
    • Optimizer
    • None

    Description

      Note: I have no idea what it has to do with virtual columns, but I'm linking them because the crash started happening with this revision:

      commit a411d7f4f670c24b43b50f7d2a1129e10218f4a7
      Author: Sergei Golubchik <serg@mariadb.org>
      Date:   Mon Nov 7 17:17:40 2016 +0100
       
          store/show vcols as item->print()
          
          otherwise we'd need to store sql_mode *per vcol*
          (consider CREATE INDEX...) and how SHOW CREATE TABLE would
          support that?
          
          Additionally, get rid of vcol::expr_str, just to make sure
          the string is always generated and never leaked in the
          original form.
      

      I also don't know why everything in this test case is needed – additional connections, bogus ENABLE KEYS, the query from I_S – but I couldn't remove anything else.

      --connect (con1,localhost,root,,mysql)
      --connect (con2,localhost,root,,test)
       
      CREATE TABLE t1 (
        i int,
        f float,
        c1 char(255),
        c2 char(255),
        v varchar(64)
      );
       
      INSERT INTO t1 VALUES 
      (1, 1.0, REPEAT('a',255), REPEAT('x',255), NULL) ,  
      (2, 2.0, REPEAT('b',255), REPEAT('z',255), NULL) ;
      ALTER TABLE t1 ENABLE KEYS;
      SELECT COUNT(*) FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
      SELECT DISTINCT DEFAULT(i) FROM t1 GROUP BY @a := f WITH ROLLUP;
      

      10.2 8938031bc7eb78d406553465341338038cfb2e1a

      #3  <signal handler called>
      #4  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:166
      #5  0x00007f6d6e50a257 in create_tmp_table (thd=<optimized out>, param=0x7f6d63c675d0, fields=..., group=group@entry=0x0, distinct=<optimized out>, distinct@entry=false, save_sum_fields=<optimized out>, save_sum_fields@entry=true, select_options=2147748609, rows_limit=18446744073709551615, table_alias=<optimized out>, do_not_open=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:16701
      #6  0x00007f6d6e5166e6 in JOIN::create_postjoin_aggr_table (this=this@entry=0x7f6d63c650c0, tab=tab@entry=0x7f6d63c66a90, table_fields=table_fields@entry=0x7f6d63c653e8, table_group=table_group@entry=0x0, save_sum_fields=save_sum_fields@entry=true, distinct=distinct@entry=false, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2760
      #7  0x00007f6d6e517b7b in JOIN::make_aggr_tables_info (this=this@entry=0x7f6d63c650c0) at /data/src/10.2/sql/sql_select.cc:2447
      #8  0x00007f6d6e524c67 in JOIN::optimize_inner (this=this@entry=0x7f6d63c650c0) at /data/src/10.2/sql/sql_select.cc:2118
      #9  0x00007f6d6e52522f in JOIN::optimize (this=this@entry=0x7f6d63c650c0) at /data/src/10.2/sql/sql_select.cc:1076
      #10 0x00007f6d6e525bd5 in mysql_select (thd=thd@entry=0x7f6d63c16070, tables=0x7f6d63c643e0, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f6d63c64f80, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7f6d63c650a0, unit=0x7f6d63c19b48, select_lex=0x7f6d63c1a278) at /data/src/10.2/sql/sql_select.cc:3570
      #11 0x00007f6d6e525e8d in handle_select (thd=thd@entry=0x7f6d63c16070, lex=lex@entry=0x7f6d63c19a80, result=result@entry=0x7f6d63c650a0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.2/sql/sql_select.cc:373
      #12 0x00007f6d6e4b6849 in execute_sqlcom_select (thd=thd@entry=0x7f6d63c16070, all_tables=0x7f6d63c643e0) at /data/src/10.2/sql/sql_parse.cc:6347
      #13 0x00007f6d6e4bf6d2 in mysql_execute_command (thd=thd@entry=0x7f6d63c16070) at /data/src/10.2/sql/sql_parse.cc:3370
      #14 0x00007f6d6e4c92d2 in mysql_parse (thd=thd@entry=0x7f6d63c16070, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f6d6f4378e0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:7790
      #15 0x00007f6d6e4cb55b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f6d63c16070, packet=packet@entry=0x7f6d63c58071 "SELECT DISTINCT DEFAULT(i) FROM t1 GROUP BY @a := f WITH ROLLUP", packet_length=packet_length@entry=63, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1799
      #16 0x00007f6d6e4ce08d in do_command (thd=0x7f6d63c16070) at /data/src/10.2/sql/sql_parse.cc:1359
      #17 0x00007f6d6e5bbf4a in do_handle_one_connection (connect=connect@entry=0x7f6d6b8716b0) at /data/src/10.2/sql/sql_connect.cc:1354
      #18 0x00007f6d6e5bc133 in handle_one_connection (arg=arg@entry=0x7f6d6b8716b0) at /data/src/10.2/sql/sql_connect.cc:1260
      #19 0x00007f6d6e86a07d in pfs_spawn_thread (arg=0x7f6d6b815df0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #20 0x00007f6d6dbbd0a4 in start_thread (arg=0x7f6d6f439300) at pthread_create.c:309
      #21 0x00007f6d6c3dd87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Attachments

        Issue Links

          Activity

            People

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