Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.9.1
-
EndeavorOS but with MariaDB 10.9.2 from Dockerhub container
Description
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
|
Attachments
Issue Links
- is caused by
-
MDEV-22224 Support JSON Path negative index
- Closed
- is duplicated by
-
MDEV-29586 JSON_VALUE and JSON_EXTRACT doesn't handle special characters
- Closed
-
MDEV-30060 JSON path expression with dashes doesn't work
- Closed
- relates to
-
MDEV-32007 JSON_VALUE and JSON_EXTRACT doesn't handle dash (-) as first character in key
- Closed