diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 57444a4446606..508ea9f644ead 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -21,6 +21,10 @@ #include "sql_parse.h" // For check_stack_overrun #include "json_schema_helper.h" +static bool get_current_value(json_engine_t *, const uchar *&, size_t &); +static int check_overlaps(json_engine_t *, json_engine_t *, bool); +static int json_find_overlap_with_object(json_engine_t *, json_engine_t *, bool); + /* Compare ASCII string against the string with the specified character set. @@ -4307,7 +4311,7 @@ bool Item_func_json_normalize::fix_length_and_dec(THD *thd) left in the object that we no longer want to compare. In this case, we want to skip the current item. */ -void json_skip_current_level(json_engine_t *js, json_engine_t *value) +static void json_skip_current_level(json_engine_t *js, json_engine_t *value) { json_skip_level(js); json_skip_level(value); @@ -4315,7 +4319,7 @@ void json_skip_current_level(json_engine_t *js, json_engine_t *value) /* At least one of the two arguments is a scalar. */ -bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value) +static bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value) { if (json_value_scalar(value)) { @@ -4367,7 +4371,7 @@ bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value) array is object, then compare the two objects entirely. If they are equal return true else return false. */ -bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t *value) +static bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t *value) { st_json_engine_t loc_val= *value; 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) } -int json_find_overlap_with_array(json_engine_t *js, json_engine_t *value, +static int json_find_overlap_with_array(json_engine_t *js, json_engine_t *value, bool compare_whole) { if (value->value_type == JSON_VALUE_ARRAY) @@ -4500,7 +4504,9 @@ int compare_nested_object(json_engine_t *js, json_engine_t *value) return MY_TEST(result); } -int json_find_overlap_with_object(json_engine_t *js, json_engine_t *value, + + +static int json_find_overlap_with_object(json_engine_t *js, json_engine_t *value, bool compare_whole) { 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, FALSE - If two json documents do not overlap TRUE - if two json documents overlap */ -int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole) +static int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole) { DBUG_EXECUTE_IF("json_check_min_stack_requirement", { @@ -4984,8 +4990,8 @@ bool Item_func_json_key_value::fix_length_and_dec(THD *thd) } -bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited, - MEM_ROOT *hash_root) +static bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited, + MEM_ROOT *hash_root) { int level= value->stack_p; 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, FALSE - The function was successfully completed without errors. TRUE - An error occurred while running. */ -bool get_current_value(json_engine_t *js, const uchar *&value_start, - size_t &value_len) +static bool get_current_value(json_engine_t *js, const uchar *&value_start, + size_t &value_len) { value_start= js->value_begin; @@ -5072,8 +5078,8 @@ bool get_current_value(json_engine_t *js, const uchar *&value_start, FALSE - if two array documents have intersection TRUE - If two array documents do not have intersection */ -bool get_intersect_between_arrays(String *str, json_engine_t *value, - HASH items) +static bool get_intersect_between_arrays(String *str, json_engine_t *value, + HASH items) { bool res= true, has_value= false; int level= value->stack_p; @@ -5228,7 +5234,7 @@ bool Item_func_json_array_intersect::fix_length_and_dec(THD *thd) } -bool filter_keys(json_engine_t *je1, String *str, HASH items) +static bool filter_keys(json_engine_t *je1, String *str, HASH items) { int level= je1->stack_p; String temp_str(0); @@ -5380,7 +5386,7 @@ bool Item_func_json_object_filter_keys::fix_length_and_dec(THD *thd) return FALSE; } -bool convert_to_array(json_engine_t *je, String *str) +static bool convert_to_array(json_engine_t *je, String *str) { int level= je->stack_p; String temp_str(0); diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 986f371df7965..42255d8d6f69f 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -48,25 +48,6 @@ void report_path_error_ex(const char *ps, json_path_t *p, void report_json_error_ex(const char *js, json_engine_t *je, const char *fname, int n_param, Sql_condition::enum_warning_level lv); -int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole); -int json_find_overlap_with_object(json_engine_t *js, - json_engine_t *value, - bool compare_whole); -void json_skip_current_level(json_engine_t *js, json_engine_t *value); -bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value); -bool json_compare_arrays_in_order_in_order(json_engine_t *js, json_engine_t *value); -bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t* value); -int json_find_overlap_with_array(json_engine_t *js, - json_engine_t *value, - bool compare_whole); - -bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited); -bool create_item(LEX_CSTRING *&new_entry, - const uchar *value_start, size_t value_len); -bool get_current_value(json_engine_t *js, const uchar *&value_start, - size_t &value_len); -bool get_intersect_between_arrays(String *str, - json_engine_t *value); class Json_engine_scan: public json_engine_t { diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index c985c305fabdc..52e3c2be4595c 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1161,7 +1161,7 @@ void setup_connection_thread_globals(THD *thd) 1 error */ -bool login_connection(THD *thd) +static bool login_connection(THD *thd) { NET *net= &thd->net; int error= 0; diff --git a/sql/sql_connect.h b/sql/sql_connect.h index 8be6c1aecc040..60841217eca45 100644 --- a/sql/sql_connect.h +++ b/sql/sql_connect.h @@ -102,7 +102,6 @@ int thd_set_peer_addr(THD *thd, sockaddr_storage *addr, bool check_proxy_networks, uint *host_errors); -bool login_connection(THD *thd); void prepare_new_connection_state(THD* thd); void end_connection(THD *thd); void update_global_user_stats(THD* thd, bool create_user, time_t now); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 081051e26de1b..6f80d54fe66d7 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -403,15 +403,6 @@ enum enum_sp_data_access SP_MODIFIES_SQL_DATA }; -const LEX_CSTRING sp_data_access_name[]= -{ - { STRING_WITH_LEN("") }, - { STRING_WITH_LEN("CONTAINS SQL") }, - { STRING_WITH_LEN("NO SQL") }, - { STRING_WITH_LEN("READS SQL DATA") }, - { STRING_WITH_LEN("MODIFIES SQL DATA") } -}; - #define DERIVED_SUBQUERY 1 #define DERIVED_VIEW 2 #define DERIVED_WITH 4 diff --git a/sql/sql_show.cc b/sql/sql_show.cc index de02f1b543923..37e2f789a36a0 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -121,6 +121,14 @@ static const LEX_CSTRING trg_event_type_names[]= { STRING_WITH_LEN("DELETE") } }; +static const LEX_CSTRING sp_data_access_name[]= +{ + { STRING_WITH_LEN("") }, + { STRING_WITH_LEN("CONTAINS SQL") }, + { STRING_WITH_LEN("NO SQL") }, + { STRING_WITH_LEN("READS SQL DATA") }, + { STRING_WITH_LEN("MODIFIES SQL DATA") } +}; LEX_CSTRING DATA_clex_str= { STRING_WITH_LEN("DATA") }; LEX_CSTRING INDEX_clex_str= { STRING_WITH_LEN("INDEX") };