Compiling - Fix MSVC compile warnings, on x86

This commit is contained in:
Vladislav Vaintroub 2024-05-03 13:24:06 +02:00
parent 029e2a5fd9
commit b18259ecf5
2 changed files with 6 additions and 4 deletions

View File

@ -3282,10 +3282,12 @@ handlerton *ha_partition::get_def_part_engine(const char *name)
goto err;
if (state.st_size <= 64)
goto err;
if (!(frm_image= (uchar*)my_malloc(key_memory_Partition_share,
state.st_size, MYF(MY_WME))))
if ((ulonglong)state.st_size >= SIZE_T_MAX) /* Whole file need to fit into memory*/
goto err;
if (mysql_file_read(file, frm_image, state.st_size, MYF(MY_NABP)))
if (!(frm_image= (uchar*)my_malloc(key_memory_Partition_share,
(size_t)state.st_size, MYF(MY_WME))))
goto err;
if (mysql_file_read(file, frm_image, (size_t)state.st_size, MYF(MY_NABP)))
goto err;
if (frm_image[64] != '/')

View File

@ -2168,7 +2168,7 @@ func_exit:
sum_pages += last_pages_in;
const ulint time_elapsed = std::max<ulint>(curr_time - prev_time, 1);
const ulint time_elapsed = std::max<ulint>(ulint(curr_time - prev_time), 1);
/* We update our variables every innodb_flushing_avg_loops
iterations to smooth out transition in workload. */