Skip to content

Commit 84ffdef

Browse files
satya461dahlerlend
authored andcommitted
Bug#27261822 - EMPTY GENERAL TABLESPACE CRASHES UPGRADE
Problem: ------- Upgrade with empty general tablespace (no CREATE TABLE using general tablespace), crashes the upgrade to 8.0 This is because we assumed the initial number of pages of an 5.7 IBD file to be 6. This is true for file_per_table tablespaces. Size of freshly created tablespace is 4 and we expect minimum 6 pages. Hence the assert. Fix: ---- Use the right mininum size of IBD file as 4 pages. Reviewed-By: Sunny Bains <[email protected]> Approved on IM
1 parent 77d81b8 commit 84ffdef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

storage/innobase/include/fil0fil.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,11 @@ extern Fil_path MySQL_datadir_path;
784784

785785
/** Initial size of a single-table tablespace in pages */
786786
constexpr size_t FIL_IBD_FILE_INITIAL_SIZE = 7;
787-
constexpr size_t FIL_IBD_FILE_INITIAL_SIZE_5_7 = 6;
787+
788+
/** An empty tablespace (CREATE TABLESPACE) has minimum
789+
of 4 pages and an empty CREATE TABLE (file_per_table) has 6 pages.
790+
Minimum of these two is 4 */
791+
constexpr size_t FIL_IBD_FILE_INITIAL_SIZE_5_7 = 4;
788792

789793
/** 'null' (undefined) page offset in the context of file spaces */
790794
constexpr page_no_t FIL_NULL = std::numeric_limits<page_no_t>::max();

0 commit comments

Comments
 (0)