JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.
DROP PROCEDURE IF EXISTS my_proc;
|
|
DELIMITER $$
|
CREATE PROCEDURE my_proc()
|
BEGIN
|
DECLARE result TEXT;
|
SET result = JSON_EXTRACT('{ "my-key": 1 }', '$."my-key"');
|
END $$
|
DELIMITER ;
|
|
CALL my_proc();
|
--------------
|
CALL my_proc()
|
--------------
|
|
ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6
|
This syntax works in procedures on MariaDB 10.8.4 and prior.
More about the environment:
$ cat /etc/os-release
|
NAME='EndeavourOS'
|
PRETTY_NAME='EndeavourOS'
|
ID=endeavouros
|
ID_LIKE=arch
|
BUILD_ID=2021.04.17
|
ANSI_COLOR="38;2;23;147;209"
|
HOME_URL='https://endeavouros.com'
|
DOCUMENTATION_URL='https://discovery.endeavouros.com'
|
SUPPORT_URL='https://forum.endeavouros.com'
|
BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-reports'
|
LOGO=endeavouros
|
Dockerized MariaDB:
Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution
|
$ mysql --version
|
mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1
|
But also tested with the client included in the docker container, same result:
$ docker exec -it 97795998875c bin/mysql --version
|
bin/mysql Ver 15.1 Distrib 10.9.2-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
|
{"report":{"fcp":1299.5999994277954,"ttfb":364.69999980926514,"pageVisibility":"visible","entityId":114157,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"aa3ea8de-23e1-4924-b457-a8a9f024515a","navigationType":0,"readyForUser":1402.7999992370605,"redirectCount":0,"resourceLoadedEnd":1851.6999998092651,"resourceLoadedStart":369.3999996185303,"resourceTiming":[{"duration":389,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":369.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":369.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":758.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":389.1000003814697,"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":369.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":369.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":758.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":397.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":369.79999923706055,"connectEnd":369.79999923706055,"connectStart":369.79999923706055,"domainLookupEnd":369.79999923706055,"domainLookupStart":369.79999923706055,"fetchStart":369.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":369.79999923706055,"responseEnd":767,"responseStart":767,"secureConnectionStart":369.79999923706055},{"duration":465.69999980926514,"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":370,"connectEnd":370,"connectStart":370,"domainLookupEnd":370,"domainLookupStart":370,"fetchStart":370,"redirectEnd":0,"redirectStart":0,"requestStart":370,"responseEnd":835.6999998092651,"responseStart":835.6999998092651,"secureConnectionStart":370},{"duration":475.30000019073486,"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":370.19999980926514,"connectEnd":370.19999980926514,"connectStart":370.19999980926514,"domainLookupEnd":370.19999980926514,"domainLookupStart":370.19999980926514,"fetchStart":370.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":370.19999980926514,"responseEnd":845.5,"responseStart":845.5,"secureConnectionStart":370.19999980926514},{"duration":493.30000019073486,"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":370.3999996185303,"connectEnd":370.3999996185303,"connectStart":370.3999996185303,"domainLookupEnd":370.3999996185303,"domainLookupStart":370.3999996185303,"fetchStart":370.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":370.3999996185303,"responseEnd":863.6999998092651,"responseStart":863.6999998092651,"secureConnectionStart":370.3999996185303},{"duration":493.5,"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":370.5999994277954,"connectEnd":370.5999994277954,"connectStart":370.5999994277954,"domainLookupEnd":370.5999994277954,"domainLookupStart":370.5999994277954,"fetchStart":370.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":370.5999994277954,"responseEnd":864.0999994277954,"responseStart":864.0999994277954,"secureConnectionStart":370.5999994277954},{"duration":556.6000003814697,"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":370.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":370.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":927.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":493.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":370.8999996185303,"connectEnd":370.8999996185303,"connectStart":370.8999996185303,"domainLookupEnd":370.8999996185303,"domainLookupStart":370.8999996185303,"fetchStart":370.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":370.8999996185303,"responseEnd":864.6999998092651,"responseStart":864.6999998092651,"secureConnectionStart":370.8999996185303},{"duration":551.4000005722046,"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":376.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":376.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":927.5,"responseStart":0,"secureConnectionStart":0},{"duration":489.19999980926514,"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":376.3999996185303,"connectEnd":376.3999996185303,"connectStart":376.3999996185303,"domainLookupEnd":376.3999996185303,"domainLookupStart":376.3999996185303,"fetchStart":376.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":376.3999996185303,"responseEnd":865.5999994277954,"responseStart":865.5999994277954,"secureConnectionStart":376.3999996185303},{"duration":1235.5,"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":383.29999923706055,"connectEnd":383.29999923706055,"connectStart":383.29999923706055,"domainLookupEnd":383.29999923706055,"domainLookupStart":383.29999923706055,"fetchStart":383.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":383.29999923706055,"responseEnd":1618.7999992370605,"responseStart":1618.6999998092651,"secureConnectionStart":383.29999923706055},{"duration":1460.5,"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":391.19999980926514,"connectEnd":391.19999980926514,"connectStart":391.19999980926514,"domainLookupEnd":391.19999980926514,"domainLookupStart":391.19999980926514,"fetchStart":391.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":391.19999980926514,"responseEnd":1851.6999998092651,"responseStart":1851.6999998092651,"secureConnectionStart":391.19999980926514},{"duration":660.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":959.7999992370605,"connectEnd":959.7999992370605,"connectStart":959.7999992370605,"domainLookupEnd":959.7999992370605,"domainLookupStart":959.7999992370605,"fetchStart":959.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":959.7999992370605,"responseEnd":1620.2999992370605,"responseStart":1620.2999992370605,"secureConnectionStart":959.7999992370605},{"duration":560.8000001907349,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1292.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1292.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1853.3999996185303,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":175,"responseStart":364,"responseEnd":391,"domLoading":368,"domInteractive":1889,"domContentLoadedEventStart":1889,"domContentLoadedEventEnd":1935,"domComplete":2547,"loadEventStart":2547,"loadEventEnd":2548,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1858},{"name":"bigPipe.sidebar-id.end","time":1858.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.start","time":1859},{"name":"bigPipe.activity-panel-pipe-id.end","time":1860.5},{"name":"activityTabFullyLoaded","time":1954.6999998092651}],"measures":[],"correlationId":"6e8ae0a6834b8b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":114,"dbReadsTimeInMs":15,"dbConnsTimeInMs":29,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Caused by
commit dfcbb30a92c2f1d33ceefb56a1d3fa13f8d0ce67
Date: Mon Nov 22 22:59:30 2021 +0530
MDEV-22224: Support JSON Path negative index