Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.8(EOL) , 10.9(EOL) , 10.10(EOL) , 10.11 , 11.0(EOL)
Note: If MDEV-31206 is fixed first and the queries become faster, the test case below may no longer do what it is meant to do (the query will end before max_statement_time exceeds); but it's just the matter of the size and the timeout, adjust accordingly if it happens.
SET max_recursive_iterations = 100000;
drop table if exists t;
create table t as with recursive cte as ( select 1 as a union select a + 1 as a from cte where a < 30000) select * from cte;
set max_statement_time= 2;
set @start= @@ timestamp ;
select max (a) over( ) from t;
select @@ timestamp - @start;
drop table t;
So, without the timeout, currently the query takes ~30 seconds on a release build (and much longer on a debug build).
The test case sets the timeout to 2 seconds, the expected outcome is that the query fails with ER_STATEMENT_TIMEOUT after ~2 seconds.
Instead, it does fail with ER_STATEMENT_TIMEOUT and does not return the result set, but only after the whole execution time, i.e. 30 seconds.
11.0.1 release
MariaDB [test]> set max_statement_time= 2;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]>
MariaDB [test]> set @start= @@ timestamp ;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]> select max (a) over( ) from t;
ERROR 1969 (70100): Query execution was interrupted (max_statement_time exceeded)
MariaDB [test]> select @@ timestamp - @start;
+ ----------------------+
| @@ timestamp - @start |
+ ----------------------+
| 31.26440405845642 |
+ ----------------------+
1 row in set (0.000 sec)
Same happens with direct KILL [QUERY] , whenever it is killed during execution, the query remains in the Killed state approx. its usual execution time, and then fails with ER_QUERY_INTERRUPTED.
MariaDB [test]> show processlist;
+ ----+------+-----------------+------+---------+------+--------------+------------------------------+----------+
| Id | User | Host | db | Command | Time | State | Info | Progress |
+ ----+------+-----------------+------+---------+------+--------------+------------------------------+----------+
| 17 | root | localhost:59258 | test | Killed | 22 | Sending data | select max (a) over( ) from t | 0.000 |
| 18 | root | localhost:40164 | test | Query | 0 | starting | show processlist | 0.000 |
+ ----+------+-----------------+------+---------+------+--------------+------------------------------+----------+
{"report":{"fcp":617.2000000476837,"ttfb":138.40000009536743,"pageVisibility":"visible","entityId":121689,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"1783aa51-180e-4db9-b30f-2568fd31783f","navigationType":0,"readyForUser":733.5,"redirectCount":0,"resourceLoadedEnd":600.6000001430511,"resourceLoadedStart":143.79999995231628,"resourceTiming":[{"duration":13.100000143051147,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":143.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":143.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":156.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":13.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":144,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":144,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":157.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":68,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":144.10000014305115,"connectEnd":144.10000014305115,"connectStart":144.10000014305115,"domainLookupEnd":144.10000014305115,"domainLookupStart":144.10000014305115,"fetchStart":144.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":144.10000014305115,"responseEnd":212.10000014305115,"responseStart":212.10000014305115,"secureConnectionStart":144.10000014305115},{"duration":119,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":144.20000004768372,"connectEnd":144.20000004768372,"connectStart":144.20000004768372,"domainLookupEnd":144.20000004768372,"domainLookupStart":144.20000004768372,"fetchStart":144.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":144.20000004768372,"responseEnd":263.2000000476837,"responseStart":263.2000000476837,"secureConnectionStart":144.20000004768372},{"duration":122.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":144.29999995231628,"connectEnd":144.29999995231628,"connectStart":144.29999995231628,"domainLookupEnd":144.29999995231628,"domainLookupStart":144.29999995231628,"fetchStart":144.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":144.29999995231628,"responseEnd":266.90000009536743,"responseStart":266.90000009536743,"secureConnectionStart":144.29999995231628},{"duration":123.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":144.29999995231628,"connectEnd":144.29999995231628,"connectStart":144.29999995231628,"domainLookupEnd":144.29999995231628,"domainLookupStart":144.29999995231628,"fetchStart":144.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":144.29999995231628,"responseEnd":267.40000009536743,"responseStart":267.40000009536743,"secureConnectionStart":144.29999995231628},{"duration":123.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":144.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":144.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":268.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":123.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":144.5,"connectEnd":144.5,"connectStart":144.5,"domainLookupEnd":144.5,"domainLookupStart":144.5,"fetchStart":144.5,"redirectEnd":0,"redirectStart":0,"requestStart":144.5,"responseEnd":267.7000000476837,"responseStart":267.7000000476837,"secureConnectionStart":144.5},{"duration":123.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":144.60000014305115,"connectEnd":144.60000014305115,"connectStart":144.60000014305115,"domainLookupEnd":144.60000014305115,"domainLookupStart":144.60000014305115,"fetchStart":144.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":144.60000014305115,"responseEnd":268.2999999523163,"responseStart":268.2000000476837,"secureConnectionStart":144.60000014305115},{"duration":123.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":144.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":144.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":268.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":124,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":144.90000009536743,"connectEnd":144.90000009536743,"connectStart":144.90000009536743,"domainLookupEnd":144.90000009536743,"domainLookupStart":144.90000009536743,"fetchStart":144.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":144.90000009536743,"responseEnd":268.90000009536743,"responseStart":268.90000009536743,"secureConnectionStart":144.90000009536743},{"duration":434.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":145.5,"connectEnd":145.5,"connectStart":145.5,"domainLookupEnd":145.5,"domainLookupStart":145.5,"fetchStart":145.5,"redirectEnd":0,"redirectStart":0,"requestStart":145.5,"responseEnd":579.9000000953674,"responseStart":579.9000000953674,"secureConnectionStart":145.5},{"duration":450.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":149.79999995231628,"connectEnd":149.79999995231628,"connectStart":149.79999995231628,"domainLookupEnd":149.79999995231628,"domainLookupStart":149.79999995231628,"fetchStart":149.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":149.79999995231628,"responseEnd":600.6000001430511,"responseStart":600.6000001430511,"secureConnectionStart":149.79999995231628},{"duration":173.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":424.40000009536743,"connectEnd":424.40000009536743,"connectStart":424.40000009536743,"domainLookupEnd":424.40000009536743,"domainLookupStart":424.40000009536743,"fetchStart":424.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":424.40000009536743,"responseEnd":598.1000001430511,"responseStart":598.1000001430511,"secureConnectionStart":424.40000009536743},{"duration":13.799999952316284,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":596.6000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":596.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":610.4000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":16,"responseStart":139,"responseEnd":143,"domLoading":142,"domInteractive":794,"domContentLoadedEventStart":794,"domContentLoadedEventEnd":831,"domComplete":1707,"loadEventStart":1707,"loadEventEnd":1709,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":776.1000001430511},{"name":"bigPipe.sidebar-id.end","time":776.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":776.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":779.2000000476837},{"name":"activityTabFullyLoaded","time":840.9000000953674}],"measures":[],"correlationId":"f1c140b202f6d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":66,"dbReadsTimeInMs":10,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}