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

Server crashes in Item_ref::fix_fields on 2nd execution of PS with LEFT JOIN and MERGE view or SELECT SQ

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.4, 5.3.12, 5.5.33a
    • 5.5.34, 10.0.6, 5.3.13
    • None
    • None

    Description

      #3  <signal handler called>
      #4  0x000000000058d2cb in Item_ref::fix_fields (this=0x7f99a40b0d30, thd=0x3261858, reference=0x7f99a40b0fa0) at item.cc:6507
      #5  0x00000000005af144 in Item_func::fix_fields (this=0x7f99a40b0f10, thd=0x3261858, ref=0x7f99a40b14e8) at item_func.cc:180
      #6  0x00000000005d70aa in Item_cond::fix_fields (this=0x7f99a40b13d0, thd=0x3261858, ref=0x0) at item_cmpfunc.cc:4242
      #7  0x00000000006169bc in Item_in_subselect::create_row_in_to_exists_cond (this=0x7f99a4042178, join=0x7f99a40057f0, where_item=0x7f99a4005c90, having_item=0x7f99a4005c98) at item_subselect.cc:2287
      #8  0x0000000000616c36 in Item_in_subselect::create_in_to_exists_cond (this=0x7f99a4042178, join_arg=0x7f99a40057f0) at item_subselect.cc:2343
      #9  0x00000000007fe2eb in JOIN::choose_subquery_plan (this=0x7f99a40057f0, join_tables=1) at opt_subselect.cc:5302
      #10 0x0000000000712d0f in make_join_statistics (join=0x7f99a40057f0, tables_list=..., conds=0x0, keyuse_array=0x7f99a4005ac8) at sql_select.cc:3686
      #11 0x0000000000709bbb in JOIN::optimize (this=0x7f99a40057f0) at sql_select.cc:1158
      #12 0x0000000000565567 in st_select_lex::optimize_unflattened_subqueries (this=0x7f99a403ace0) at sql_lex.cc:3164
      #13 0x00000000007fd365 in JOIN::optimize_unflattened_subqueries (this=0x7f99a4005190) at opt_subselect.cc:4899
      #14 0x000000000070b4c1 in JOIN::optimize (this=0x7f99a4005190) at sql_select.cc:1568
      #15 0x00000000007106a9 in mysql_select (thd=0x3261858, rref_pointer_array=0x7f99a403af38, tables=0x7f99a403ba38, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2416200192, result=0x7f99a403c6a8, unit=0x7f99a403a7d8, select_lex=0x7f99a403ace0) at sql_select.cc:2986
      #16 0x000000000070714d in handle_select (thd=0x3261858, lex=0x7f99a403a738, result=0x7f99a403c6a8, setup_tables_done_option=0) at sql_select.cc:288
      #17 0x0000000000693312 in execute_sqlcom_select (thd=0x3261858, all_tables=0x7f99a403ba38) at sql_parse.cc:5172
      #18 0x000000000068a0da in mysql_execute_command (thd=0x3261858) at sql_parse.cc:2305
      #19 0x0000000000767843 in Prepared_statement::execute (this=0x7f99a40375b8, expanded_query=0x7f99b0546c20, open_cursor=false) at sql_prepare.cc:3758
      #20 0x0000000000766a3b in Prepared_statement::execute_loop (this=0x7f99a40375b8, expanded_query=0x7f99b0546c20, open_cursor=false, packet=0x0, packet_end=0x0) at sql_prepare.cc:3439
      #21 0x0000000000764e73 in mysql_sql_stmt_execute (thd=0x3261858) at sql_prepare.cc:2664
      #22 0x000000000068a10b in mysql_execute_command (thd=0x3261858) at sql_parse.cc:2314
      #23 0x0000000000695d9c in mysql_parse (thd=0x3261858, rawbuf=0x7f99a4004b00 "EXECUTE stmt", length=12, found_semicolon=0x7f99b05477e0) at sql_parse.cc:6173
      #24 0x00000000006877f7 in dispatch_command (command=COM_QUERY, thd=0x3261858, packet=0x32dbba9 "EXECUTE stmt", packet_length=12) at sql_parse.cc:1243
      #25 0x0000000000686a68 in do_command (thd=0x3261858) at sql_parse.cc:923
      #26 0x0000000000683902 in handle_one_connection (arg=0x3261858) at sql_connect.cc:1231
      #27 0x00007f99bf1e3e9a in start_thread (arg=0x7f99b0548700) at pthread_create.c:308
      #28 0x00007f99be70ccbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: igor@askmonty.org-20131012062457-xvp1ecvw97zwklc4
      revno: 3704
      branch-nick: 5.3
      BUILD/compile-pentium-debug-max-no-ndb

      CREATE TABLE t1 (i1 INT, c1 VARCHAR(6)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
       
      CREATE TABLE t2 (c2 VARCHAR(6)) ENGINE=MyISAM;
      INSERT INTO t2 VALUES ('foobar'),('qux');
       
      CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1 WHERE ( c1, c1 ) IN ( SELECT c2, c2 FROM t2 ) AND i1 <= 2 ;
       
      PREPARE stmt FROM 'SELECT * FROM t1 LEFT JOIN v1 ON (v1.i1 = t1.i1)';
       
      EXECUTE stmt;
      EXECUTE stmt;

      Also reproducible with a subquery instead of the view (in this case derived_merge=on is required).

      Attachments

        Activity

          People

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