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
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
JSON paths with dashes in them are reported as syntax errors.
```sql 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(); ``` ```sql -------------- 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 on MariaDB 10.9 (as tagged in dockerhub) and prior. |
JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.
{code:sql} 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(); {code} {code:sql} -------------- CALL my_proc() -------------- ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6 {code} This syntax works in procedures on MariaDB 10.9 (as tagged in dockerhub) and prior. More about the environment: {code:sh} $ cat /etc/os-release ───────┬─────────────────────────────────────────────────────────────────────────────────────── │ File: /etc/os-release ───────┼─────────────────────────────────────────────────────────────────────────────────────── 1 │ NAME='EndeavourOS' 2 │ PRETTY_NAME='EndeavourOS' 3 │ ID=endeavouros 4 │ ID_LIKE=arch 5 │ BUILD_ID=2021.04.17 6 │ ANSI_COLOR="38;2;23;147;209" 7 │ HOME_URL='https://endeavouros.com' 8 │ DOCUMENTATION_URL='https://discovery.endeavouros.com' 9 │ SUPPORT_URL='https://forum.endeavouros.com' 10 │ BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-repo> 11 │ LOGO=endeavouros ───────┴───────────────────────────────── {code} Dockerized MariaDB: {code:sh} Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution {code} {code:sh} $ mysql --version mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1 {code} But also tested with the client included in the docker container, same result: {code:sh} $ 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 {code} |
Environment |
```sh
$ cat /etc/os-release ───────┬─────────────────────────────────────────────────────────────────────────────────────── │ File: /etc/os-release ───────┼─────────────────────────────────────────────────────────────────────────────────────── 1 │ NAME='EndeavourOS' 2 │ PRETTY_NAME='EndeavourOS' 3 │ ID=endeavouros 4 │ ID_LIKE=arch 5 │ BUILD_ID=2021.04.17 6 │ ANSI_COLOR="38;2;23;147;209" 7 │ HOME_URL='https://endeavouros.com' 8 │ DOCUMENTATION_URL='https://discovery.endeavouros.com' 9 │ SUPPORT_URL='https://forum.endeavouros.com' 10 │ BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-repo> 11 │ LOGO=endeavouros ───────┴───────────────────────────────── ``` Dockerized MariaDB: ```sh Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution ``` ```sh $ 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: ```sh $ 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 ``` |
Description |
JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.
{code:sql} 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(); {code} {code:sql} -------------- CALL my_proc() -------------- ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6 {code} This syntax works in procedures on MariaDB 10.9 (as tagged in dockerhub) and prior. More about the environment: {code:sh} $ cat /etc/os-release ───────┬─────────────────────────────────────────────────────────────────────────────────────── │ File: /etc/os-release ───────┼─────────────────────────────────────────────────────────────────────────────────────── 1 │ NAME='EndeavourOS' 2 │ PRETTY_NAME='EndeavourOS' 3 │ ID=endeavouros 4 │ ID_LIKE=arch 5 │ BUILD_ID=2021.04.17 6 │ ANSI_COLOR="38;2;23;147;209" 7 │ HOME_URL='https://endeavouros.com' 8 │ DOCUMENTATION_URL='https://discovery.endeavouros.com' 9 │ SUPPORT_URL='https://forum.endeavouros.com' 10 │ BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-repo> 11 │ LOGO=endeavouros ───────┴───────────────────────────────── {code} Dockerized MariaDB: {code:sh} Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution {code} {code:sh} $ mysql --version mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1 {code} But also tested with the client included in the docker container, same result: {code:sh} $ 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 {code} |
JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.
{code:sql} 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(); {code} {code:sql} -------------- CALL my_proc() -------------- ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6 {code} This syntax works in procedures on MariaDB 10.9 (as tagged in dockerhub) and prior. More about the environment: {code:sh} $ 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 {code} Dockerized MariaDB: {code:sh} Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution {code} {code:sh} $ mysql --version mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1 {code} But also tested with the client included in the docker container, same result: {code:sh} $ 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 {code} |
Summary | JSON paths containing dashes are reported as syntax errors. | JSON paths containing dashes are reported as syntax errors in procedures |
Environment | 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.
{code:sql} 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(); {code} {code:sql} -------------- CALL my_proc() -------------- ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6 {code} This syntax works in procedures on MariaDB 10.9 (as tagged in dockerhub) and prior. More about the environment: {code:sh} $ 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 {code} Dockerized MariaDB: {code:sh} Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution {code} {code:sh} $ mysql --version mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1 {code} But also tested with the client included in the docker container, same result: {code:sh} $ 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 {code} |
JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.
{code:sql} 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(); {code} {code:sql} -------------- CALL my_proc() -------------- ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6 {code} This syntax works in procedures on MariaDB 10.8.4 and prior. More about the environment: {code:sh} $ 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 {code} Dockerized MariaDB: {code:sh} Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution {code} {code:sh} $ mysql --version mysql Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1 {code} But also tested with the client included in the docker container, same result: {code:sh} $ 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 {code} |
Affects Version/s | 10.9 [ 26905 ] | |
Affects Version/s | 10.10 [ 27530 ] |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Labels | regression |
Fix Version/s | 10.10 [ 27530 ] |
Affects Version/s | 10.9.1 [ 27114 ] | |
Affects Version/s | 10.9 [ 26905 ] | |
Affects Version/s | 10.9.2 [ 27115 ] | |
Affects Version/s | 10.10 [ 27530 ] |
Link |
This issue is caused by |
Assignee | Rucha Deodhar [ rucha174 ] |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Attachment | mariadb-patch [ 67190 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Assignee | Rucha Deodhar [ rucha174 ] | Alexey Botchkov [ holyfoot ] |
Status | Confirmed [ 10101 ] | In Review [ 10002 ] |
Assignee | Alexey Botchkov [ holyfoot ] | Rucha Deodhar [ rucha174 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Component/s | JSON [ 13908 ] | |
Fix Version/s | 10.9.5 [ 28519 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue is blocked by |
Link |
This issue relates to |
Link |
This issue is blocked by |