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

LP:803410 - Crash in store_key::store_key with semijoin + view + union (WL#106)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Repeatable in maria-5.3, maria-5.3-subqueries-mwl90. Not repeatable in maria-5.3 before WL#106. Explain also crashes.

      Backtrace:

      #3 <signal handler called>
      #4 0x0000000000756aa4 in store_key::store_key (this=0x2aa75e0, thd=0x297d098, field_arg=0x3179656b, ptr=0x2aa742c "", null=0x2aa7600 "", length=0)
      at sql_select.h:1227
      #5 0x0000000000756e63 in store_key_field::store_key_field (this=0x2aa75e0, thd=0x297d098, to_field_arg=0x3179656b, ptr=0x2aa742c "", null_ptr_arg=0x0,
      length=0, from_field=0x2a3bcb0, name_arg=0x2aa75d0 "test.t3.f2") at sql_select.h:1290
      #6 0x000000000072d2ea in get_store_key (thd=0x297d098, keyuse=0x2aa8fb8, used_tables=1, key_part=0x2aa48a8, key_buff=0x2aa742c "", maybe_null=0)
      at sql_select.cc:7368
      #7 0x000000000073db30 in create_ref_for_key (join=0x2a891f0, j=0x2aa7110, org_keyuse=0x2aa8f68, used_tables=4611686018427387911) at sql_select.cc:7297
      #8 0x0000000000745f80 in get_best_combination (join=0x2a891f0) at sql_select.cc:7063
      #9 0x0000000000748103 in make_join_statistics (join=0x2a891f0, tables_list=..., conds=0x2a42b88, keyuse_array=0x2a8f1a0) at sql_select.cc:3511
      #10 0x000000000074a49e in JOIN::optimize (this=0x2a891f0) at sql_select.cc:1101
      #11 0x000000000074dfbd in mysql_select (thd=0x297d098, rref_pointer_array=0x297fc18, tables=0x2a02eb0, wild_num=1, fields=..., conds=0x2a3f048, og_num=0,
      order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x2a40df8, unit=0x297f510, select_lex=0x297f9f8)
      at sql_select.cc:2872
      #12 0x000000000075443c in handle_select (thd=0x297d098, lex=0x297f470, result=0x2a40df8, setup_tables_done_option=0) at sql_select.cc:283
      #13 0x00000000006a1744 in execute_sqlcom_select (thd=0x297d098, all_tables=0x2a02eb0) at sql_parse.cc:5082
      #14 0x00000000006a33f7 in mysql_execute_command (thd=0x297d098) at sql_parse.cc:2227
      #15 0x00000000006ac18f in mysql_parse (thd=0x297d098,
      rawbuf=0x2a02c40 "SELECT *\nFROM t2 , t3\nWHERE t3.f2 = t2.f2\nAND ( t3.f2 , t3.f2 ) IN ( SELECT * FROM v1 )", length=88, found_semicolon=0x426ebf08)
      at sql_parse.cc:6083
      #16 0x00000000006ad027 in dispatch_command (command=COM_QUERY, thd=0x297d098,
      packet=0x29f98c9 "SELECT *\nFROM t2 , t3\nWHERE t3.f2 = t2.f2\nAND ( t3.f2 , t3.f2 ) IN ( SELECT * FROM v1 )", packet_length=88) at sql_parse.cc:1206
      #17 0x00000000006ae635 in do_command (thd=0x297d098) at sql_parse.cc:904
      #18 0x00000000006990eb in handle_one_connection (arg=0x297d098) at sql_connect.cc:1178
      #19 0x00000033b600673d in start_thread () from /lib64/libpthread.so.0
      #20 0x00000033b58d40cd in clone () from /lib64/libc.so.6

      minimal optimizer switch required: semijoin=on

      full optimizer switch in effect: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=off,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=off,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on

      test case:

      CREATE TABLE t1 ( f1 int, f2 varchar(1)) ;
      INSERT INTO t1 VALUES (9,NULL),(6,'r');

      CREATE TABLE t2 ( f2 varchar(1) );
      INSERT INTO t2 VALUES ('x');

      CREATE TABLE t3 ( f2 varchar(1) , KEY (f2) ) ;
      INSERT INTO t3 VALUES (NULL),('r');

      CREATE VIEW v1 AS SELECT 'e', 'c' UNION SELECT 'c' , 'r' ;

      SELECT *
      FROM t2 , t3
      WHERE t3.f2 = t2.f2
      AND ( t3.f2 , t3.f2 ) IN ( SELECT * FROM v1 );

      bzr version-info

      revision-id: <email address hidden>
      date: 2011-06-28 19:56:30 -0700
      build-date: 2011-06-29 14:29:37 +0300
      revno: 3068
      branch-nick: maria-5.3

      Attachments

        Activity

          People

            igor Igor Babaev
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.