summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_json.test
diff options
context:
space:
mode:
authorAlexander Freiherr von Buddenbrock <a.buddenbrock@gmail.com>2022-11-04 13:42:43 +0100
committerRucha Deodhar <rucha.deodhar@mariadb.com>2023-01-06 12:55:51 +0530
commit0225159a8d0e1260bfec7219b584523097a74d4b (patch)
tree1b7925243d7668f7e68a4feb42cdb3f5523b0b71 /mysql-test/main/func_json.test
parent5bb2cc8dbcfba3aa1e19a0b0d7ffcf27eed3290e (diff)
downloadmariadb-git-0225159a8d0e1260bfec7219b584523097a74d4b.tar.gz
MDEV-29381: SON paths containing dashes are reported as syntax errors in
procedures MDEV-22224 caused the parsing of keys with hyphens to break by setting the state transitions for parsing keys to JE_SYN (syntax error) when they encounter a hyphen. However json key names may contain hyphens and still be considered valid json. This patch changes the state transition table so that key names with hyphens remain valid. Note that unquoted key names in paths like $.key-name are also valid again. This restores the previous behaviour when hyphens were considered part of the P_ETC character class.
Diffstat (limited to 'mysql-test/main/func_json.test')
-rw-r--r--mysql-test/main/func_json.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 8123ab4be8a..a1613d9ee4f 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -1608,3 +1608,10 @@ SELECT JSON_OVERLAPS(@json1, @json2);
--echo #
--echo # End of 10.9 Test
--echo #
+
+--echo #
+--echo # MDEV-29381: JSON paths containing dashes are reported as syntax errors in procedures
+--echo #
+
+SELECT JSON_EXTRACT('{ "my-key": 1 }', '$."my-key"');
+SELECT JSON_EXTRACT('{ "my-key": 1 }', '$.my-key');