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

too small max_statement_time is ignored

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 10.6.7
    • Fix Version/s: N/A
    • Component/s: Server
    • Labels:
      None

      Description

      modified func_json_notembedded test

      $ mysql-test/mtr main.func_json_notembedded
      Logging: /home/dan/repos/mariadb-server-10.6/mysql-test/mariadb-test-run.pl  main.func_json_notembedded
      VS config: 
      vardir: /home/dan/repos/build-mariadb-server-10.6/mysql-test/var
      Checking leftover processes...
      Removing old var directory...
      Creating var directory '/home/dan/repos/build-mariadb-server-10.6/mysql-test/var'...
      Checking supported features...
      MariaDB Version 10.6.8-MariaDB
       - SSL connections supported
       - binaries built with wsrep patch
      Collecting tests...
      Installing system database...
       
      ==============================================================================
       
      TEST                                      RESULT   TIME (ms) or COMMENT
      --------------------------------------------------------------------------
       
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      main.func_json_notembedded               [ fail ]
              Test ended at 2022-04-07 13:52:38
       
      CURRENT_TEST: main.func_json_notembedded
      mysqltest: At line 38: query 'select json_merge_patch(@obj, @obj)' failed with wrong errno <Unknown> (2013): 'Lost connection to server during query', instead of ER_STATEMENT_TIMEOUT (1969)...
       
      The result from queries just before the failure was:
      < snip >
      select sleep(t);
      execute immediate 'kill connection ?' using c;
      end|
      connection default;
      set @timeout= 20;
      call kill_soon(@timeout, THE_OTHER_CONNECTION);;
      connection u;
      #
      # MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
      #
      set group_concat_max_len= 4294967295;
      set @obj=concat_ws('','{', repeat('"a":"b",', 125000), '"c":"d"}');
      set @arr=concat_ws('','[', repeat('1234567,', 125000), '2345678]');
      select length(@obj), length(@arr);
      length(@obj)	length(@arr)
      1000009	1000009
      set max_statement_time=0.0001;
      set max_statement_time=0.0000001;
      select json_merge_patch(@obj, @obj);
       
      The servers were restarted 0 times
      Spent 0.000 of 36 seconds executing testcases
      

      The 36 second case was only limited by the 20 second kill from the other thread.

      source include/have_profiling.inc;
      source include/not_embedded.inc;
       
      set global max_allowed_packet=1073741824;
      connect u,localhost,root;
       
      delimiter |;
       
      create procedure kill_soon(IN t INT, IN C INT)
      begin
        select sleep(t);
        execute immediate 'kill connection ?' using c;
      end|
       
      delimiter ;|
       
      --let $con=`SELECT CONNECTION_ID()`
       
      connection default;
      set @timeout= 20;
      --replace_result $con THE_OTHER_CONNECTION
      --send_eval call kill_soon(@timeout, $con);
       
      connection u;
       
      --echo #
      --echo # MDEV-24909 JSON functions don't respect KILL QUERY / max_statement_time limit
      --echo #
      set group_concat_max_len= 4294967295;
       
      set @obj=concat_ws('','{', repeat('"a":"b",', 125000), '"c":"d"}');
      set @arr=concat_ws('','[', repeat('1234567,', 125000), '2345678]');
      select length(@obj), length(@arr);
       
      set max_statement_time=0.0001;
      set max_statement_time=0.0000001;
      --error ER_STATEMENT_TIMEOUT
      select json_merge_patch(@obj, @obj);
      enable_abort_on_error;
      disconnect u;
      connection default;
      --replace_result $con THE_OTHER_CONNECTION
      --error ER_NO_SUCH_THREAD
      reap;
       
      drop procedure kill_soon;
      set global max_allowed_packet=default;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              danblack Daniel Black
              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.