WL#7342: InnoDB: Refactor the Tablespace class
Refactor the Tablespace class into a separate Datafile class and a SysTablespace class that derives from Tablespace. Restructure the code so that functions and data are members of the correct object. This should be done with no functional changes to the code and no regressions in MTR.
No functional changes should be made in this worklog. Testcases can be changed only for different log messages.
The current class Tablespace is converted to SysTablespace and derives from a simpler class Tablspace. The embedded struct file_t is converted to a Database class and used not only in the Tablspace class but also directly in fil0fil.cc where SingleTableTablespaces are found, openned and validated. An attempt is made to handle out-of-memory situations from failed ut_malloc calls even though ut_malloc currently does not return NULL. It tries an allocation 60 times in 60 seconds and then asserts. But new code in InnoDB should not assume that. Various functions used to create a filepath are consolidated into a function called fil_make_filepath() and a unit test is added for it. In addition to this refactoring, There can be code cleanup in this patch since those changes are also non-functional.
Copyright (c) 2000, 2023, Oracle Corporation and/or its affiliates. All rights reserved.