|
21 | 21 | #include "sql_parse.h" // For check_stack_overrun
|
22 | 22 | #include "json_schema_helper.h"
|
23 | 23 |
|
| 24 | +static bool get_current_value(json_engine_t *, const uchar *&, size_t &); |
| 25 | +static int check_overlaps(json_engine_t *, json_engine_t *, bool); |
| 26 | +static int json_find_overlap_with_object(json_engine_t *, json_engine_t *, bool); |
| 27 | + |
24 | 28 | /*
|
25 | 29 | Compare ASCII string against the string with the specified
|
26 | 30 | character set.
|
@@ -4307,15 +4311,15 @@ bool Item_func_json_normalize::fix_length_and_dec(THD *thd)
|
4307 | 4311 | left in the object that we no longer want to compare. In this case,
|
4308 | 4312 | we want to skip the current item.
|
4309 | 4313 | */
|
4310 |
| -void json_skip_current_level(json_engine_t *js, json_engine_t *value) |
| 4314 | +static void json_skip_current_level(json_engine_t *js, json_engine_t *value) |
4311 | 4315 | {
|
4312 | 4316 | json_skip_level(js);
|
4313 | 4317 | json_skip_level(value);
|
4314 | 4318 | }
|
4315 | 4319 |
|
4316 | 4320 |
|
4317 | 4321 | /* At least one of the two arguments is a scalar. */
|
4318 |
| -bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value) |
| 4322 | +static bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value) |
4319 | 4323 | {
|
4320 | 4324 | if (json_value_scalar(value))
|
4321 | 4325 | {
|
@@ -4367,7 +4371,7 @@ bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value)
|
4367 | 4371 | array is object, then compare the two objects entirely. If they are
|
4368 | 4372 | equal return true else return false.
|
4369 | 4373 | */
|
4370 |
| -bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t *value) |
| 4374 | +static bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t *value) |
4371 | 4375 | {
|
4372 | 4376 | st_json_engine_t loc_val= *value;
|
4373 | 4377 | while (json_scan_next(js) == 0 && js->state == JST_VALUE)
|
@@ -4415,7 +4419,7 @@ bool json_compare_arrays_in_order(json_engine_t *js, json_engine_t *value)
|
4415 | 4419 | }
|
4416 | 4420 |
|
4417 | 4421 |
|
4418 |
| -int json_find_overlap_with_array(json_engine_t *js, json_engine_t *value, |
| 4422 | +static int json_find_overlap_with_array(json_engine_t *js, json_engine_t *value, |
4419 | 4423 | bool compare_whole)
|
4420 | 4424 | {
|
4421 | 4425 | if (value->value_type == JSON_VALUE_ARRAY)
|
@@ -4500,7 +4504,9 @@ int compare_nested_object(json_engine_t *js, json_engine_t *value)
|
4500 | 4504 |
|
4501 | 4505 | return MY_TEST(result);
|
4502 | 4506 | }
|
4503 |
| -int json_find_overlap_with_object(json_engine_t *js, json_engine_t *value, |
| 4507 | + |
| 4508 | + |
| 4509 | +static int json_find_overlap_with_object(json_engine_t *js, json_engine_t *value, |
4504 | 4510 | bool compare_whole)
|
4505 | 4511 | {
|
4506 | 4512 | if (value->value_type == JSON_VALUE_OBJECT)
|
@@ -4656,7 +4662,7 @@ int json_find_overlap_with_object(json_engine_t *js, json_engine_t *value,
|
4656 | 4662 | FALSE - If two json documents do not overlap
|
4657 | 4663 | TRUE - if two json documents overlap
|
4658 | 4664 | */
|
4659 |
| -int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole) |
| 4665 | +static int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole) |
4660 | 4666 | {
|
4661 | 4667 | DBUG_EXECUTE_IF("json_check_min_stack_requirement",
|
4662 | 4668 | {
|
@@ -4984,8 +4990,8 @@ bool Item_func_json_key_value::fix_length_and_dec(THD *thd)
|
4984 | 4990 | }
|
4985 | 4991 |
|
4986 | 4992 |
|
4987 |
| -bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited, |
4988 |
| - MEM_ROOT *hash_root) |
| 4993 | +static bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited, |
| 4994 | + MEM_ROOT *hash_root) |
4989 | 4995 | {
|
4990 | 4996 | int level= value->stack_p;
|
4991 | 4997 | if (my_hash_init(PSI_INSTRUMENT_ME, items, value->s.cs, 0, 0, 0,
|
@@ -5042,8 +5048,8 @@ bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited,
|
5042 | 5048 | FALSE - The function was successfully completed without errors.
|
5043 | 5049 | TRUE - An error occurred while running.
|
5044 | 5050 | */
|
5045 |
| -bool get_current_value(json_engine_t *js, const uchar *&value_start, |
5046 |
| - size_t &value_len) |
| 5051 | +static bool get_current_value(json_engine_t *js, const uchar *&value_start, |
| 5052 | + size_t &value_len) |
5047 | 5053 | {
|
5048 | 5054 | value_start= js->value_begin;
|
5049 | 5055 |
|
@@ -5072,8 +5078,8 @@ bool get_current_value(json_engine_t *js, const uchar *&value_start,
|
5072 | 5078 | FALSE - if two array documents have intersection
|
5073 | 5079 | TRUE - If two array documents do not have intersection
|
5074 | 5080 | */
|
5075 |
| -bool get_intersect_between_arrays(String *str, json_engine_t *value, |
5076 |
| - HASH items) |
| 5081 | +static bool get_intersect_between_arrays(String *str, json_engine_t *value, |
| 5082 | + HASH items) |
5077 | 5083 | {
|
5078 | 5084 | bool res= true, has_value= false;
|
5079 | 5085 | int level= value->stack_p;
|
@@ -5228,7 +5234,7 @@ bool Item_func_json_array_intersect::fix_length_and_dec(THD *thd)
|
5228 | 5234 | }
|
5229 | 5235 |
|
5230 | 5236 |
|
5231 |
| -bool filter_keys(json_engine_t *je1, String *str, HASH items) |
| 5237 | +static bool filter_keys(json_engine_t *je1, String *str, HASH items) |
5232 | 5238 | {
|
5233 | 5239 | int level= je1->stack_p;
|
5234 | 5240 | String temp_str(0);
|
@@ -5380,7 +5386,7 @@ bool Item_func_json_object_filter_keys::fix_length_and_dec(THD *thd)
|
5380 | 5386 | return FALSE;
|
5381 | 5387 | }
|
5382 | 5388 |
|
5383 |
| -bool convert_to_array(json_engine_t *je, String *str) |
| 5389 | +static bool convert_to_array(json_engine_t *je, String *str) |
5384 | 5390 | {
|
5385 | 5391 | int level= je->stack_p;
|
5386 | 5392 | String temp_str(0);
|
|
0 commit comments