![]() |
MySQL 9.5.0
Source Code Documentation
|
#include "sql-common/json_diff.h"#include <cassert>#include <optional>#include <utility>#include "my_alloc.h"#include "my_byteorder.h"#include "my_dbug.h"#include "my_inttypes.h"#include "my_sys.h"#include "mysql/components/services/bits/psi_bits.h"#include "mysql_com.h"#include "mysqld_error.h"#include "sql-common/json_binary.h"#include "sql-common/json_dom.h"#include "sql-common/json_error_handler.h"#include "sql-common/json_path.h"#include "sql/current_thd.h"#include "sql/log_event.h"#include "sql/psi_memory_key.h"#include "sql/sql_class.h"#include "sql/sql_const.h"#include "sql/system_variables.h"#include "sql/table.h"#include "sql_string.h"#include "template_utils.h"Functions | |
| static size_t | length_of_length_and_string (size_t length) |
| Return the total size of a data field, plus the size of the preceding integer that describes the length, when the integer is stored in net_field_length() format. More... | |
| static bool | write_length_and_string (String *to, const String &from) |
| Encode a String as (length, data) pair, with length being stored in net_field_length() format. More... | |
| optional< ReadJsonDiffResult > | read_json_diff (const unsigned char *pos, size_t length) |
| Read one JSON diff from a buffer. More... | |
| static Json_dom * | seek_exact_path (Json_dom *dom, const Json_path_iterator &first_leg, const Json_path_iterator &last_leg) |
| Find the value at the specified path in a JSON DOM. More... | |
| enum_json_diff_status | apply_json_diff (const Json_diff &diff, Json_dom *dom) |
| Apply one JSON diff to the DOM provided. More... | |
Variables | |
| static MEM_ROOT | empty_json_diff_vector_mem_root (PSI_NOT_INSTRUMENTED, 256) |
| enum_json_diff_status apply_json_diff | ( | const Json_diff & | diff, |
| Json_dom * | dom | ||
| ) |
Apply one JSON diff to the DOM provided.
| diff | The diff which contains the path to apply it and the new value. |
| dom | The DOM to apply the diff to. |
|
static |
Return the total size of a data field, plus the size of the preceding integer that describes the length, when the integer is stored in net_field_length() format.
| length | The length of the data |
| optional< ReadJsonDiffResult > read_json_diff | ( | const unsigned char * | pos, |
| size_t | length | ||
| ) |
Read one JSON diff from a buffer.
| pos | The position to start reading from in the buffer. When the function returns, it will be set to the position right after the last byte read. |
| length | The maximum number of bytes to read from the buffer. |
|
static |
Find the value at the specified path in a JSON DOM.
The path should not contain any wildcard or ellipsis, only simple array cells or member names. Auto-wrapping is not performed.
| dom | the root of the DOM |
| first_leg | the first path leg |
| last_leg | the last path leg (exclusive) |
nullptr if the path is not found Encode a String as (length, data) pair, with length being stored in net_field_length() format.
| to | Buffer where length and data will be stored. |
| from | Source string containing the data. |
|
static |