diff options
author | Eric Herman <eric@freesa.org> | 2021-09-03 06:38:54 +0200 |
---|---|---|
committer | Vicențiu-Marian Ciorbaru <vicentiu@mariadb.org> | 2021-10-19 16:00:26 +0300 |
commit | 401ff6994d842a4072b7b155e5a958e178e6497a (patch) | |
tree | 2becd556b5bde6e7a890249462d0499927cf488d /client/mysqltest.cc | |
parent | 9ab0d07e10fdec9b9db59b3ac493045c5be253b0 (diff) | |
download | mariadb-git-401ff6994d842a4072b7b155e5a958e178e6497a.tar.gz |
MDEV-26221: DYNAMIC_ARRAY use size_t for sizes
https://jira.mariadb.org/browse/MDEV-26221
my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy
The DYNAMIC_STRING uses size_t for sizes, but DYNAMIC_ARRAY used uint.
This patch adjusts DYNAMIC_ARRAY to use size_t like DYNAMIC_STRING.
As the MY_DIR member number_of_files is copied from a DYNAMIC_ARRAY,
this is changed to be size_t.
As MY_TMPDIR members 'cur' and 'max' are copied from a DYNAMIC_ARRAY,
these are also changed to be size_t.
The lists of plugins and stored procedures use DYNAMIC_ARRAY,
but their APIs assume a size of 'uint'; these are unchanged.
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index c7ec429d232..d1b9302370a 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -3646,8 +3646,7 @@ void do_remove_file(struct st_command *command) void do_remove_files_wildcard(struct st_command *command) { int error= 0, sys_errno= 0; - uint i; - size_t directory_length; + size_t i, directory_length; MY_DIR *dir_info; FILEINFO *file; char dir_separator[2]; @@ -3686,7 +3685,7 @@ void do_remove_files_wildcard(struct st_command *command) /* Set default wild chars for wild_compare, is changed in embedded mode */ set_wild_chars(1); - for (i= 0; i < (uint) dir_info->number_of_files; i++) + for (i= 0; i < dir_info->number_of_files; i++) { file= dir_info->dir_entry + i; /* Remove only regular files, i.e. no directories etc. */ @@ -3960,7 +3959,7 @@ void do_rmdir(struct st_command *command) static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname, const DYNAMIC_STRING *ds_wild) { - uint i; + size_t i; MY_DIR *dir_info; FILEINFO *file; DBUG_ENTER("get_list_files"); @@ -3969,7 +3968,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname, if (!(dir_info= my_dir(ds_dirname->str, MYF(MY_WANT_SORT)))) DBUG_RETURN(1); set_wild_chars(1); - for (i= 0; i < (uint) dir_info->number_of_files; i++) + for (i= 0; i < dir_info->number_of_files; i++) { file= dir_info->dir_entry + i; if (ds_wild && ds_wild->length && |