This issue is similar (but not exactly the same) to an issue I've reported earlier under MDEV-4335.
I'm using information_schema.SCHEMATA to make sure that a database exists before switching to it in my PHP app.
The issue:
The following query unexpectedly returns an empty result set on this version (I've had no issues on previous versions, except the one in the issue I've mentioned before):
SELECT `id`, `db`, `appv`, `group`, `name` FROM `web_dbs` WHERE `db` IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA) ORDER BY `db` DESC;
|
This is unexpected, because the following query returns multiple rows, while it should be more restrictive:
SELECT `id`, `db`, `appv`, `group`, `name` FROM `web_dbs` WHERE `group` IN (SELECT `group` FROM `web_users` WHERE `username` = '[REDACTED]') AND `db` IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA) ORDER BY `db` DESC;
|
Upon further research I found out that removing the ORDER BY clause from the first query helps, so for now I will change the first query into the following, which does work (but will probably have decreased performance):
SELECT * FROM (SELECT `id`, `db`, `appv`, `group`, `name` FROM `web_dbs` WHERE `db` IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA)) tbl ORDER BY `db`;
|
{"report":{"fcp":935.5999999046326,"ttfb":388.7999999523163,"pageVisibility":"visible","entityId":37903,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"06286676-a628-461c-8f67-fda7b9ffd9e1","navigationType":0,"readyForUser":993.7000000476837,"redirectCount":0,"resourceLoadedEnd":659.5,"resourceLoadedStart":394.09999990463257,"resourceTiming":[{"duration":9.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":394.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":394.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":403.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":10.700000047683716,"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":394.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":394.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":405,"responseStart":0,"secureConnectionStart":0},{"duration":78.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":394.40000009536743,"connectEnd":394.40000009536743,"connectStart":394.40000009536743,"domainLookupEnd":394.40000009536743,"domainLookupStart":394.40000009536743,"fetchStart":394.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":394.40000009536743,"responseEnd":472.5,"responseStart":472.5,"secureConnectionStart":394.40000009536743},{"duration":132.20000004768372,"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":394.59999990463257,"connectEnd":394.59999990463257,"connectStart":394.59999990463257,"domainLookupEnd":394.59999990463257,"domainLookupStart":394.59999990463257,"fetchStart":394.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":394.59999990463257,"responseEnd":526.7999999523163,"responseStart":526.7999999523163,"secureConnectionStart":394.59999990463257},{"duration":138.09999990463257,"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":394.7000000476837,"connectEnd":394.7000000476837,"connectStart":394.7000000476837,"domainLookupEnd":394.7000000476837,"domainLookupStart":394.7000000476837,"fetchStart":394.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":394.7000000476837,"responseEnd":532.7999999523163,"responseStart":532.7999999523163,"secureConnectionStart":394.7000000476837},{"duration":138.5,"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":394.7999999523163,"connectEnd":394.7999999523163,"connectStart":394.7999999523163,"domainLookupEnd":394.7999999523163,"domainLookupStart":394.7999999523163,"fetchStart":394.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":394.7999999523163,"responseEnd":533.2999999523163,"responseStart":533.2999999523163,"secureConnectionStart":394.7999999523163},{"duration":139.59999990463257,"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":394.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":394.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":534.5,"responseStart":0,"secureConnectionStart":0},{"duration":138.69999980926514,"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":394.90000009536743,"connectEnd":394.90000009536743,"connectStart":394.90000009536743,"domainLookupEnd":394.90000009536743,"domainLookupStart":394.90000009536743,"fetchStart":394.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":394.90000009536743,"responseEnd":533.5999999046326,"responseStart":533.5999999046326,"secureConnectionStart":394.90000009536743},{"duration":141,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":395.09999990463257,"connectEnd":395.09999990463257,"connectStart":395.09999990463257,"domainLookupEnd":395.09999990463257,"domainLookupStart":395.09999990463257,"fetchStart":395.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":395.09999990463257,"responseEnd":536.0999999046326,"responseStart":536.0999999046326,"secureConnectionStart":395.09999990463257},{"duration":141.5,"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":395.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":395.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":536.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":141.5,"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":395.2999999523163,"connectEnd":395.2999999523163,"connectStart":395.2999999523163,"domainLookupEnd":395.2999999523163,"domainLookupStart":395.2999999523163,"fetchStart":395.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":395.2999999523163,"responseEnd":536.7999999523163,"responseStart":536.7999999523163,"secureConnectionStart":395.2999999523163},{"duration":226.5,"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":396.40000009536743,"connectEnd":396.40000009536743,"connectStart":396.40000009536743,"domainLookupEnd":396.40000009536743,"domainLookupStart":396.40000009536743,"fetchStart":396.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":396.40000009536743,"responseEnd":622.9000000953674,"responseStart":622.9000000953674,"secureConnectionStart":396.40000009536743},{"duration":263,"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":396.5,"connectEnd":396.5,"connectStart":396.5,"domainLookupEnd":396.5,"domainLookupStart":396.5,"fetchStart":396.5,"redirectEnd":0,"redirectStart":0,"requestStart":396.5,"responseEnd":659.5,"responseStart":659.5,"secureConnectionStart":396.5},{"duration":233.10000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":700.2999999523163,"connectEnd":700.2999999523163,"connectStart":700.2999999523163,"domainLookupEnd":700.2999999523163,"domainLookupStart":700.2999999523163,"fetchStart":700.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":700.2999999523163,"responseEnd":933.4000000953674,"responseStart":933.4000000953674,"secureConnectionStart":700.2999999523163},{"duration":92.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":913.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":913.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1006,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":259,"responseStart":389,"responseEnd":390,"domLoading":392,"domInteractive":1052,"domContentLoadedEventStart":1052,"domContentLoadedEventEnd":1092,"domComplete":1329,"loadEventStart":1329,"loadEventEnd":1331,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1033.5},{"name":"bigPipe.sidebar-id.end","time":1034.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1034.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":1036.7000000476837},{"name":"activityTabFullyLoaded","time":1099.5}],"measures":[],"correlationId":"e754759595483a","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":75,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}