CUBRID Engine
latest
|
#include "db_json.hpp"
#include "db_json_path.hpp"
#include "db_json_types_internal.hpp"
#include "db_rapidjson.hpp"
#include "dbtype.h"
#include "memory_alloc.h"
#include "memory_private_allocator.hpp"
#include "object_primitive.h"
#include "object_representation.h"
#include "porting_inline.hpp"
#include "query_dump.h"
#include "string_opfunc.h"
#include "system_parameter.h"
#include <algorithm>
#include <sstream>
#include <stack>
Go to the source code of this file.
Classes | |
class | JSON_ITERATOR |
class | JSON_OBJECT_ITERATOR |
class | JSON_ARRAY_ITERATOR |
class | JSON_VALIDATOR |
class | JSON_BASE_HANDLER |
class | JSON_WALKER |
class | JSON_DUPLICATE_KEYS_CHECKER |
class | JSON_PATH_MAPPER |
class | JSON_SERIALIZER_LENGTH |
class | JSON_SERIALIZER |
class | JSON_PRETTY_WRITER |
struct | JSON_PRETTY_WRITER::level_context |
Namespaces | |
cubmem | |
Macros | |
#define | TODO_OPTIMIZE_JSON_BODY_STRING true |
Typedefs | |
typedef rapidjson::GenericStringBuffer< JSON_ENCODING, JSON_PRIVATE_ALLOCATOR > | JSON_STRING_BUFFER |
typedef rapidjson::GenericMemberIterator< true, JSON_ENCODING, JSON_PRIVATE_MEMPOOL >::Iterator | JSON_MEMBER_ITERATOR |
typedef rapidjson::GenericArray< true, JSON_VALUE >::ConstValueIterator | JSON_VALUE_ITERATOR |
typedef std::function< int(const JSON_VALUE &, const JSON_PATH &, bool &)> | map_func_type |
#define TODO_OPTIMIZE_JSON_BODY_STRING true |
Definition at line 75 of file db_json.cpp.
typedef rapidjson::GenericMemberIterator<true, JSON_ENCODING, JSON_PRIVATE_MEMPOOL>::Iterator JSON_MEMBER_ITERATOR |
Definition at line 89 of file db_json.cpp.
typedef rapidjson::GenericStringBuffer<JSON_ENCODING, JSON_PRIVATE_ALLOCATOR> JSON_STRING_BUFFER |
Definition at line 88 of file db_json.cpp.
typedef rapidjson::GenericArray<true, JSON_VALUE>::ConstValueIterator JSON_VALUE_ITERATOR |
Definition at line 90 of file db_json.cpp.
typedef std::function<int (const JSON_VALUE &, const JSON_PATH &, bool &)> map_func_type |
Definition at line 92 of file db_json.cpp.
|
static |
Definition at line 1538 of file db_json.cpp.
References NULL.
Referenced by db_accumulate_json_arrayagg(), db_evaluate_json_array(), db_evaluate_json_search(), and db_json_extract_document_from_path().
void db_json_add_element_to_array | ( | JSON_DOC * | doc, |
char * | value | ||
) |
Definition at line 1465 of file db_json.cpp.
References strlen.
void db_json_add_element_to_array | ( | JSON_DOC * | doc, |
int | value | ||
) |
Definition at line 1484 of file db_json.cpp.
void db_json_add_element_to_array | ( | JSON_DOC * | doc, |
std::int64_t | value | ||
) |
Definition at line 1495 of file db_json.cpp.
void db_json_add_element_to_array | ( | JSON_DOC * | doc, |
double | value | ||
) |
Definition at line 1506 of file db_json.cpp.
Definition at line 1517 of file db_json.cpp.
References NULL.
|
static |
Definition at line 1386 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_JSON_DUPLICATE_KEY, er_set(), NO_ERROR, and strlen.
Referenced by db_json_add_member_to_object().
Definition at line 1408 of file db_json.cpp.
References db_json_add_json_value_to_object(), and strlen.
Referenced by db_accumulate_json_objectagg(), and db_evaluate_json_object().
Definition at line 1418 of file db_json.cpp.
References db_json_add_json_value_to_object().
Definition at line 1428 of file db_json.cpp.
References db_json_add_json_value_to_object().
Definition at line 1438 of file db_json.cpp.
References db_json_add_json_value_to_object(), and NULL.
Definition at line 1455 of file db_json.cpp.
References db_json_add_json_value_to_object().
JSON_DOC* db_json_allocate_doc | ( | ) |
Definition at line 2332 of file db_json.cpp.
Referenced by db_evaluate_json_get_all_paths(), db_json_deserialize(), db_json_get_copy_of_doc(), db_json_get_json_from_str(), db_json_merge_patch_func(), db_json_merge_preserve_func(), JSON_ITERATOR::get_value_to_doc(), qdata_evaluate_aggregate_list(), and tp_value_cast_internal().
Definition at line 3122 of file db_json.cpp.
References NULL.
bool db_json_are_validators_equal | ( | JSON_VALIDATOR * | val1, |
JSON_VALIDATOR * | val2 | ||
) |
Definition at line 2401 of file db_json.cpp.
References JSON_VALIDATOR::get_schema_raw(), and NULL.
Referenced by tp_domain_match_internal(), and tp_is_domain_cached().
Definition at line 2042 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_er_set_path_does_not_exist(), db_json_get_type_of_value(), db_json_value_wrap_as_array(), ER_FAILED, JSON_PATH::get(), JSON_PATH::get_parent(), JSON_PATH::is_last_array_index_less_than(), JSON_PATH::is_last_token_array_index_zero(), JSON_PATH::is_root_path(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), JSON_PATH::parse(), and JSON_PATH::points_to_array_cell().
Referenced by db_evaluate_json_array_append().
Definition at line 2124 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_er_set_path_does_not_exist(), db_json_value_wrap_as_array(), JSON_PATH::dump_json_path(), ER_ERROR_SEVERITY, ER_FAILED, ER_JSON_PATH_IS_NOT_ARRAY_CELL, er_set(), JSON_PATH::get(), PATH_TOKEN::get_array_index(), JSON_PATH::get_last_token(), JSON_PATH::get_parent(), i, JSON_PATH::is_last_array_index_less_than(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), JSON_PATH::parse(), JSON_PATH::points_to_array_cell(), and JSON_PATH::set().
Referenced by db_evaluate_json_array_insert().
|
static |
Definition at line 2275 of file db_json.cpp.
References assert.
Referenced by db_json_merge_preserve_values().
|
static |
Definition at line 2682 of file db_json.cpp.
References db_private_strdup(), and NULL.
Referenced by db_json_get_bool_as_str_from_value().
void db_json_clear_json_iterator | ( | JSON_ITERATOR *& | json_itr | ) |
Definition at line 985 of file db_json.cpp.
References JSON_ITERATOR::clear_content(), and NULL.
Referenced by cubxasl::json_table::node::clear_iterators().
Definition at line 1565 of file db_json.cpp.
References ASSERT_ERROR, NO_ERROR, and JSON_WALKER::WalkDocument().
Referenced by db_json_get_json_from_str().
int db_json_contains_path | ( | const JSON_DOC * | document, |
const std::vector< std::string > & | paths, | ||
bool | find_all, | ||
bool & | result | ||
) |
Definition at line 1265 of file db_json.cpp.
References ASSERT_ERROR, i, JSON_PATH::match_pattern(), NO_ERROR, NULL, and JSON_WALKER::WalkDocument().
Referenced by db_evaluate_json_contains_path(), and cubxasl::json_table::column::evaluate_exists().
Definition at line 1643 of file db_json.cpp.
References db_json_get_type().
Referenced by db_json_merge_patch_func(), and db_json_merge_preserve_func().
Definition at line 2561 of file db_json.cpp.
References db_json_copy_string_from_value().
|
static |
Definition at line 2669 of file db_json.cpp.
References assert, db_json_get_type_of_value(), db_private_strdup(), and NULL.
Referenced by db_json_copy_string_from_document().
JSON_VALIDATOR* db_json_copy_validator | ( | JSON_VALIDATOR * | validator | ) |
Definition at line 2382 of file db_json.cpp.
References JSON_VALIDATOR::JSON_VALIDATOR().
Referenced by tp_domain_copy().
JSON_ITERATOR* db_json_create_iterator | ( | const DB_JSON_TYPE & | type | ) |
Definition at line 963 of file db_json.cpp.
References NULL.
Referenced by cubxasl::json_table::node::init_iterator().
void db_json_delete_doc | ( | JSON_DOC *& | doc | ) |
Definition at line 2355 of file db_json.cpp.
References NULL.
Referenced by JSON_ITERATOR::clear_content(), db_json_deserialize(), mr_data_readmem_json(), mr_freemem_json(), pr_clear_value(), and tp_value_cast_internal().
void db_json_delete_json_iterator | ( | JSON_ITERATOR *& | json_itr | ) |
Definition at line 978 of file db_json.cpp.
References NULL.
Referenced by cubxasl::json_table::node::clear_iterators().
void db_json_delete_validator | ( | JSON_VALIDATOR *& | validator | ) |
Definition at line 2394 of file db_json.cpp.
References NULL.
Referenced by tp_domain_free().
Definition at line 4266 of file db_json.cpp.
References ASSERT_ERROR, db_json_allocate_doc(), db_json_delete_doc(), db_json_deserialize_doc_internal(), db_json_doc_to_value(), and NO_ERROR.
Referenced by mr_data_cmpdisk_json(), mr_data_readmem_json(), and mr_data_readval_json().
|
static |
Definition at line 4197 of file db_json.cpp.
References assert, ASSERT_ERROR, db_json_unpack_array_to_value(), db_json_unpack_bigint_to_value(), db_json_unpack_bool_to_value(), db_json_unpack_double_to_value(), db_json_unpack_int_to_value(), db_json_unpack_object_to_value(), db_json_unpack_string_to_value(), ER_FAILED, NO_ERROR, or_get_int(), and rc.
Referenced by db_json_deserialize(), db_json_unpack_array_to_value(), and db_json_unpack_object_to_value().
Definition at line 3141 of file db_json.cpp.
References db_json_value_has_numeric_type().
Definition at line 3147 of file db_json.cpp.
References db_json_get_type().
Referenced by mr_cmpval_json().
|
static |
Definition at line 2729 of file db_json.cpp.
References db_json_get_json_type_as_str(), JSON_PATH::dump_json_path(), ER_ERROR_SEVERITY, ER_JSON_EXPECTED_OTHER_TYPE, and er_set().
Referenced by db_json_insert_func(), and db_json_set_func().
|
static |
Definition at line 2715 of file db_json.cpp.
References db_json_get_raw_json_body_from_document(), JSON_PATH::dump_json_path(), ER_ERROR_SEVERITY, ER_JSON_PATH_DOES_NOT_EXIST, er_set(), and NULL.
Referenced by db_json_array_append_func(), db_json_array_insert_func(), db_json_insert_func(), db_json_keys_func(), db_json_remove_func(), db_json_replace_func(), and db_json_set_func().
int db_json_extract_document_from_path | ( | const JSON_DOC * | document, |
const std::string & | path, | ||
JSON_DOC_STORE & | result, | ||
bool | allow_wildcards | ||
) |
Definition at line 1153 of file db_json.cpp.
Referenced by db_evaluate_json_contains(), db_evaluate_json_extract(), db_evaluate_json_length(), cubxasl::json_table::column::evaluate_extract(), and cubscan::json_table::scanner::set_input_document().
int db_json_extract_document_from_path | ( | const JSON_DOC * | document, |
const std::vector< std::string > & | paths, | ||
JSON_DOC_STORE & | result, | ||
bool | allow_wildcards | ||
) |
Definition at line 1171 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_add_element_to_array(), ER_ERROR_SEVERITY, ER_JSON_INVALID_PATH, er_set(), i, NO_ERROR, NULL, and p.
Definition at line 2852 of file db_json.cpp.
References db_json_get_paths_helper(), JSON_PATH::get(), NO_ERROR, and p.
Referenced by db_evaluate_json_get_all_paths().
Definition at line 2531 of file db_json.cpp.
References db_json_get_bigint_from_value().
Referenced by db_convert_json_into_scalar(), and tp_value_cast_internal().
|
static |
Definition at line 2626 of file db_json.cpp.
References assert, db_json_get_type_of_value(), and NULL.
Referenced by db_json_get_bigint_from_document(), and db_json_value_is_contained_in_doc_helper().
Definition at line 2549 of file db_json.cpp.
References db_json_get_bool_as_str_from_value().
Referenced by db_convert_json_into_scalar(), and tp_value_cast_internal().
|
static |
Definition at line 2688 of file db_json.cpp.
References db_json_bool_to_string(), and db_json_get_bool_from_value().
Referenced by db_json_get_bool_as_str_from_document().
Definition at line 2555 of file db_json.cpp.
References db_json_get_bool_from_value().
Referenced by tp_value_cast_internal().
|
static |
Definition at line 2694 of file db_json.cpp.
References assert, db_json_get_type_of_value(), and NULL.
Referenced by db_json_get_bool_as_str_from_value(), and db_json_get_bool_from_document().
Definition at line 1627 of file db_json.cpp.
References db_json_allocate_doc().
Referenced by db_get_deep_copy_of_json(), db_value_to_json_doc(), and mr_setval_json().
Definition at line 1079 of file db_json.cpp.
References db_json_value_get_depth().
Referenced by db_evaluate_json_depth().
Definition at line 2537 of file db_json.cpp.
References db_json_get_double_from_value().
Referenced by db_convert_json_into_scalar(), and tp_value_cast_internal().
|
static |
Definition at line 2640 of file db_json.cpp.
References assert, db_json_get_type_of_value(), and NULL.
Referenced by db_json_get_double_from_document(), and db_json_value_is_contained_in_doc_helper().
Definition at line 2525 of file db_json.cpp.
References db_json_get_int_from_value().
Referenced by db_convert_json_into_scalar(), and tp_value_cast_internal().
|
static |
Definition at line 2612 of file db_json.cpp.
References assert, db_json_get_type_of_value(), and NULL.
Referenced by db_json_get_int_from_document(), and db_json_value_is_contained_in_doc_helper().
Definition at line 1370 of file db_json.cpp.
References db_json_get_raw_json_body_from_document().
Referenced by db_get_json_raw_body(), mr_cmpval_json(), and pt_bind_helper().
|
static |
Definition at line 1581 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_json_contains_duplicate_keys(), ER_ERROR_SEVERITY, ER_JSON_INVALID_JSON, er_set(), NO_ERROR, and NULL.
Referenced by db_json_get_json_from_str(), db_json_json_string_as_utf8(), and db_value_to_json_doc().
Definition at line 1608 of file db_json.cpp.
References assert, db_json_allocate_doc(), db_json_get_json_from_str(), err, NO_ERROR, and NULL.
Referenced by db_evaluate_json_search(), db_json_val_from_str(), ldr_json_elem(), pt_db_value_initialize(), cubload::to_db_json(), and tp_value_cast_internal().
Definition at line 1012 of file db_json.cpp.
Referenced by db_json_er_set_expected_other_type(), and db_json_get_type_as_str().
Definition at line 1046 of file db_json.cpp.
Referenced by db_evaluate_json_length().
|
static |
Definition at line 2817 of file db_json.cpp.
References cubregex::count().
Referenced by db_json_get_all_paths_func().
Definition at line 1357 of file db_json.cpp.
References db_private_strdup(), and NULL.
Referenced by db_json_er_set_path_does_not_exist(), db_json_get_json_body_from_document(), db_json_unquote(), tp_value_cast_internal(), and cubxasl::json_table::column::trigger_on_error().
const char* db_json_get_schema_raw_from_validator | ( | JSON_VALIDATOR * | val | ) |
Definition at line 2310 of file db_json.cpp.
References JSON_VALIDATOR::get_schema_raw(), and NULL.
Referenced by db_domain_raw_json_schema(), object_printer::describe_domain(), domain_size(), domain_to_disk(), or_packed_json_validator_length(), or_put_json_validator(), pt_domain_to_data_type(), and qexec_schema_get_type_desc().
Definition at line 2543 of file db_json.cpp.
References db_json_get_string_from_value().
Referenced by db_convert_json_into_scalar(), and tp_value_cast_internal().
|
static |
Definition at line 2655 of file db_json.cpp.
References assert, db_json_get_type_of_value(), and NULL.
Referenced by db_json_get_string_from_document().
Definition at line 2519 of file db_json.cpp.
References db_json_get_type_of_value().
Referenced by db_convert_json_into_scalar(), db_evaluate_json_extract(), db_json_copy_doc(), db_json_doc_is_uncomparable(), mr_cmpval_json(), cubscan::json_table::scanner::cursor::start_json_iterator(), and tp_value_cast_internal().
Definition at line 1002 of file db_json.cpp.
References assert, db_json_doc_to_value(), db_json_get_json_type_as_str(), db_json_get_type_of_value(), and NULL.
Referenced by db_evaluate_json_type_dbval().
DB_JSON_TYPE db_json_get_type_of_value | ( | const JSON_VALUE * | val | ) |
Definition at line 2567 of file db_json.cpp.
References NULL.
Referenced by db_json_array_append_func(), db_json_copy_string_from_value(), db_json_get_bigint_from_value(), db_json_get_bool_from_value(), db_json_get_double_from_value(), db_json_get_int_from_value(), db_json_get_string_from_value(), db_json_get_type(), db_json_get_type_as_str(), db_json_insert_func(), db_json_set_func(), db_json_value_has_numeric_type(), and db_json_value_is_contained_in_doc_helper().
Definition at line 1665 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_er_set_expected_other_type(), db_json_er_set_path_does_not_exist(), db_json_get_type_of_value(), db_json_value_wrap_as_array(), ER_FAILED, JSON_PATH::get(), JSON_PATH::get_parent(), JSON_PATH::is_last_array_index_less_than(), JSON_PATH::is_last_token_array_index_zero(), JSON_PATH::is_root_path(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), JSON_PATH::parse(), JSON_PATH::points_to_array_cell(), and JSON_PATH::set().
Referenced by db_evaluate_json_insert().
Definition at line 994 of file db_json.cpp.
References db_json_validate_json(), error(), and NO_ERROR.
Referenced by db_evaluate_json_valid().
const JSON_DOC* db_json_iterator_get_document | ( | JSON_ITERATOR & | json_itr | ) |
Definition at line 930 of file db_json.cpp.
References JSON_ITERATOR::get_value_to_doc().
Referenced by cubscan::json_table::scanner::cursor::fetch_row().
bool db_json_iterator_has_next | ( | JSON_ITERATOR & | json_itr | ) |
Definition at line 936 of file db_json.cpp.
References JSON_ITERATOR::has_next().
Referenced by cubscan::json_table::scanner::cursor::advance_row_cursor().
bool db_json_iterator_is_empty | ( | const JSON_ITERATOR & | json_itr | ) |
Definition at line 957 of file db_json.cpp.
References JSON_ITERATOR::is_empty().
void db_json_iterator_next | ( | JSON_ITERATOR & | json_itr | ) |
Definition at line 924 of file db_json.cpp.
References JSON_ITERATOR::next().
Referenced by cubscan::json_table::scanner::cursor::advance_row_cursor().
std::string db_json_json_string_as_utf8 | ( | std::string | raw_json_string | ) |
Definition at line 2893 of file db_json.cpp.
References assert, db_json_get_json_from_str(), and NO_ERROR.
Referenced by db_json_search_func(), JSON_PATH::erase(), JSON_PATH::extract_from_subtree(), JSON_PATH::get(), and JSON_PATH::set().
Definition at line 2919 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_json_er_set_path_does_not_exist(), JSON_PATH::get(), NO_ERROR, NULL, p, and JSON_PATH::parse().
Referenced by db_evaluate_json_keys().
int db_json_load_validator | ( | const char * | json_schema_raw, |
JSON_VALIDATOR *& | validator | ||
) |
Definition at line 2362 of file db_json.cpp.
References assert, JSON_VALIDATOR::JSON_VALIDATOR(), JSON_VALIDATOR::load(), NO_ERROR, and NULL.
Referenced by disk_to_domain2(), or_get_json_validator(), pt_data_type_to_db_domain(), pt_node_data_type_to_db_domain(), tp_domain_resolve_value(), and unpack_domain().
void db_json_make_document_null | ( | JSON_DOC * | doc | ) |
Definition at line 3132 of file db_json.cpp.
References NULL.
Referenced by db_value_to_json_doc(), and db_value_to_json_value().
JSON_DOC* db_json_make_json_array | ( | ) |
Definition at line 2347 of file db_json.cpp.
Referenced by db_evaluate_json_array().
JSON_DOC* db_json_make_json_object | ( | ) |
Definition at line 2339 of file db_json.cpp.
Referenced by db_evaluate_json_object().
Definition at line 2469 of file db_json.cpp.
References db_json_allocate_doc(), db_json_copy_doc(), db_json_doc_to_value(), db_json_merge_patch_values(), NO_ERROR, and NULL.
Referenced by db_evaluate_json_merge_patch().
|
static |
Definition at line 2438 of file db_json.cpp.
References db_json_merge_two_json_objects_patch().
Referenced by db_json_merge_patch_func(), and db_json_merge_two_json_objects_patch().
Definition at line 2501 of file db_json.cpp.
References db_json_allocate_doc(), db_json_copy_doc(), db_json_doc_to_value(), db_json_merge_preserve_values(), NO_ERROR, and NULL.
Referenced by db_evaluate_json_merge_preserve().
|
static |
Definition at line 2414 of file db_json.cpp.
References db_json_array_push_back(), db_json_merge_two_json_array_values(), db_json_merge_two_json_objects_preserve(), and db_json_value_wrap_as_array().
Referenced by db_json_merge_preserve_func(), and db_json_merge_two_json_objects_preserve().
|
static |
Definition at line 2258 of file db_json.cpp.
References assert.
Referenced by db_json_merge_preserve_values().
|
static |
Definition at line 2186 of file db_json.cpp.
References assert, db_json_merge_patch_values(), and db_json_object_add_member().
Referenced by db_json_merge_patch_values().
|
static |
Definition at line 2229 of file db_json.cpp.
References assert, db_json_merge_preserve_values(), and db_json_object_add_member().
Referenced by db_json_merge_preserve_values().
int db_json_normalize_path_string | ( | const char * | pointer_path, |
std::string & | output | ||
) |
Definition at line 2749 of file db_json.cpp.
References ASSERT_ERROR, JSON_PATH::dump_json_path(), NO_ERROR, and JSON_PATH::parse().
Referenced by pt_normalize_path().
|
static |
Definition at line 2287 of file db_json.cpp.
References assert.
Referenced by db_json_merge_two_json_objects_patch(), and db_json_merge_two_json_objects_preserve().
Definition at line 2297 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_JSON_NO_JSON_OBJECT_PROVIDED, er_set(), and NO_ERROR.
|
static |
Definition at line 3966 of file db_json.cpp.
References or_buf::endptr, NO_ERROR, or_underflow(), and or_buf::ptr.
Referenced by db_json_unpack_string_to_value().
Definition at line 2776 of file db_json.cpp.
Referenced by pt_make_json_table_spec_node_internal().
int db_json_path_unquote_object_keys_external | ( | std::string & | sql_path | ) |
Definition at line 2765 of file db_json.cpp.
References db_json_path_unquote_object_keys().
Referenced by db_evaluate_json_search().
Definition at line 2881 of file db_json.cpp.
References assert, db_private_strdup(), NULL, and JSON_PRETTY_WRITER::ToString().
Referenced by db_evaluate_json_pretty().
Definition at line 1911 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_json_er_set_path_does_not_exist(), ER_ERROR_SEVERITY, ER_JSON_INVALID_PATH, er_set(), JSON_PATH::erase(), JSON_PATH::get(), JSON_PATH::get_parent(), JSON_PATH::is_last_token_array_index_zero(), JSON_PATH::is_root_path(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), and JSON_PATH::parse().
Referenced by db_evaluate_json_remove().
Definition at line 1743 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_er_set_path_does_not_exist(), ER_FAILED, JSON_PATH::get(), JSON_PATH::get_parent(), JSON_PATH::is_last_array_index_less_than(), JSON_PATH::is_last_token_array_index_zero(), JSON_PATH::is_root_path(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), JSON_PATH::parse(), JSON_PATH::points_to_array_cell(), and JSON_PATH::set().
Referenced by db_evaluate_json_replace().
void db_json_reset_iterator | ( | JSON_ITERATOR *& | json_itr | ) |
Definition at line 948 of file db_json.cpp.
References NULL, and JSON_ITERATOR::reset().
Referenced by cubscan::json_table::scanner::cursor::end().
int db_json_search_func | ( | const JSON_DOC & | doc, |
const DB_VALUE * | pattern, | ||
const DB_VALUE * | esc_char, | ||
std::vector< JSON_PATH > & | paths, | ||
const std::vector< std::string > & | patterns, | ||
bool | find_all | ||
) |
Definition at line 1961 of file db_json.cpp.
References db_get_string(), db_json_json_string_as_utf8(), db_make_string(), db_private_free, db_string_escape_str(), db_string_like(), db_string_put_cs_and_collation(), i, INTL_CODESET_UTF8, LANG_COLL_UTF8_BINARY, JSON_PATH::match_pattern(), NO_ERROR, NULL, and JSON_WALKER::WalkDocument().
Referenced by db_evaluate_json_search().
Definition at line 3931 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, and NO_ERROR.
Referenced by mr_data_writemem_json(), and mr_data_writeval_json().
Definition at line 3946 of file db_json.cpp.
References JSON_SERIALIZER_LENGTH::GetLength().
Referenced by mr_data_lengthmem_json(), and mr_data_lengthval_json().
void db_json_set_bigint_to_doc | ( | JSON_DOC * | doc, |
std::int64_t | i | ||
) |
Definition at line 3116 of file db_json.cpp.
Referenced by tp_value_cast_internal().
void db_json_set_double_to_doc | ( | JSON_DOC * | doc, |
double | d | ||
) |
Definition at line 3104 of file db_json.cpp.
Referenced by tp_value_cast_internal().
Definition at line 1838 of file db_json.cpp.
References ARG_FILE_LINE, assert, ASSERT_ERROR, db_json_er_set_expected_other_type(), db_json_er_set_path_does_not_exist(), db_json_get_type_of_value(), db_json_value_wrap_as_array(), ER_FAILED, JSON_PATH::get(), JSON_PATH::get_parent(), JSON_PATH::is_last_token_array_index_zero(), NO_ERROR, NULL, p, JSON_PATH::parent_exists(), JSON_PATH::parse(), JSON_PATH::points_to_array_cell(), and JSON_PATH::set().
Referenced by db_evaluate_json_set().
void db_json_set_int_to_doc | ( | JSON_DOC * | doc, |
int | i | ||
) |
Definition at line 3110 of file db_json.cpp.
Referenced by tp_value_cast_internal().
void db_json_set_iterator | ( | JSON_ITERATOR *& | json_itr, |
const JSON_DOC & | new_doc | ||
) |
Definition at line 942 of file db_json.cpp.
References JSON_ITERATOR::set().
Referenced by cubscan::json_table::scanner::cursor::start_json_iterator().
Definition at line 3098 of file db_json.cpp.
Referenced by db_value_to_json_value().
|
static |
Definition at line 4154 of file db_json.cpp.
References ARG_FILE_LINE, db_json_deserialize_doc_internal(), ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, i, NO_ERROR, or_get_int(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 4044 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, NO_ERROR, or_get_bigint(), or_get_int(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 4091 of file db_json.cpp.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, NO_ERROR, or_get_int(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 4072 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, NO_ERROR, or_get_double(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 4016 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, NO_ERROR, or_get_int(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 4111 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_json_deserialize_doc_internal(), db_json_unpack_string_to_value(), ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, i, NO_ERROR, or_get_int(), and rc.
Referenced by db_json_deserialize_doc_internal().
|
static |
Definition at line 3977 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_json_or_buf_underflow(), ER_ERROR_SEVERITY, er_set(), ER_TF_BUFFER_OVERFLOW, INT_ALIGNMENT, NO_ERROR, or_align(), or_get_int(), or_buf::ptr, and rc.
Referenced by db_json_deserialize_doc_internal(), and db_json_unpack_object_to_value().
Definition at line 1090 of file db_json.cpp.
References assert, db_json_get_raw_json_body_from_document(), db_private_strdup(), ER_OUT_OF_VIRTUAL_MEMORY, NO_ERROR, and NULL.
Referenced by db_evaluate_json_unquote().
int db_json_validate_doc | ( | JSON_VALIDATOR * | validator, |
JSON_DOC * | doc | ||
) |
Definition at line 2388 of file db_json.cpp.
References JSON_VALIDATOR::validate().
Referenced by tp_value_cast_internal().
int db_json_validate_json | ( | const char * | json_body | ) |
Definition at line 2316 of file db_json.cpp.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_JSON_INVALID_JSON, er_set(), and NO_ERROR.
Referenced by db_json_is_valid(), pt_bind_helper(), and pt_dbval_to_value().
|
static |
Definition at line 1111 of file db_json.cpp.
References max.
Referenced by db_json_get_depth().
|
static |
Definition at line 2953 of file db_json.cpp.
References db_json_get_type_of_value().
Referenced by db_json_doc_has_numeric_type(), and db_json_value_is_contained_in_doc_helper().
int db_json_value_is_contained_in_doc | ( | const JSON_DOC * | doc, |
const JSON_DOC * | value, | ||
bool & | result | ||
) |
Definition at line 2976 of file db_json.cpp.
References db_json_value_is_contained_in_doc_helper().
Referenced by db_evaluate_json_contains().
|
static |
Definition at line 2982 of file db_json.cpp.
References db_json_get_bigint_from_value(), db_json_get_double_from_value(), db_json_get_int_from_value(), db_json_get_type_of_value(), db_json_value_has_numeric_type(), and NO_ERROR.
Referenced by db_json_value_is_contained_in_doc().
|
static |
Definition at line 3339 of file db_json.cpp.
Referenced by db_json_array_append_func(), db_json_array_insert_func(), db_json_insert_func(), db_json_merge_preserve_values(), and db_json_set_func().
void db_make_json_from_doc_store_and_release | ( | DB_VALUE & | value, |
JSON_DOC_STORE & | doc_store | ||
) |
Definition at line 3333 of file db_json.cpp.
References db_make_json().
Referenced by db_accumulate_json_arrayagg(), db_accumulate_json_objectagg(), db_evaluate_json_array(), db_evaluate_json_array_append(), db_evaluate_json_array_insert(), db_evaluate_json_extract(), db_evaluate_json_insert(), db_evaluate_json_keys(), db_evaluate_json_merge_patch(), db_evaluate_json_merge_preserve(), db_evaluate_json_object(), db_evaluate_json_remove(), db_evaluate_json_replace(), db_evaluate_json_search(), db_evaluate_json_set(), and cubxasl::json_table::column::evaluate_extract().
Definition at line 3183 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_value::data, db_get_string(), db_get_string_size(), db_json_copy_and_convert_to_utf8(), db_json_get_copy_of_doc(), db_json_get_json_from_str(), db_json_make_document_null(), DB_TYPE_CHAR, DB_TYPE_JSON, DB_TYPE_NCHAR, DB_TYPE_NULL, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, db_value_domain_type(), db_value_is_null(), db_json::document, ER_ERROR_SEVERITY, ER_JSON_EXPECTING_JSON_DOC, er_set(), db_data::json, NO_ERROR, NULL, pr_clear_value(), and pr_type_name().
Referenced by db_evaluate_json_array_append(), db_evaluate_json_array_insert(), db_evaluate_json_contains(), db_evaluate_json_contains_path(), db_evaluate_json_depth(), db_evaluate_json_extract(), db_evaluate_json_get_all_paths(), db_evaluate_json_insert(), db_evaluate_json_keys(), db_evaluate_json_length(), db_evaluate_json_merge_patch(), db_evaluate_json_merge_preserve(), db_evaluate_json_pretty(), db_evaluate_json_remove(), db_evaluate_json_replace(), db_evaluate_json_search(), db_evaluate_json_set(), db_evaluate_json_type_dbval(), db_evaluate_json_unquote(), and cubscan::json_table::scanner::open().
Definition at line 3309 of file db_json.cpp.
References ARG_FILE_LINE, db_get_string(), db_get_string_size(), DB_IS_STRING, db_make_null(), DOMAIN_COMPATIBLE, ER_ERROR_SEVERITY, ER_QSTR_INVALID_DATA_TYPE, er_set(), NO_ERROR, pr_clear_value(), tp_String_domain, and tp_value_cast().
Referenced by db_accumulate_json_objectagg(), and db_evaluate_json_object().
Definition at line 3163 of file db_json.cpp.
References ARG_FILE_LINE, db_get_string(), db_get_string_size(), db_value_domain_type(), ER_ARG_CAN_NOT_BE_CASTED_TO_DESIRED_DOMAIN, ER_ERROR_SEVERITY, er_set(), fcode_get_uppercase_name(), NO_ERROR, and TP_IS_CHAR_TYPE.
Referenced by db_evaluate_json_array_append(), db_evaluate_json_array_insert(), db_evaluate_json_contains(), db_evaluate_json_contains_path(), db_evaluate_json_extract(), db_evaluate_json_insert(), db_evaluate_json_keys(), db_evaluate_json_length(), db_evaluate_json_remove(), db_evaluate_json_replace(), db_evaluate_json_search(), and db_evaluate_json_set().
Definition at line 3254 of file db_json.cpp.
References ARG_FILE_LINE, ASSERT_ERROR, db_get_enum_string(), db_get_enum_string_size(), db_get_json_document(), db_get_string(), db_get_string_size(), db_json_copy_and_convert_to_utf8(), db_json_make_document_null(), db_json_set_string_to_doc(), DB_TYPE_CHAR, DB_TYPE_ENUMERATION, DB_TYPE_NCHAR, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, DB_VALUE_DOMAIN_TYPE, db_value_is_null(), DOMAIN_COMPATIBLE, ER_ERROR_SEVERITY, ER_QSTR_INVALID_DATA_TYPE, er_set(), NO_ERROR, pr_clear_value(), tp_Json_domain, and tp_value_cast().
Referenced by db_accumulate_json_arrayagg(), db_accumulate_json_objectagg(), db_evaluate_json_array(), db_evaluate_json_array_append(), db_evaluate_json_array_insert(), db_evaluate_json_insert(), db_evaluate_json_object(), db_evaluate_json_replace(), and db_evaluate_json_set().