When executing a prepared statement twicce, second execution returns invalid results.
How to repeat:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (i1 INT, j1 INT NOT NULL, PRIMARY KEY (i1));
|
|
INSERT INTO t1 VALUES (30,300),(40,400);
|
|
DROP TABLE IF EXISTS t2;
|
CREATE TABLE t2 (i2 INT);
|
INSERT INTO t2 VALUES (50),(60);
|
|
DROP TABLE IF EXISTS t3;
|
CREATE TABLE t3 (c3 VARCHAR(20), i3 INT);
|
INSERT INTO t3 VALUES ('a',10),('b',2);
|
|
DROP TABLE IF EXISTS t4;
|
CREATE TABLE t4 (i4 INT);
|
INSERT INTO t4 VALUES (1),(2);
|
|
DROP VIEW IF EXISTS v1;
|
CREATE VIEW v1 AS select coalesce(j1,i3) AS v1_field1 from t2 join t3 left join t1 on ( i1 = i2 );
|
|
DROP VIEW IF EXISTS v2;
|
CREATE VIEW v2 AS select v1_field1 from t4 join v1;
|
|
prepare my_stmt from "select v1_field1 from v2";
|
execute my_stmt;
|
execute my_stmt;
|
deallocate prepare my_stmt;
|
|
DROP TABLE t1,t2,t3,t4;
|
DROP VIEW v1,v2;
|
Output:
1st run
|
+-----------+
|
| v1_field1 |
|
+-----------+
|
| 10 |
|
| 10 |
|
| 10 |
|
| 10 |
|
| 2 |
|
| 2 |
|
| 2 |
|
| 2 |
|
+-----------+
|
|
2nd run
|
|
MySQL 5.3
|
+-----------+
|
| v1_field1 |
|
+-----------+
|
| 0 |
|
| 0 |
|
| 0 |
|
| 0 |
|
| 0 |
|
| 0 |
|
| 0 |
|
| 0 |
|
+-----------+
|
|
MariaDB 10.0
|
|
+-------------+
|
| v1_field1 |
|
+-------------+
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
| -1886417009 |
|
+-------------+
|
{"report":{"fcp":1234.5,"ttfb":242.59999990463257,"pageVisibility":"visible","entityId":29400,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d4bc6f98-d317-43c4-b44e-bb290cee3002","navigationType":0,"readyForUser":1338.2999997138977,"redirectCount":0,"resourceLoadedEnd":1531.0999999046326,"resourceLoadedStart":249.39999961853027,"resourceTiming":[{"duration":373.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":249.39999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":623.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":373.80000019073486,"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":249.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":623.5,"responseStart":0,"secureConnectionStart":0},{"duration":383.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":249.89999961853027,"connectEnd":249.89999961853027,"connectStart":249.89999961853027,"domainLookupEnd":249.89999961853027,"domainLookupStart":249.89999961853027,"fetchStart":249.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":249.89999961853027,"responseEnd":633.3999996185303,"responseStart":633.3999996185303,"secureConnectionStart":249.89999961853027},{"duration":444.19999980926514,"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":250.09999990463257,"connectEnd":250.09999990463257,"connectStart":250.09999990463257,"domainLookupEnd":250.09999990463257,"domainLookupStart":250.09999990463257,"fetchStart":250.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":250.09999990463257,"responseEnd":694.2999997138977,"responseStart":694.2999997138977,"secureConnectionStart":250.09999990463257},{"duration":454.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":250.39999961853027,"connectEnd":250.39999961853027,"connectStart":250.39999961853027,"domainLookupEnd":250.39999961853027,"domainLookupStart":250.39999961853027,"fetchStart":250.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":250.39999961853027,"responseEnd":705.1999998092651,"responseStart":705.1999998092651,"secureConnectionStart":250.39999961853027},{"duration":455.19999980926514,"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":250.59999990463257,"connectEnd":250.59999990463257,"connectStart":250.59999990463257,"domainLookupEnd":250.59999990463257,"domainLookupStart":250.59999990463257,"fetchStart":250.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":250.59999990463257,"responseEnd":705.7999997138977,"responseStart":705.7999997138977,"secureConnectionStart":250.59999990463257},{"duration":455.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":250.7999997138977,"connectEnd":250.7999997138977,"connectStart":250.7999997138977,"domainLookupEnd":250.7999997138977,"domainLookupStart":250.7999997138977,"fetchStart":250.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":250.7999997138977,"responseEnd":706.0999999046326,"responseStart":706.0999999046326,"secureConnectionStart":250.7999997138977},{"duration":536.9000000953674,"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":250.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":250.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":787.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":455.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":251.09999990463257,"connectEnd":251.09999990463257,"connectStart":251.09999990463257,"domainLookupEnd":251.09999990463257,"domainLookupStart":251.09999990463257,"fetchStart":251.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":251.09999990463257,"responseEnd":706.5999999046326,"responseStart":706.5999999046326,"secureConnectionStart":251.09999990463257},{"duration":536.5999999046326,"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":251.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":787.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":455.80000019073486,"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":251.39999961853027,"connectEnd":251.39999961853027,"connectStart":251.39999961853027,"domainLookupEnd":251.39999961853027,"domainLookupStart":251.39999961853027,"fetchStart":251.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":251.39999961853027,"responseEnd":707.1999998092651,"responseStart":707.1999998092651,"secureConnectionStart":251.39999961853027},{"duration":675.0999999046326,"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":257.09999990463257,"connectEnd":257.09999990463257,"connectStart":257.09999990463257,"domainLookupEnd":257.09999990463257,"domainLookupStart":257.09999990463257,"fetchStart":257.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":257.09999990463257,"responseEnd":932.1999998092651,"responseStart":932.1999998092651,"secureConnectionStart":257.09999990463257},{"duration":1271.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":259.19999980926514,"connectEnd":259.19999980926514,"connectStart":259.19999980926514,"domainLookupEnd":259.19999980926514,"domainLookupStart":259.19999980926514,"fetchStart":259.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":259.19999980926514,"responseEnd":1531.0999999046326,"responseStart":1531.0999999046326,"secureConnectionStart":259.19999980926514},{"duration":125.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":810,"connectEnd":810,"connectStart":810,"domainLookupEnd":810,"domainLookupStart":810,"fetchStart":810,"redirectEnd":0,"redirectStart":0,"requestStart":810,"responseEnd":935.0999999046326,"responseStart":935.0999999046326,"secureConnectionStart":810},{"duration":494,"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":1125.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1125.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1619.8999996185303,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":71,"responseStart":242,"responseEnd":256,"domLoading":247,"domInteractive":1568,"domContentLoadedEventStart":1568,"domContentLoadedEventEnd":1619,"domComplete":2543,"loadEventStart":2543,"loadEventEnd":2543,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1533.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1534.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1534.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1536.5999999046326},{"name":"activityTabFullyLoaded","time":1641.5999999046326}],"measures":[],"correlationId":"c84af9e28ba0c2","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
It could be duplicate of
MDEV-5356(I am cheking it).