Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Fix Version/s:
None
Component/s:
None
The query with -ps-protocol crashes the rserver because select>prep_where references on freed memory (it was Item_outer_ref):
CREATE TABLE `t1` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_varchar_key` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_varchar_key` (`col_varchar_key`)
) DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES (10,'v');
INSERT INTO `t1` VALUES (11,'r');
CREATE TABLE `t2` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_varchar_key` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_varchar_key` (`col_varchar_key`)
) DEFAULT CHARSET=latin1;
INSERT INTO `t2` VALUES (1,'r');
INSERT INTO `t2` VALUES (2,'c');
CREATE TABLE `t3` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_varchar_key` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_varchar_key` (`col_varchar_key`)
) DEFAULT CHARSET=latin1;
INSERT INTO `t3` VALUES (1,'w');
SELECT SUM( DISTINCT table2 . `pk` ) AS field2 ,
(SELECT SUM( SUBQUERY1_t2 . `pk` ) AS SUBQUERY1_field1
FROM t2 AS SUBQUERY1_t2 STRAIGHT_JOIN
t3 AS SUBQUERY1_t3 ON (SUBQUERY1_t3 . `pk` = SUBQUERY1_t2 . `pk` )
WHERE table1 . `col_varchar_key` ) AS field3
FROM ( t1 AS table1 LEFT JOIN
( t2 AS table2 STRAIGHT_JOIN
t3 AS table3 ON (table3 . `pk` = table2 . `pk` ) )
ON (table3 . `col_varchar_key` = table1 . `col_varchar_key` ) )
WHERE ( table1 . `pk` < 5 ) OR ( table1 . `col_varchar_key` IS NOT NULL)
GROUP BY field3
HAVING (field3 <= 'h' AND field2 != 4) ;
drop tables t1, t2, t3;
{"report":{"fcp":731,"ttfb":186,"pageVisibility":"visible","entityId":20501,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"f2721430-cf12-4532-b967-2f751eccf34a","navigationType":0,"readyForUser":792.5,"redirectCount":0,"resourceLoadedEnd":822.7999999523163,"resourceLoadedStart":191.29999995231628,"resourceTiming":[{"duration":41.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":191.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":232.39999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":41.299999952316284,"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":191.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":232.79999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":73.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":191.79999995231628,"connectEnd":191.79999995231628,"connectStart":191.79999995231628,"domainLookupEnd":191.79999995231628,"domainLookupStart":191.79999995231628,"fetchStart":191.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":191.79999995231628,"responseEnd":265.59999990463257,"responseStart":265.59999990463257,"secureConnectionStart":191.79999995231628},{"duration":140.80000019073486,"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":191.89999985694885,"connectEnd":191.89999985694885,"connectStart":191.89999985694885,"domainLookupEnd":191.89999985694885,"domainLookupStart":191.89999985694885,"fetchStart":191.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":191.89999985694885,"responseEnd":332.7000000476837,"responseStart":332.7000000476837,"secureConnectionStart":191.89999985694885},{"duration":144.20000004768372,"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":192.09999990463257,"connectEnd":192.09999990463257,"connectStart":192.09999990463257,"domainLookupEnd":192.09999990463257,"domainLookupStart":192.09999990463257,"fetchStart":192.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":192.09999990463257,"responseEnd":336.2999999523163,"responseStart":336.2999999523163,"secureConnectionStart":192.09999990463257},{"duration":144.40000009536743,"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":192.29999995231628,"connectEnd":192.29999995231628,"connectStart":192.29999995231628,"domainLookupEnd":192.29999995231628,"domainLookupStart":192.29999995231628,"fetchStart":192.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":192.29999995231628,"responseEnd":336.7000000476837,"responseStart":336.7000000476837,"secureConnectionStart":192.29999995231628},{"duration":144.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":192.5,"connectEnd":192.5,"connectStart":192.5,"domainLookupEnd":192.5,"domainLookupStart":192.5,"fetchStart":192.5,"redirectEnd":0,"redirectStart":0,"requestStart":192.5,"responseEnd":337.09999990463257,"responseStart":337.09999990463257,"secureConnectionStart":192.5},{"duration":215,"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":192.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":192.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":144.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":192.79999995231628,"connectEnd":192.79999995231628,"connectStart":192.79999995231628,"domainLookupEnd":192.79999995231628,"domainLookupStart":192.79999995231628,"fetchStart":192.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":192.79999995231628,"responseEnd":337.5,"responseStart":337.5,"secureConnectionStart":192.79999995231628},{"duration":215,"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":192.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":192.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":145.09999990463257,"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":193,"connectEnd":193,"connectStart":193,"domainLookupEnd":193,"domainLookupStart":193,"fetchStart":193,"redirectEnd":0,"redirectStart":0,"requestStart":193,"responseEnd":338.09999990463257,"responseStart":338.09999990463257,"secureConnectionStart":193},{"duration":395.7999999523163,"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":193.79999995231628,"connectEnd":193.79999995231628,"connectStart":193.79999995231628,"domainLookupEnd":193.79999995231628,"domainLookupStart":193.79999995231628,"fetchStart":193.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":193.79999995231628,"responseEnd":589.5999999046326,"responseStart":589.5999999046326,"secureConnectionStart":193.79999995231628},{"duration":607.7000000476837,"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":193.89999985694885,"connectEnd":193.89999985694885,"connectStart":193.89999985694885,"domainLookupEnd":193.89999985694885,"domainLookupStart":193.89999985694885,"fetchStart":193.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":193.89999985694885,"responseEnd":801.5999999046326,"responseStart":801.5999999046326,"secureConnectionStart":193.89999985694885},{"duration":170.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":419.09999990463257,"connectEnd":419.09999990463257,"connectStart":419.09999990463257,"domainLookupEnd":419.09999990463257,"domainLookupStart":419.09999990463257,"fetchStart":419.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":419.09999990463257,"responseEnd":589.8999998569489,"responseStart":589.8999998569489,"secureConnectionStart":419.09999990463257},{"duration":148.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":674.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":674.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":822.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":141.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":675.0999999046326,"connectEnd":675.0999999046326,"connectStart":675.0999999046326,"domainLookupEnd":675.0999999046326,"domainLookupStart":675.0999999046326,"fetchStart":675.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":675.0999999046326,"responseEnd":816.3999998569489,"responseStart":816.3999998569489,"secureConnectionStart":675.0999999046326},{"duration":145.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":675.3999998569489,"connectEnd":675.3999998569489,"connectStart":675.3999998569489,"domainLookupEnd":675.3999998569489,"domainLookupStart":675.3999998569489,"fetchStart":675.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":675.3999998569489,"responseEnd":821.0999999046326,"responseStart":821.0999999046326,"secureConnectionStart":675.3999998569489},{"duration":140.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":725.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":725.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":865.7999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":34,"responseStart":186,"responseEnd":189,"domLoading":190,"domInteractive":892,"domContentLoadedEventStart":892,"domContentLoadedEventEnd":930,"domComplete":1182,"loadEventStart":1182,"loadEventEnd":1182,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":873.3999998569489},{"name":"bigPipe.sidebar-id.end","time":874.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":874.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":876},{"name":"activityTabFullyLoaded","time":950.5999999046326}],"measures":[],"correlationId":"986520dd2b34ae","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":93,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Re: select->prep_where references on freed memory
Here is more simple test suite:
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(0,0);
CREATE TABLE t2 (c int);
insert into t2 values (1),(2);
select sum(a),(select sum(c) from t2 where table1.b) as sub
from t1 as table1 group by sub;