summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 17:17:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 17:17:24 +0300
commit098c0f2634a35e24e9eb0f06d3fba69d0d097657 (patch)
tree8e6b460d1c8812d29444bf1bd7449e5871105215 /strings
parent5bf4dee36943cb4cc95d10863d469192de854800 (diff)
parente5c4f4e590d7782ef938b436f84ae11b68e0af08 (diff)
downloadmariadb-git-098c0f2634a35e24e9eb0f06d3fba69d0d097657.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'strings')
-rw-r--r--strings/json_lib.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 49f29903ed5..cfdaa39d33c 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -1767,107 +1767,6 @@ int json_get_path_next(json_engine_t *je, json_path_t *p)
}
-int json_path_parts_compare(
- const json_path_step_t *a, const json_path_step_t *a_end,
- const json_path_step_t *b, const json_path_step_t *b_end,
- enum json_value_types vt)
-{
- int res, res2;
-
- while (a <= a_end)
- {
- if (b > b_end)
- {
- while (vt != JSON_VALUE_ARRAY &&
- (a->type & JSON_PATH_ARRAY_WILD) == JSON_PATH_ARRAY &&
- a->n_item == 0)
- {
- if (++a > a_end)
- return 0;
- }
- return -2;
- }
-
- DBUG_ASSERT((b->type & (JSON_PATH_WILD | JSON_PATH_DOUBLE_WILD)) == 0);
-
-
- if (a->type & JSON_PATH_ARRAY)
- {
- if (b->type & JSON_PATH_ARRAY)
- {
- if ((a->type & JSON_PATH_WILD) || a->n_item == b->n_item)
- goto step_fits;
- goto step_failed;
- }
- if ((a->type & JSON_PATH_WILD) == 0 && a->n_item == 0)
- goto step_fits_autowrap;
- goto step_failed;
- }
- else /* JSON_PATH_KEY */
- {
- if (!(b->type & JSON_PATH_KEY))
- goto step_failed;
-
- if (!(a->type & JSON_PATH_WILD) &&
- (a->key_end - a->key != b->key_end - b->key ||
- memcmp(a->key, b->key, a->key_end - a->key) != 0))
- goto step_failed;
-
- goto step_fits;
- }
-step_failed:
- if (!(a->type & JSON_PATH_DOUBLE_WILD))
- return -1;
- b++;
- continue;
-
-step_fits:
- b++;
- if (!(a->type & JSON_PATH_DOUBLE_WILD))
- {
- a++;
- continue;
- }
-
- /* Double wild handling needs recursions. */
- res= json_path_parts_compare(a+1, a_end, b, b_end, vt);
- if (res == 0)
- return 0;
-
- res2= json_path_parts_compare(a, a_end, b, b_end, vt);
-
- return (res2 >= 0) ? res2 : res;
-
-step_fits_autowrap:
- if (!(a->type & JSON_PATH_DOUBLE_WILD))
- {
- a++;
- continue;
- }
-
- /* Double wild handling needs recursions. */
- res= json_path_parts_compare(a+1, a_end, b+1, b_end, vt);
- if (res == 0)
- return 0;
-
- res2= json_path_parts_compare(a, a_end, b+1, b_end, vt);
-
- return (res2 >= 0) ? res2 : res;
-
- }
-
- return b <= b_end;
-}
-
-
-int json_path_compare(const json_path_t *a, const json_path_t *b,
- enum json_value_types vt)
-{
- return json_path_parts_compare(a->steps+1, a->last_step,
- b->steps+1, b->last_step, vt);
-}
-
-
static enum json_types smart_read_value(json_engine_t *je,
const char **value, int *value_len)
{