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

show_analyze sporadically fails at line 226: query 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED

Details

    Description

      CURRENT_TEST: main.show_analyze
      mysqltest: At line 226: query 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED (1317)...
       
      The result from queries just before the failure was:
      < snip >
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	r_rows	filtered	r_filtered	Extra
      1	PRIMARY	a	ALL	NULL	NULL	NULL	NULL	10	10.00	100.00	20.00	Using where
      2	DEPENDENT SUBQUERY	b	ALL	NULL	NULL	NULL	NULL	10	10.00	100.00	95.00	Using where
      Warnings:
      Note	1003	analyze select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<2
      connection con1;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	r_rows	filtered	r_filtered	Extra
      1	PRIMARY	a	ALL	NULL	NULL	NULL	NULL	10	10.00	100.00	20.00	Using where
      2	DEPENDENT SUBQUERY	b	ALL	NULL	NULL	NULL	NULL	10	10.00	100.00	95.00	Using where
      SET debug_dbug=@old_debug;
      # Try to do SHOW ANALYZE for a query that runs a  SET command:
      #
      set @show_explain_probe_select_id=2;
      SET debug_dbug='+d,show_explain_probe_join_exec_start';
      set @foo= (select max(a) from t0 where sin(a) >0);
      connection default;
      show analyze for $thr2;
      ERROR HY000: Target is not executing an operation with a query plan
      kill query $thr2;
      connection con1;
      

      The portion of the test that is failing:

      --echo # Try to do SHOW ANALYZE for a query that runs a  SET command:
      --echo #
      set @show_explain_probe_select_id=2; # <---
      SET debug_dbug='+d,show_explain_probe_join_exec_start';
      send set @foo= (select max(a) from t0 where sin(a) >0);
      connection default;
      --source include/wait_condition.inc
      --error ER_TARGET_NOT_EXPLAINABLE
      evalp show analyze for $thr2;
      evalp kill query $thr2;
      connection con1;
      --error ER_QUERY_INTERRUPTED
      reap;
      SET debug_dbug=@old_debug;
      

      Attachments

        Issue Links

          Activity

            psergei Sergei Petrunia created issue -
            psergei Sergei Petrunia made changes -
            Field Original Value New Value
            Description {code}
            CURRENT_TEST: main.show_analyze
            mysqltest: At line 226: query 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED (1317)...

            The result from queries just before the failure was:
            < snip >
            id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
            1 PRIMARY a ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
            2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 10.00 100.00 95.00 Using where
            Warnings:
            Note 1003 analyze select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<2
            connection con1;
            id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
            1 PRIMARY a ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
            2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 10.00 100.00 95.00 Using where
            SET debug_dbug=@old_debug;
            # Try to do SHOW ANALYZE for a query that runs a SET command:
            #
            set @show_explain_probe_select_id=2;
            SET debug_dbug='+d,show_explain_probe_join_exec_start';
            set @foo= (select max(a) from t0 where sin(a) >0);
            connection default;
            show analyze for $thr2;
            ERROR HY000: Target is not executing an operation with a query plan
            kill query $thr2;
            connection con1;
            {code}
            {code}
            CURRENT_TEST: main.show_analyze
            mysqltest: At line 226: query 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED (1317)...

            The result from queries just before the failure was:
            < snip >
            id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
            1 PRIMARY a ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
            2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 10.00 100.00 95.00 Using where
            Warnings:
            Note 1003 analyze select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<2
            connection con1;
            id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
            1 PRIMARY a ALL NULL NULL NULL NULL 10 10.00 100.00 20.00 Using where
            2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 10.00 100.00 95.00 Using where
            SET debug_dbug=@old_debug;
            # Try to do SHOW ANALYZE for a query that runs a SET command:
            #
            set @show_explain_probe_select_id=2;
            SET debug_dbug='+d,show_explain_probe_join_exec_start';
            set @foo= (select max(a) from t0 where sin(a) >0);
            connection default;
            show analyze for $thr2;
            ERROR HY000: Target is not executing an operation with a query plan
            kill query $thr2;
            connection con1;
            {code}

            The portion of the test that is failing:
            {code:sql}
            --echo # Try to do SHOW ANALYZE for a query that runs a SET command:
            --echo #
            set @show_explain_probe_select_id=2; # <---
            SET debug_dbug='+d,show_explain_probe_join_exec_start';
            send set @foo= (select max(a) from t0 where sin(a) >0);
            connection default;
            --source include/wait_condition.inc
            --error ER_TARGET_NOT_EXPLAINABLE
            evalp show analyze for $thr2;
            evalp kill query $thr2;
            connection con1;
            --error ER_QUERY_INTERRUPTED
            reap;
            SET debug_dbug=@old_debug;
            {code}

            How it executes:
            connection con1 submits a query: set @foo= (select max(a) from t0 where sin(a) >0);
            It starts executing and gets stuck at show_explain_probe_join_exec_start where it waits for an async call.
            connection default runs: show analyze for $thr2; This returns ER_TARGET_NOT_EXPLAINABLE.
            This unblocks the {{set @foo= ...} query.
            In failing scenario, the {{set @foo=.. } query continues and finishes execution.
            In success scenario, it proceeds slowly
            connection default runs: kill query $thr2;
            In success scenario, it finds and kills the set @foo.. query. The query returns ER_QUERY_INTERRUPTED
            In failing scenario, the set @foo... query has already finished. It returns OK and we get the error: 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED

            psergei Sergei Petrunia added a comment - How it executes: connection con1 submits a query: set @foo= (select max(a) from t0 where sin(a) >0); It starts executing and gets stuck at show_explain_probe_join_exec_start where it waits for an async call. connection default runs: show analyze for $thr2; This returns ER_TARGET_NOT_EXPLAINABLE. This unblocks the {{set @foo= ...} query. In failing scenario, the {{set @foo=.. } query continues and finishes execution. In success scenario, it proceeds slowly connection default runs: kill query $thr2; In success scenario, it finds and kills the set @foo.. query. The query returns ER_QUERY_INTERRUPTED In failing scenario, the set @foo... query has already finished. It returns OK and we get the error: 'reap' succeeded - should have failed with error ER_QUERY_INTERRUPTED
            psergei Sergei Petrunia made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            psergei Sergei Petrunia made changes -
            Assignee Sergei Petrunia [ psergey ] Dave Gosselin [ JIRAUSER52216 ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            Gosselin Dave Gosselin made changes -
            Assignee Dave Gosselin [ JIRAUSER52216 ] Sergei Petrunia [ psergey ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            psergei Sergei Petrunia made changes -
            Fix Version/s 11.3.2 [ 29522 ]
            Fix Version/s 11.4.1 [ 29523 ]
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 11.0.6 [ 29628 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 11.3.3 [ 29632 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.4.2 [ 29633 ]
            Fix Version/s 11.4.1 [ 29523 ]
            Fix Version/s 11.3.3 [ 29632 ]
            psergei Sergei Petrunia made changes -

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              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.