@@ -258,7 +258,7 @@ void execute_query_with_message(const char *query, const char *opt_message)
258
258
return FALSE in case of success
259
259
TRUE in case of failure
260
260
*/
261
- bool execute_query (const char **query, unsigned int length)
261
+ bool execute_query (const char **query, size_t length)
262
262
{
263
263
if (!mysql_real_query (&mysql, (const char *) *query, length))
264
264
return FALSE ;
@@ -363,7 +363,7 @@ int install_password_validation_plugin()
363
363
}
364
364
char *query, *end;
365
365
int tmp= sizeof (" SET GLOBAL validate_password_policy = " ) + 3 ;
366
- int strength_length= strlen (strength);
366
+ size_t strength_length= strlen (strength);
367
367
/*
368
368
query string needs memory which is atleast the length of initial part
369
369
of query plus twice the size of variable being appended.
@@ -395,8 +395,8 @@ int install_password_validation_plugin()
395
395
void estimate_password_strength (char *password_string)
396
396
{
397
397
char *query, *end;
398
- int tmp= sizeof (" SELECT validate_password_strength(" ) + 3 ;
399
- int password_length= strlen (password_string);
398
+ size_t tmp= sizeof (" SELECT validate_password_strength(" ) + 3 ;
399
+ size_t password_length= strlen (password_string);
400
400
/*
401
401
query string needs memory which is atleast the length of initial part
402
402
of query plus twice the size of variable being appended.
@@ -438,7 +438,7 @@ void estimate_password_strength(char *password_string)
438
438
439
439
my_bool mysql_set_password (MYSQL *mysql, char *password)
440
440
{
441
- int password_len= strlen (password);
441
+ size_t password_len= strlen (password);
442
442
char *query, *end;
443
443
query= (char *)my_malloc (PSI_NOT_INSTRUMENTED, password_len+50 , MYF (MY_WME));
444
444
end= my_stpmov (query, " SET PASSWORD= PASSWORD('" );
@@ -476,7 +476,7 @@ my_bool mysql_set_password(MYSQL *mysql, char *password)
476
476
my_bool mysql_expire_password (MYSQL *mysql)
477
477
{
478
478
char sql[]= " UPDATE mysql.user SET password_expired= 'Y'" ;
479
- int sql_len= strlen (sql);
479
+ size_t sql_len= strlen (sql);
480
480
if (mysql_real_query (mysql, sql, sql_len))
481
481
return FALSE ;
482
482
@@ -537,7 +537,7 @@ static void set_root_password(int plugin_set)
537
537
" Yes, any other key for No) : " );
538
538
}
539
539
540
- int pass_length= strlen (password1);
540
+ size_t pass_length= strlen (password1);
541
541
542
542
if ((!plugin_set) || (reply == (int ) ' y' || reply == (int ) ' Y' ))
543
543
{
@@ -689,7 +689,7 @@ void drop_users(MYSQL_RES *result)
689
689
while ((row= mysql_fetch_row (result)))
690
690
{
691
691
char *query, *end;
692
- int user_length, host_length;
692
+ size_t user_length, host_length;
693
693
int tmp= sizeof (" DROP USER " )+5 ;
694
694
user_tmp= row[0 ];
695
695
host_tmp= row[1 ];
@@ -843,8 +843,8 @@ my_bool find_temporary_password(char **p)
843
843
if (home == NULL )
844
844
home= root_path;
845
845
846
- int home_len= strlen (home);
847
- int path_len= home_len + strlen (password_file_name)+1 ;
846
+ size_t home_len= strlen (home);
847
+ size_t path_len= home_len + strlen (password_file_name)+1 ;
848
848
char *path= (char *)malloc (path_len);
849
849
memset (path, 0 , path_len);
850
850
@@ -863,7 +863,7 @@ my_bool find_temporary_password(char **p)
863
863
*/
864
864
char header[256 ];
865
865
char password[64 ];
866
- int password_len=0 ;
866
+ size_t password_len=0 ;
867
867
/* Read header and skip it */
868
868
if (fgets (&header[0 ], sizeof (header), fp) == NULL || header[0 ] != ' #' )
869
869
goto error;
0 commit comments