From 50831b0f197fd1edb98aa56085e391e5033e2a54 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 24 Jan 2017 17:34:44 +0400 Subject: MDEV-11557 port MySQL-5.7 JSON tests to MariaDB. json_no_table.test ported. --- include/json_lib.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/json_lib.h b/include/json_lib.h index ce7f27317bc..ddba571ac59 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -219,7 +219,7 @@ typedef struct st_json_engine_t /* string constants. */ int stack[JSON_DEPTH_LIMIT]; /* Keeps the stack of nested JSON structures. */ - int *stack_p; /* The 'stack' pointer. */ + int stack_p; /* The 'stack' pointer. */ } json_engine_t; @@ -308,7 +308,7 @@ typedef const int *json_level_t; */ #define json_get_level(j) (j->stack_p) -int json_skip_to_level(json_engine_t *j, json_level_t level); +int json_skip_to_level(json_engine_t *j, int level); /* json_skip_level() works as above with just current structre. @@ -391,6 +391,27 @@ int json_append_ascii(CHARSET_INFO *json_cs, uchar *json, uchar *json_end, const uchar *ascii, const uchar *ascii_end); + +/* + Scan the JSON and return paths met one-by-one. + json_get_path_start(&p) + while (json_get_path_next(&p)) + { + handle_the_next_path(); + } +*/ + +int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs, + const uchar *str, const uchar *end, + json_path_t *p); + + +int json_get_path_next(json_engine_t *je, json_path_t *p); + + +int json_path_compare(const json_path_t *a, const json_path_t *b); + + #ifdef __cplusplus } #endif -- cgit v1.2.1