MySQL 8.0.39
Source Code Documentation
|
This file contains interface support for the JSON path abstraction. More...
#include <assert.h>
#include <stddef.h>
#include <algorithm>
#include <functional>
#include <new>
#include <string>
#include <utility>
#include "my_alloc.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "prealloced_array.h"
#include "sql-common/json_error_handler.h"
Go to the source code of this file.
Classes | |
class | Json_array_index |
A class that represents the index of an element in a JSON array. More... | |
class | Json_path_leg |
One path leg in a JSON path expression. More... | |
struct | Json_path_leg::Array_range |
A structure that represents an array range. More... | |
class | Json_seekable_path |
A path expression which can be used to seek to a position inside a JSON value. More... | |
class | Json_path |
A JSON path expression. More... | |
class | Json_path_clone |
A lightweight path expression. More... | |
Typedefs | |
using | Json_path_leg_pointers = Prealloced_array< const Json_path_leg *, 8 > |
using | Json_path_iterator = Json_path_leg_pointers::const_iterator |
Enumerations | |
enum | enum_json_path_leg_type { jpl_member , jpl_array_cell , jpl_array_range , jpl_member_wildcard , jpl_array_cell_wildcard , jpl_ellipsis } |
The type of a Json_path_leg. More... | |
Functions | |
bool | parse_path (size_t path_length, const char *path_expression, Json_path *path, size_t *bad_index, const JsonDocumentDepthHandler &depth_handler) |
Initialize a Json_path from a path expression. More... | |
bool | parse_path (const String &path_value, bool forbid_wildcards, Json_path *json_path) |
A helper function that uses the above one as workhorse. More... | |
This file contains interface support for the JSON path abstraction.
The path abstraction is described by the functional spec attached to WL#7909.
using Json_path_leg_pointers = Prealloced_array<const Json_path_leg *, 8> |
The type of a Json_path_leg.
A helper function that uses the above one as workhorse.
Entry point for for JSON_TABLE (Table_function_json class) and Json_path_cache. Raises an error if the path expression is syntactically incorrect. Raises an error if the path expression contains wildcard tokens but is not supposed to. Otherwise updates the supplied Json_path object with the parsed path.
[in] | path_value | A String to be interpreted as a path. |
[in] | forbid_wildcards | True if the path shouldn't contain * or ** |
[out] | json_path | The object that will hold the parsed path |
bool parse_path | ( | size_t | path_length, |
const char * | path_expression, | ||
Json_path * | path, | ||
size_t * | bad_index, | ||
const JsonDocumentDepthHandler & | depth_handler | ||
) |
Initialize a Json_path from a path expression.
Stops parsing on the first error. It initializes the Json_path and returns false if the path is parsed successfully. Otherwise, it returns false. In that case, the output bad_index argument will contain an index into the path expression. The parsing failed near that index.
[in] | path_length | The length of the path expression. |
[in] | path_expression | The string form of the path expression. |
[out] | path | The Json_path object to be initialized. |
[out] | bad_index | If null is returned, the parsing failed around here. |
[in] | depth_handler | Pointer to a function that should handle error occurred when depth is exceeded. |
Initialize a Json_path from a path expression.