mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 00:34:18 +01:00
Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of the multiplication is of type "unsigned long long". I verified this fix by creating a sparse file of 6TB and forcing InnoDB to use it without overwriting it with zeroes (by commenting the code that overwrites :newraw files). New type ullint is introduced with the sole purpose of shortening "unsigned long long", please do not define it to something else than "unsigned long long". Approved by: Heikki
This commit is contained in:
parent
962c2feb94
commit
4b325712b3
4 changed files with 9 additions and 6 deletions
|
@ -2829,7 +2829,7 @@ will be able to insert new data to the database without running out the
|
||||||
tablespace. Only free extents are taken into account and we also subtract
|
tablespace. Only free extents are taken into account and we also subtract
|
||||||
the safety margin required by the above function fsp_reserve_free_extents. */
|
the safety margin required by the above function fsp_reserve_free_extents. */
|
||||||
|
|
||||||
ulint
|
ullint
|
||||||
fsp_get_available_space_in_free_extents(
|
fsp_get_available_space_in_free_extents(
|
||||||
/*====================================*/
|
/*====================================*/
|
||||||
/* out: available space in kB */
|
/* out: available space in kB */
|
||||||
|
@ -2895,7 +2895,8 @@ fsp_get_available_space_in_free_extents(
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(((n_free - reserve) * FSP_EXTENT_SIZE)
|
return((ullint)(n_free - reserve)
|
||||||
|
* FSP_EXTENT_SIZE
|
||||||
* (UNIV_PAGE_SIZE / 1024));
|
* (UNIV_PAGE_SIZE / 1024));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5847,8 +5847,8 @@ ha_innobase::update_table_comment(
|
||||||
mutex_enter_noninline(&srv_dict_tmpfile_mutex);
|
mutex_enter_noninline(&srv_dict_tmpfile_mutex);
|
||||||
rewind(srv_dict_tmpfile);
|
rewind(srv_dict_tmpfile);
|
||||||
|
|
||||||
fprintf(srv_dict_tmpfile, "InnoDB free: %lu kB",
|
fprintf(srv_dict_tmpfile, "InnoDB free: %llu kB",
|
||||||
(ulong) fsp_get_available_space_in_free_extents(
|
fsp_get_available_space_in_free_extents(
|
||||||
prebuilt->table->space));
|
prebuilt->table->space));
|
||||||
|
|
||||||
dict_print_info_on_foreign_keys(FALSE, srv_dict_tmpfile,
|
dict_print_info_on_foreign_keys(FALSE, srv_dict_tmpfile,
|
||||||
|
|
|
@ -245,7 +245,7 @@ will be able to insert new data to the database without running out the
|
||||||
tablespace. Only free extents are taken into account and we also subtract
|
tablespace. Only free extents are taken into account and we also subtract
|
||||||
the safety margin required by the above function fsp_reserve_free_extents. */
|
the safety margin required by the above function fsp_reserve_free_extents. */
|
||||||
|
|
||||||
ulint
|
ullint
|
||||||
fsp_get_available_space_in_free_extents(
|
fsp_get_available_space_in_free_extents(
|
||||||
/*====================================*/
|
/*====================================*/
|
||||||
/* out: available space in kB */
|
/* out: available space in kB */
|
||||||
|
|
|
@ -216,6 +216,8 @@ typedef __int64 ib_longlong;
|
||||||
typedef longlong ib_longlong;
|
typedef longlong ib_longlong;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned long long int ullint;
|
||||||
|
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
#if SIZEOF_LONG != SIZEOF_VOIDP
|
#if SIZEOF_LONG != SIZEOF_VOIDP
|
||||||
#error "Error: InnoDB's ulint must be of the same size as void*"
|
#error "Error: InnoDB's ulint must be of the same size as void*"
|
||||||
|
|
Loading…
Add table
Reference in a new issue