@@ -231,11 +231,10 @@ const char *ACL_HOST_AND_IP::calc_ip(const char *ip_arg, long *val, char end) {
231
231
@param host_arg Value to be stored
232
232
*/
233
233
void ACL_HOST_AND_IP::update_hostname (const char *host_arg) {
234
- hostname = ( char *) host_arg; // This will not be modified!
234
+ hostname = host_arg; // This will not be modified!
235
235
hostname_length = hostname ? strlen (hostname) : 0 ;
236
- if (!host_arg ||
237
- (!(host_arg = (char *)calc_ip (host_arg, &ip, ' /' )) ||
238
- !(host_arg = (char *)calc_ip (host_arg + 1 , &ip_mask, ' \0 ' )))) {
236
+ if (!host_arg || (!(host_arg = calc_ip (host_arg, &ip, ' /' )) ||
237
+ !(host_arg = calc_ip (host_arg + 1 , &ip_mask, ' \0 ' )))) {
239
238
ip = ip_mask = 0 ; // Not a masked ip
240
239
}
241
240
}
@@ -743,7 +742,7 @@ GRANT_NAME::GRANT_NAME(TABLE *form, bool is_routine) {
743
742
host.update_hostname (get_field (&memex, form->field [0 ]));
744
743
db = get_field (&memex, form->field [1 ]);
745
744
user = get_field (&memex, form->field [2 ]);
746
- if (!user) user = ( char *) " " ;
745
+ if (!user) user = " " ;
747
746
sort = get_sort (3 , host.get_host (), db, user);
748
747
tname = get_field (&memex, form->field [3 ]);
749
748
if (!db || !tname) {
@@ -1286,8 +1285,8 @@ void rebuild_check_host(void) {
1286
1285
true Error
1287
1286
*/
1288
1287
1289
- bool acl_getroot (THD *thd, Security_context *sctx, char *user, char *host ,
1290
- char *ip, const char *db) {
1288
+ bool acl_getroot (THD *thd, Security_context *sctx, const char *user ,
1289
+ const char *host, const char *ip, const char *db) {
1291
1290
int res = 1 ;
1292
1291
ACL_USER *acl_user = 0 ;
1293
1292
DBUG_ENTER (" acl_getroot" );
@@ -1954,32 +1953,31 @@ bool acl_reload(THD *thd) {
1954
1953
To avoid deadlocks we should obtain table locks before
1955
1954
obtaining acl_cache->lock mutex.
1956
1955
*/
1957
- tables[0 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
1958
- C_STRING_WITH_LEN (" user" ), " user" , TL_READ,
1959
- MDL_SHARED_READ_ONLY);
1956
+ tables[0 ].init_one_table (STRING_WITH_LEN (" mysql" ), STRING_WITH_LEN (" user" ),
1957
+ " user" , TL_READ, MDL_SHARED_READ_ONLY);
1960
1958
/*
1961
1959
For a TABLE_LIST element that is inited with a lock type TL_READ
1962
1960
the type MDL_SHARED_READ_ONLY of MDL is requested for.
1963
1961
Acquiring strong MDL lock allows to avoid deadlock and timeout errors
1964
1962
from SE level.
1965
1963
*/
1966
- tables[1 ].init_one_table (C_STRING_WITH_LEN (" mysql" ), C_STRING_WITH_LEN (" db" ),
1964
+ tables[1 ].init_one_table (STRING_WITH_LEN (" mysql" ), STRING_WITH_LEN (" db" ),
1967
1965
" db" , TL_READ, MDL_SHARED_READ_ONLY);
1968
1966
1969
- tables[2 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
1970
- C_STRING_WITH_LEN (" proxies_priv" ), " proxies_priv" ,
1967
+ tables[2 ].init_one_table (STRING_WITH_LEN (" mysql" ),
1968
+ STRING_WITH_LEN (" proxies_priv" ), " proxies_priv" ,
1971
1969
TL_READ, MDL_SHARED_READ_ONLY);
1972
1970
1973
- tables[3 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
1974
- C_STRING_WITH_LEN (" global_grants" ), " global_grants" ,
1971
+ tables[3 ].init_one_table (STRING_WITH_LEN (" mysql" ),
1972
+ STRING_WITH_LEN (" global_grants" ), " global_grants" ,
1975
1973
TL_READ, MDL_SHARED_READ_ONLY);
1976
1974
1977
- tables[4 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
1978
- C_STRING_WITH_LEN (" role_edges" ), " role_edges" ,
1979
- TL_READ, MDL_SHARED_READ_ONLY);
1975
+ tables[4 ].init_one_table (STRING_WITH_LEN (" mysql" ),
1976
+ STRING_WITH_LEN (" role_edges" ), " role_edges" , TL_READ ,
1977
+ MDL_SHARED_READ_ONLY);
1980
1978
1981
- tables[5 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
1982
- C_STRING_WITH_LEN (" default_roles" ), " default_roles" ,
1979
+ tables[5 ].init_one_table (STRING_WITH_LEN (" mysql" ),
1980
+ STRING_WITH_LEN (" default_roles" ), " default_roles" ,
1983
1981
TL_READ, MDL_SHARED_READ_ONLY);
1984
1982
1985
1983
tables[0 ].next_local = tables[0 ].next_global = tables + 1 ;
@@ -2428,15 +2426,15 @@ bool grant_reload(THD *thd) {
2428
2426
Acquiring strong MDL lock allows to avoid deadlock and timeout errors
2429
2427
from SE level.
2430
2428
*/
2431
- tables[0 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
2432
- C_STRING_WITH_LEN (" tables_priv" ), " tables_priv" ,
2429
+ tables[0 ].init_one_table (STRING_WITH_LEN (" mysql" ),
2430
+ STRING_WITH_LEN (" tables_priv" ), " tables_priv" ,
2433
2431
TL_READ, MDL_SHARED_READ_ONLY);
2434
- tables[1 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
2435
- C_STRING_WITH_LEN (" columns_priv" ), " columns_priv" ,
2436
- TL_READ, MDL_SHARED_READ_ONLY);
2437
- tables[2 ].init_one_table (C_STRING_WITH_LEN (" mysql" ),
2438
- C_STRING_WITH_LEN (" procs_priv" ), " procs_priv" ,
2432
+ tables[1 ].init_one_table (STRING_WITH_LEN (" mysql" ),
2433
+ STRING_WITH_LEN (" columns_priv" ), " columns_priv" ,
2439
2434
TL_READ, MDL_SHARED_READ_ONLY);
2435
+ tables[2 ].init_one_table (STRING_WITH_LEN (" mysql" ),
2436
+ STRING_WITH_LEN (" procs_priv" ), " procs_priv" , TL_READ,
2437
+ MDL_SHARED_READ_ONLY);
2440
2438
2441
2439
tables[0 ].next_local = tables[0 ].next_global = tables + 1 ;
2442
2440
tables[1 ].next_local = tables[1 ].next_global = tables + 2 ;
0 commit comments