mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-12324 Wrong result (phantom array value) on JSON_EXTRACT.
Fixed the path comparison.
This commit is contained in:
parent
4ff6ebf76a
commit
f701ac65e9
3 changed files with 13 additions and 1 deletions
|
@ -642,3 +642,9 @@ SELECT JSON_KEYS(f) FROM t1 ORDER BY 1;
|
|||
JSON_KEYS(f)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' );
|
||||
JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' )
|
||||
NULL
|
||||
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]' );
|
||||
JSON_EXTRACT( '{"foo":"bar"}', '$[*]' )
|
||||
NULL
|
||||
|
|
|
@ -296,3 +296,9 @@ INSERT INTO t1 VALUES (0);
|
|||
SELECT JSON_KEYS(f) FROM t1 ORDER BY 1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# MDEV-12324 Wrong result (phantom array value) on JSON_EXTRACT.
|
||||
#
|
||||
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' );
|
||||
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]' );
|
||||
|
||||
|
|
|
@ -1756,7 +1756,7 @@ int json_path_parts_compare(
|
|||
goto step_fits;
|
||||
goto step_failed;
|
||||
}
|
||||
if (a->n_item == 0)
|
||||
if ((a->type & JSON_PATH_WILD) == 0 && a->n_item == 0)
|
||||
goto step_fits_autowrap;
|
||||
goto step_failed;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue