The problem appeared on 5.5 tree with the following revision:
revno: 4030
|
revision-id: monty@askmonty.org-20140124125018-qwln430o4bu3pued
|
parent: monty@askmonty.org-20140124123019-2ts6q2ip6076gmqg
|
committer: Michael Widenius <monty@askmonty.org>
|
branch nick: maria-5.5
|
timestamp: Fri 2014-01-24 14:50:18 +0200
|
message:
|
Fix for MDEV-5531: double call procedure in one session - hard shutdown the server
|
Main fix was to not cache derivied tables as they may be temporary tables that are deleted before the next query.
|
This was a bit tricky as Item_field::fix_fields depended on cached_tables to be set to resolve some columns.
|
Test case
|
CREATE TABLE t (a INT NOT NULL) ENGINE=MyISAM;
|
INSERT INTO t VALUES (0),(8);
|
|
PREPARE stmt FROM "
|
SELECT a FROM ( SELECT DISTINCT t1.* FROM t AS t1, t AS t2 ) AS sq
|
WHERE a IN ( SELECT MIN(t3.a) FROM ( t AS t3 INNER JOIN t AS t4 ON (t3.a = t4.a) ) ) ORDER BY a LIMIT 10
|
";
|
|
execute stmt;
|
execute stmt;
|
Results
|
MariaDB [test]> execute stmt;
|
+---+
|
| a |
|
+---+
|
| 0 |
|
| 8 |
|
+---+
|
2 rows in set (0.01 sec)
|
|
MariaDB [test]> execute stmt;
|
Empty set (0.00 sec)
|
Both results are incorrect.
When the query is executed directly, without a PS, it produces the expected result:
MariaDB [test]> SELECT a FROM ( SELECT DISTINCT t1.* FROM t AS t1, t AS t2 ) AS sq
|
-> WHERE a IN ( SELECT MIN(t3.a) FROM t AS t3 INNER JOIN t AS t4 ON (t3.a = t4.a) ) ORDER BY a LIMIT 10
|
-> ;
|
+---+
|
| a |
|
+---+
|
| 0 |
|
+---+
|
1 row in set (0.00 sec)
|
{"report":{"fcp":1064.2000000476837,"ttfb":395.40000009536743,"pageVisibility":"visible","entityId":50554,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"42823303-8750-41bb-b250-2a37d8f34808","navigationType":0,"readyForUser":1145.7999999523163,"redirectCount":0,"resourceLoadedEnd":1216.4000000953674,"resourceLoadedStart":400.7000000476837,"resourceTiming":[{"duration":158.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":400.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":400.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":559.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":158.5,"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":401,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":401,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":559.5,"responseStart":0,"secureConnectionStart":0},{"duration":167.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":401.10000014305115,"connectEnd":401.10000014305115,"connectStart":401.10000014305115,"domainLookupEnd":401.10000014305115,"domainLookupStart":401.10000014305115,"fetchStart":401.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":401.10000014305115,"responseEnd":568.2000000476837,"responseStart":568.2000000476837,"secureConnectionStart":401.10000014305115},{"duration":235.90000009536743,"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":401.2999999523163,"connectEnd":401.2999999523163,"connectStart":401.2999999523163,"domainLookupEnd":401.2999999523163,"domainLookupStart":401.2999999523163,"fetchStart":401.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":401.2999999523163,"responseEnd":637.2000000476837,"responseStart":637.2000000476837,"secureConnectionStart":401.2999999523163},{"duration":239.29999995231628,"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":401.5,"connectEnd":401.5,"connectStart":401.5,"domainLookupEnd":401.5,"domainLookupStart":401.5,"fetchStart":401.5,"redirectEnd":0,"redirectStart":0,"requestStart":401.5,"responseEnd":640.7999999523163,"responseStart":640.7999999523163,"secureConnectionStart":401.5},{"duration":239.5,"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":401.7000000476837,"connectEnd":401.7000000476837,"connectStart":401.7000000476837,"domainLookupEnd":401.7000000476837,"domainLookupStart":401.7000000476837,"fetchStart":401.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":401.7000000476837,"responseEnd":641.2000000476837,"responseStart":641.2000000476837,"secureConnectionStart":401.7000000476837},{"duration":240.30000019073486,"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":401.7999999523163,"connectEnd":401.7999999523163,"connectStart":401.7999999523163,"domainLookupEnd":401.7999999523163,"domainLookupStart":401.7999999523163,"fetchStart":401.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":401.7999999523163,"responseEnd":642.1000001430511,"responseStart":642.1000001430511,"secureConnectionStart":401.7999999523163},{"duration":307.40000009536743,"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":402,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":402,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":709.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":240.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":402.2000000476837,"connectEnd":402.2000000476837,"connectStart":402.2000000476837,"domainLookupEnd":402.2000000476837,"domainLookupStart":402.2000000476837,"fetchStart":402.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":402.2000000476837,"responseEnd":642.6000001430511,"responseStart":642.6000001430511,"secureConnectionStart":402.2000000476837},{"duration":307.40000009536743,"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":402.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":402.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":709.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":240.79999995231628,"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":402.5,"connectEnd":402.5,"connectStart":402.5,"domainLookupEnd":402.5,"domainLookupStart":402.5,"fetchStart":402.5,"redirectEnd":0,"redirectStart":0,"requestStart":402.5,"responseEnd":643.2999999523163,"responseStart":643.2999999523163,"secureConnectionStart":402.5},{"duration":669.3999998569489,"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":403.40000009536743,"connectEnd":403.40000009536743,"connectStart":403.40000009536743,"domainLookupEnd":403.40000009536743,"domainLookupStart":403.40000009536743,"fetchStart":403.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":403.40000009536743,"responseEnd":1072.7999999523163,"responseStart":1072.7999999523163,"secureConnectionStart":403.40000009536743},{"duration":812.9000000953674,"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":403.5,"connectEnd":403.5,"connectStart":403.5,"domainLookupEnd":403.5,"domainLookupStart":403.5,"fetchStart":403.5,"redirectEnd":0,"redirectStart":0,"requestStart":403.5,"responseEnd":1216.4000000953674,"responseStart":1216.4000000953674,"secureConnectionStart":403.5},{"duration":387,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":722.2999999523163,"connectEnd":722.2999999523163,"connectStart":722.2999999523163,"domainLookupEnd":722.2999999523163,"domainLookupStart":722.2999999523163,"fetchStart":722.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":722.2999999523163,"responseEnd":1109.2999999523163,"responseStart":1109.2999999523163,"secureConnectionStart":722.2999999523163},{"duration":176.59999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1058.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1058.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1234.7000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":238,"responseStart":395,"responseEnd":399,"domLoading":398,"domInteractive":1236,"domContentLoadedEventStart":1236,"domContentLoadedEventEnd":1279,"domComplete":1886,"loadEventStart":1886,"loadEventEnd":1888,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1222.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1222.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1223},{"name":"bigPipe.activity-panel-pipe-id.end","time":1225.2999999523163},{"name":"activityTabFullyLoaded","time":1286.4000000953674}],"measures":[],"correlationId":"c7b0e26a1df1af","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}