Skip to content

Commit 98de117

Browse files
committed
cleanup: extern -> static
in particular, this fixes a compiler warning: sql/sql_lex.h:406:19: warning: ‘sp_data_access_name’ defined but not used [-Wunused-variable]
1 parent f9003c7 commit 98de117

File tree

6 files changed

+29
-44
lines changed

6 files changed

+29
-44
lines changed

sql/item_jsonfunc.cc

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#include "sql_parse.h" // For check_stack_overrun
2222
#include "json_schema_helper.h"
2323

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+
2428
/*
2529
Compare ASCII string against the string with the specified
2630
character set.
@@ -4307,15 +4311,15 @@ bool Item_func_json_normalize::fix_length_and_dec(THD *thd)
43074311
left in the object that we no longer want to compare. In this case,
43084312
we want to skip the current item.
43094313
*/
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)
43114315
{
43124316
json_skip_level(js);
43134317
json_skip_level(value);
43144318
}
43154319

43164320

43174321
/* 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)
43194323
{
43204324
if (json_value_scalar(value))
43214325
{
@@ -4367,7 +4371,7 @@ bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value)
43674371
array is object, then compare the two objects entirely. If they are
43684372
equal return true else return false.
43694373
*/
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)
43714375
{
43724376
st_json_engine_t loc_val= *value;
43734377
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)
44154419
}
44164420

44174421

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,
44194423
bool compare_whole)
44204424
{
44214425
if (value->value_type == JSON_VALUE_ARRAY)
@@ -4500,7 +4504,9 @@ int compare_nested_object(json_engine_t *js, json_engine_t *value)
45004504

45014505
return MY_TEST(result);
45024506
}
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,
45044510
bool compare_whole)
45054511
{
45064512
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,
46564662
FALSE - If two json documents do not overlap
46574663
TRUE - if two json documents overlap
46584664
*/
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)
46604666
{
46614667
DBUG_EXECUTE_IF("json_check_min_stack_requirement",
46624668
{
@@ -4984,8 +4990,8 @@ bool Item_func_json_key_value::fix_length_and_dec(THD *thd)
49844990
}
49854991

49864992

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)
49894995
{
49904996
int level= value->stack_p;
49914997
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,
50425048
FALSE - The function was successfully completed without errors.
50435049
TRUE - An error occurred while running.
50445050
*/
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)
50475053
{
50485054
value_start= js->value_begin;
50495055

@@ -5072,8 +5078,8 @@ bool get_current_value(json_engine_t *js, const uchar *&value_start,
50725078
FALSE - if two array documents have intersection
50735079
TRUE - If two array documents do not have intersection
50745080
*/
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)
50775083
{
50785084
bool res= true, has_value= false;
50795085
int level= value->stack_p;
@@ -5228,7 +5234,7 @@ bool Item_func_json_array_intersect::fix_length_and_dec(THD *thd)
52285234
}
52295235

52305236

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)
52325238
{
52335239
int level= je1->stack_p;
52345240
String temp_str(0);
@@ -5380,7 +5386,7 @@ bool Item_func_json_object_filter_keys::fix_length_and_dec(THD *thd)
53805386
return FALSE;
53815387
}
53825388

5383-
bool convert_to_array(json_engine_t *je, String *str)
5389+
static bool convert_to_array(json_engine_t *je, String *str)
53845390
{
53855391
int level= je->stack_p;
53865392
String temp_str(0);

sql/item_jsonfunc.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,6 @@ void report_path_error_ex(const char *ps, json_path_t *p,
4848
void report_json_error_ex(const char *js, json_engine_t *je,
4949
const char *fname, int n_param,
5050
Sql_condition::enum_warning_level lv);
51-
int check_overlaps(json_engine_t *js, json_engine_t *value, bool compare_whole);
52-
int json_find_overlap_with_object(json_engine_t *js,
53-
json_engine_t *value,
54-
bool compare_whole);
55-
void json_skip_current_level(json_engine_t *js, json_engine_t *value);
56-
bool json_find_overlap_with_scalar(json_engine_t *js, json_engine_t *value);
57-
bool json_compare_arrays_in_order_in_order(json_engine_t *js, json_engine_t *value);
58-
bool json_compare_arr_and_obj(json_engine_t *js, json_engine_t* value);
59-
int json_find_overlap_with_array(json_engine_t *js,
60-
json_engine_t *value,
61-
bool compare_whole);
62-
63-
bool create_hash(json_engine_t *value, HASH *items, bool &hash_inited);
64-
bool create_item(LEX_CSTRING *&new_entry,
65-
const uchar *value_start, size_t value_len);
66-
bool get_current_value(json_engine_t *js, const uchar *&value_start,
67-
size_t &value_len);
68-
bool get_intersect_between_arrays(String *str,
69-
json_engine_t *value);
7051

7152
class Json_engine_scan: public json_engine_t
7253
{

sql/sql_connect.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ void setup_connection_thread_globals(THD *thd)
11611161
1 error
11621162
*/
11631163

1164-
bool login_connection(THD *thd)
1164+
static bool login_connection(THD *thd)
11651165
{
11661166
NET *net= &thd->net;
11671167
int error= 0;

sql/sql_connect.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ int thd_set_peer_addr(THD *thd, sockaddr_storage *addr,
102102
bool check_proxy_networks,
103103
uint *host_errors);
104104

105-
bool login_connection(THD *thd);
106105
void prepare_new_connection_state(THD* thd);
107106
void end_connection(THD *thd);
108107
void update_global_user_stats(THD* thd, bool create_user, time_t now);

sql/sql_lex.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,6 @@ enum enum_sp_data_access
403403
SP_MODIFIES_SQL_DATA
404404
};
405405

406-
const LEX_CSTRING sp_data_access_name[]=
407-
{
408-
{ STRING_WITH_LEN("") },
409-
{ STRING_WITH_LEN("CONTAINS SQL") },
410-
{ STRING_WITH_LEN("NO SQL") },
411-
{ STRING_WITH_LEN("READS SQL DATA") },
412-
{ STRING_WITH_LEN("MODIFIES SQL DATA") }
413-
};
414-
415406
#define DERIVED_SUBQUERY 1
416407
#define DERIVED_VIEW 2
417408
#define DERIVED_WITH 4

sql/sql_show.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ static const LEX_CSTRING trg_event_type_names[]=
121121
{ STRING_WITH_LEN("DELETE") }
122122
};
123123

124+
static const LEX_CSTRING sp_data_access_name[]=
125+
{
126+
{ STRING_WITH_LEN("") },
127+
{ STRING_WITH_LEN("CONTAINS SQL") },
128+
{ STRING_WITH_LEN("NO SQL") },
129+
{ STRING_WITH_LEN("READS SQL DATA") },
130+
{ STRING_WITH_LEN("MODIFIES SQL DATA") }
131+
};
124132

125133
LEX_CSTRING DATA_clex_str= { STRING_WITH_LEN("DATA") };
126134
LEX_CSTRING INDEX_clex_str= { STRING_WITH_LEN("INDEX") };

0 commit comments

Comments
 (0)