mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
committed by
Vicențiu-Marian Ciorbaru
parent
9ab0d07e10
commit
401ff6994d
@ -354,7 +354,7 @@ int fill_all_plugins(THD *thd, TABLE_LIST *tables, COND *cond)
|
||||
plugin_dl_foreach(thd, 0, show_plugins, table);
|
||||
|
||||
const char *wstr= lookup.db_value.str, *wend= wstr + lookup.db_value.length;
|
||||
for (uint i=0; i < (uint) dirp->number_of_files; i++)
|
||||
for (size_t i=0; i < dirp->number_of_files; i++)
|
||||
{
|
||||
FILEINFO *file= dirp->dir_entry+i;
|
||||
LEX_CSTRING dl= { file->name, strlen(file->name) };
|
||||
@ -952,7 +952,7 @@ find_files(THD *thd, Dynamic_array<LEX_CSTRING*> *files, LEX_CSTRING *db,
|
||||
|
||||
if (!db) /* Return databases */
|
||||
{
|
||||
for (uint i=0; i < (uint) dirp->number_of_files; i++)
|
||||
for (size_t i=0; i < dirp->number_of_files; i++)
|
||||
{
|
||||
FILEINFO *file= dirp->dir_entry+i;
|
||||
#ifdef USE_SYMDIR
|
||||
|
Reference in New Issue
Block a user