diff options
| author | Eric Herman <eric@freesa.org> | 2021-09-03 06:38:54 +0200 |
|---|---|---|
| committer | Vicențiu Ciorbaru <cvicentiu@gmail.com> | 2021-10-15 12:14:47 +0300 |
| commit | 0649bcff4e984cb29d9fc12bde7eccb87ea7e38e (patch) | |
| tree | 7459ff3efdcfdfa2ab4094f7ff5b7e5d4332e9a0 /sql/sql_db.cc | |
| parent | a6cf8b34a834e5d16155f8bb3f33d57a4f87eb9e (diff) | |
| download | mariadb-git-bb-10.7-vicentiu.tar.gz | |
MDEV-26221: DYNAMIC_ARRAY use size_t for sizesbb-10.7-vicentiu
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 'sql/sql_db.cc')
| -rw-r--r-- | sql/sql_db.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 37e136927f2..c5defc1959c 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1363,9 +1363,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, *tables= tot_list; /* and at last delete all non-table files */ - for (uint idx=0 ; - idx < (uint) dirp->number_of_files && !thd->killed ; - idx++) + for (size_t idx=0; idx < dirp->number_of_files && !thd->killed; idx++) { FILEINFO *file=dirp->dir_entry+idx; char *extension; @@ -1488,9 +1486,7 @@ long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path) DBUG_ENTER("mysql_rm_arc_files"); DBUG_PRINT("enter", ("path: %s", org_path)); - for (uint idx=0 ; - idx < (uint) dirp->number_of_files && !thd->killed ; - idx++) + for (size_t idx=0; idx < dirp->number_of_files && !thd->killed; idx++) { FILEINFO *file=dirp->dir_entry+idx; char *extension, *revision; @@ -1970,8 +1966,8 @@ bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db) /* Step2: Move tables to the new database */ if ((dirp = my_dir(path,MYF(MY_DONT_SORT)))) { - uint nfiles= (uint) dirp->number_of_files; - for (uint idx=0 ; idx < nfiles && !thd->killed ; idx++) + size_t nfiles= dirp->number_of_files; + for (size_t idx=0 ; idx < nfiles && !thd->killed ; idx++) { FILEINFO *file= dirp->dir_entry + idx; char *extension, tname[FN_REFLEN + 1]; @@ -2060,8 +2056,8 @@ bool mysql_upgrade_db(THD *thd, const LEX_CSTRING *old_db) if ((dirp = my_dir(path,MYF(MY_DONT_SORT)))) { - uint nfiles= (uint) dirp->number_of_files; - for (uint idx=0 ; idx < nfiles ; idx++) + size_t nfiles= dirp->number_of_files; + for (size_t idx=0 ; idx < nfiles ; idx++) { FILEINFO *file= dirp->dir_entry + idx; char oldname[FN_REFLEN + 1], newname[FN_REFLEN + 1]; |
