Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.8(EOL)
Take a statement doing long GIS computation (it takes minutes):
SELECT
st_buffer(st_buffer(ST_GEOMFROMTEXT( 'POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))' ),1),
(st_length(multilinestringfromtext( ' MULTILINESTRING( ( 2 2, 2 8, 8 8, 8 2, 2 2 ), ( 4 4, 4 6, 6 6, 6 4, 4 4 ) ) ' )) ));
and try to run SHOW EXPLAIN (or SHOW ANALYZE) on it. The result will be:
MariaDB [test]> show analyze format=json for 398;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
Note that KILL or KILL QUERY are able to kill the statement.
relates to
MDEV-27021
Extend SHOW EXPLAIN to support SHOW ANALYZE [FORMAT=JSON]
Closed
{"report":{"fcp":1724.3000001907349,"ttfb":518.3000001907349,"pageVisibility":"visible","entityId":109942,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2d51bccd-045f-4593-bf58-1cb87ac0d117","navigationType":0,"readyForUser":1822.9000000953674,"redirectCount":0,"resourceLoadedEnd":1668.2000002861023,"resourceLoadedStart":537.5999999046326,"resourceTiming":[{"duration":468.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":537.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":537.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1006.5,"responseStart":0,"secureConnectionStart":0},{"duration":468.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":537.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":537.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1006.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":660.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":538.2000002861023,"connectEnd":538.2000002861023,"connectStart":538.2000002861023,"domainLookupEnd":538.2000002861023,"domainLookupStart":538.2000002861023,"fetchStart":538.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1009.3000001907349,"responseEnd":1198.8000001907349,"responseStart":1041.0999999046326,"secureConnectionStart":538.2000002861023},{"duration":866.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":538.8000001907349,"connectEnd":538.8000001907349,"connectStart":538.8000001907349,"domainLookupEnd":538.8000001907349,"domainLookupStart":538.8000001907349,"fetchStart":538.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1008.8000001907349,"responseEnd":1405.0999999046326,"responseStart":1034.2000002861023,"secureConnectionStart":538.8000001907349},{"duration":505.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":539,"connectEnd":539,"connectStart":539,"domainLookupEnd":539,"domainLookupStart":539,"fetchStart":539,"redirectEnd":0,"redirectStart":0,"requestStart":1009.5,"responseEnd":1044.8000001907349,"responseStart":1042.2000002861023,"secureConnectionStart":539},{"duration":505.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":539.0999999046326,"connectEnd":539.0999999046326,"connectStart":539.0999999046326,"domainLookupEnd":539.0999999046326,"domainLookupStart":539.0999999046326,"fetchStart":539.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1014.3000001907349,"responseEnd":1045,"responseStart":1043.7000002861023,"secureConnectionStart":539.0999999046326},{"duration":505.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":539.4000000953674,"connectEnd":539.4000000953674,"connectStart":539.4000000953674,"domainLookupEnd":539.4000000953674,"domainLookupStart":539.4000000953674,"fetchStart":539.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1014.0999999046326,"responseEnd":1045,"responseStart":1043.2000002861023,"secureConnectionStart":539.4000000953674},{"duration":470.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":539.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":539.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1010.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":506.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":539.7000002861023,"connectEnd":539.7000002861023,"connectStart":539.7000002861023,"domainLookupEnd":539.7000002861023,"domainLookupStart":539.7000002861023,"fetchStart":539.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1014.7000002861023,"responseEnd":1046.5999999046326,"responseStart":1044.2000002861023,"secureConnectionStart":539.7000002861023},{"duration":475.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":539.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":539.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1015,"responseStart":0,"secureConnectionStart":0},{"duration":511.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":540,"connectEnd":540,"connectStart":540,"domainLookupEnd":540,"domainLookupStart":540,"fetchStart":540,"redirectEnd":0,"redirectStart":0,"requestStart":1017.9000000953674,"responseEnd":1051.3000001907349,"responseStart":1048.5,"secureConnectionStart":540},{"duration":1114.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":547.4000000953674,"connectEnd":547.4000000953674,"connectStart":547.4000000953674,"domainLookupEnd":547.4000000953674,"domainLookupStart":547.4000000953674,"fetchStart":547.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1284.9000000953674,"responseEnd":1661.9000000953674,"responseStart":1652.8000001907349,"secureConnectionStart":547.4000000953674},{"duration":1120.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":547.5999999046326,"connectEnd":547.5999999046326,"connectStart":547.5999999046326,"domainLookupEnd":547.5999999046326,"domainLookupStart":547.5999999046326,"fetchStart":547.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1627.7000002861023,"responseEnd":1668.2000002861023,"responseStart":1660.5999999046326,"secureConnectionStart":547.5999999046326},{"duration":318,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1350.9000000953674,"connectEnd":1350.9000000953674,"connectStart":1350.9000000953674,"domainLookupEnd":1350.9000000953674,"domainLookupStart":1350.9000000953674,"fetchStart":1350.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1630.5,"responseEnd":1668.9000000953674,"responseStart":1667.4000000953674,"secureConnectionStart":1350.9000000953674},{"duration":216.2000002861023,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1715,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1715,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1931.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":215.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1739.7000002861023,"connectEnd":1739.7000002861023,"connectStart":1739.7000002861023,"domainLookupEnd":1739.7000002861023,"domainLookupStart":1739.7000002861023,"fetchStart":1739.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1921.7000002861023,"responseEnd":1954.9000000953674,"responseStart":1954.3000001907349,"secureConnectionStart":1739.7000002861023}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":364,"responseStart":519,"responseEnd":547,"domLoading":522,"domInteractive":1938,"domContentLoadedEventStart":1938,"domContentLoadedEventEnd":2006,"domComplete":2711,"loadEventStart":2711,"loadEventEnd":2712,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1858.9000000953674},{"name":"bigPipe.sidebar-id.end","time":1859.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.start","time":1859.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1861.3000001907349},{"name":"activityTabFullyLoaded","time":2024.7000002861023}],"measures":[],"correlationId":"b1ed3fcc047e12","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Investigation:
GIS code uses a "non-standard" way to check if the computation is terminated:
String *Item_func_buffer::val_str(String *str_value)
{
...
...
#define GCALC_TERMINATED(state_var) (state_var && (*state_var))
..
{
...
GCALC_DBUG_RETURN(0xFFFF);
This logic allows to check if the thread is killed but doesn't check if there's a need to process SHOW EXPLAIN query.