diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2022-03-21 12:43:17 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2022-04-15 01:04:52 +0530 |
commit | c69d72c2e441f12a1ccd1e94608f87b452e7b70c (patch) | |
tree | fc2f7b23ca445e38ad3beb0d554e744457d90950 /strings/json_lib.c | |
parent | 95a9078efcad62daa67e8873802a25ff742890d1 (diff) | |
download | mariadb-git-c69d72c2e441f12a1ccd1e94608f87b452e7b70c.tar.gz |
MDEV-28072: JSON_EXTRACT has inconsistent behavior with '0' value in json
path (when range is used)
Analysis: When 0 comes after space, then the json path parser changes the
state to JE_SYN instead of PS_Z (meaning parse zero). Hence the warning.
Fix: Make the state PS_Z instead of JE_SYN.
Diffstat (limited to 'strings/json_lib.c')
-rw-r--r-- | strings/json_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c index ff2421e0eac..0574c80e84e 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1091,7 +1091,7 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]= PS_INT, PS_INT, JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, /* AS */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_T, PS_PT, JE_SYN, PS_NEG, - JE_SYN, PS_INT, PS_LAST, PS_AS, JE_SYN, JE_SYN, JE_SYN, + PS_Z, PS_INT, PS_LAST, PS_AS, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, /* KEY */ { JE_EOS, PS_KNM, PS_KWD, JE_SYN, PS_KNM, PS_KNM, JE_SYN, JE_SYN, PS_KNM, PS_KNM, PS_KNM, PS_KNM, PS_KNM, JE_SYN, PS_KEYX, PS_KNM, |