When compiling/running relatively simple queries that construct JSON objects it seems like the query engine is re-computing function calls instead of using the actual value when extracting JSON data.
For example, given the query:
WITH RECURSIVE iter AS
|
(
|
SELECT 1 AS 'i'
|
UNION
|
SELECT i + 1
|
FROM iter
|
WHERE i < 10
|
),
|
json_data AS
|
(
|
SELECT
|
JSON_OBJECT(
|
'UUID', UUID()
|
) AS 'Data'
|
FROM iter
|
)
|
SELECT
|
JSON_EXTRACT(jd.`Data`, '$.UUID') AS 'Extracted',
|
jd.`Data`
|
FROM json_data jd
|
you would expect the `Extracted` value to be the same as the value that was computed in the `Data` JSON_OBJECT, but it is actually different.
With this query I was able to get the same results for iter generating numbers up to 1,000,000, although in another query that consisted of more joins then I did not see this behavior; in that case the extracted UUID was the same as the originally computed UUID.
- relates to
-
MDEV-32637
Implement native UUID7 function
-
-
Closed
{"report":{"fcp":795.4000000953674,"ttfb":254,"pageVisibility":"visible","entityId":125979,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"2620f4dd-b344-4ac8-8559-25aae4c7b30f","navigationType":0,"readyForUser":883.4000000953674,"redirectCount":0,"resourceLoadedEnd":503.2000000476837,"resourceLoadedStart":262.2000000476837,"resourceTiming":[{"duration":5.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":262.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":268,"responseStart":0,"secureConnectionStart":0},{"duration":5.800000071525574,"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":262.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":268.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":89.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":262.7000000476837,"connectEnd":262.7000000476837,"connectStart":262.7000000476837,"domainLookupEnd":262.7000000476837,"domainLookupStart":262.7000000476837,"fetchStart":262.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":271.40000009536743,"responseEnd":352,"responseStart":314.2000000476837,"secureConnectionStart":262.7000000476837},{"duration":225.5,"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":263.3000000715256,"connectEnd":272.7000000476837,"connectStart":272.7000000476837,"domainLookupEnd":272.7000000476837,"domainLookupStart":272.7000000476837,"fetchStart":263.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":273.10000002384186,"responseEnd":488.8000000715256,"responseStart":286.40000009536743,"secureConnectionStart":272.7000000476837},{"duration":29.09999990463257,"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":263.40000009536743,"connectEnd":263.40000009536743,"connectStart":263.40000009536743,"domainLookupEnd":263.40000009536743,"domainLookupStart":263.40000009536743,"fetchStart":263.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":274,"responseEnd":292.5,"responseStart":289.7000000476837,"secureConnectionStart":263.40000009536743},{"duration":34.299999952316284,"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":263.7000000476837,"connectEnd":263.7000000476837,"connectStart":263.7000000476837,"domainLookupEnd":263.7000000476837,"domainLookupStart":263.7000000476837,"fetchStart":263.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":274.5,"responseEnd":298,"responseStart":295.40000009536743,"secureConnectionStart":263.7000000476837},{"duration":29.199999928474426,"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":263.8000000715256,"connectEnd":263.8000000715256,"connectStart":263.8000000715256,"domainLookupEnd":263.8000000715256,"domainLookupStart":263.8000000715256,"fetchStart":263.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":275.2000000476837,"responseEnd":293,"responseStart":290.60000002384186,"secureConnectionStart":263.8000000715256},{"duration":10.599999904632568,"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":263.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":263.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":274.5,"responseStart":0,"secureConnectionStart":0},{"duration":59,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":264.10000002384186,"connectEnd":264.10000002384186,"connectStart":264.10000002384186,"domainLookupEnd":264.10000002384186,"domainLookupStart":264.10000002384186,"fetchStart":264.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":279.5,"responseEnd":323.10000002384186,"responseStart":321.2000000476837,"secureConnectionStart":264.10000002384186},{"duration":11.899999976158142,"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":264.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":264.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":276.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":40,"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":264.40000009536743,"connectEnd":264.40000009536743,"connectStart":264.40000009536743,"domainLookupEnd":264.40000009536743,"domainLookupStart":264.40000009536743,"fetchStart":264.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":280.5,"responseEnd":304.40000009536743,"responseStart":296.60000002384186,"secureConnectionStart":264.40000009536743},{"duration":235,"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":267.90000009536743,"connectEnd":267.90000009536743,"connectStart":267.90000009536743,"domainLookupEnd":267.90000009536743,"domainLookupStart":267.90000009536743,"fetchStart":267.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":305.40000009536743,"responseEnd":502.90000009536743,"responseStart":498.60000002384186,"secureConnectionStart":267.90000009536743},{"duration":232.10000002384186,"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":271.10000002384186,"connectEnd":271.10000002384186,"connectStart":271.10000002384186,"domainLookupEnd":271.10000002384186,"domainLookupStart":271.10000002384186,"fetchStart":271.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":307.90000009536743,"responseEnd":503.2000000476837,"responseStart":499,"secureConnectionStart":271.10000002384186},{"duration":57.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":496.5,"connectEnd":496.5,"connectStart":496.5,"domainLookupEnd":496.5,"domainLookupStart":496.5,"fetchStart":496.5,"redirectEnd":0,"redirectStart":0,"requestStart":518.5,"responseEnd":553.9000000953674,"responseStart":553.2000000476837,"secureConnectionStart":496.5},{"duration":120.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":713.7000000476837,"connectEnd":713.7000000476837,"connectStart":713.7000000476837,"domainLookupEnd":713.7000000476837,"domainLookupStart":713.7000000476837,"fetchStart":713.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":800.9000000953674,"responseEnd":834.5,"responseStart":833.8000000715256,"secureConnectionStart":713.7000000476837},{"duration":162.10000002384186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":789.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":789.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":951.4000000953674,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":28,"domainLookupEnd":34,"connectStart":34,"connectEnd":54,"secureConnectionStart":43,"requestStart":54,"responseStart":254,"responseEnd":270,"domLoading":257,"domInteractive":952,"domContentLoadedEventStart":952,"domContentLoadedEventEnd":1021,"domComplete":1282,"loadEventStart":1282,"loadEventEnd":1283,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":927.7000000476837},{"name":"bigPipe.sidebar-id.end","time":928.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":928.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":930.4000000953674},{"name":"activityTabFullyLoaded","time":1036.7000000476837}],"measures":[],"correlationId":"c210312b9dc9ec","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":118,"dbReadsTimeInMs":30,"dbConnsTimeInMs":42,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}