![]() |
MySQL 8.0.43
Source Code Documentation
|
Data structure that contains the information about shared tablespaces. More...
#include <fsp0sysspace.h>
Public Member Functions | |
| SysTablespace () | |
| ~SysTablespace () override | |
| void | set_tablespace_full_status (bool is_full) |
| Set tablespace full status. More... | |
| bool | get_tablespace_full_status () |
| Get tablespace full status. More... | |
| void | set_sanity_check_status (bool status) |
| Set sanity check status. More... | |
| bool | get_sanity_check_status () |
| Get sanity check status. More... | |
| bool | parse_params (const char *filepath_spec, bool supports_raw) |
| Parse the input params and populate member variables. More... | |
| dberr_t | check_file_spec (bool create_new_db, ulint min_expected_size) |
| Check the data file specification. More... | |
| void | shutdown () |
| Free the memory allocated by parse() More... | |
| bool | created_new_raw () const |
| ulint | can_auto_extend_last_file () const |
| void | set_last_file_size (page_no_t size) |
| Set the last file size. More... | |
| page_no_t | last_file_size () const |
| Get the number of pages in the last data file in the tablespace. More... | |
| page_no_t | get_autoextend_increment () const |
| page_no_t | get_pages_from_size (os_offset_t size) |
| Round the number of bytes in the file to MegaBytes and then return the number of pages. More... | |
| page_no_t | get_increment () const |
| dberr_t | open_or_create (bool is_temp, bool create_new_db, page_no_t *sum_new_sizes, lsn_t *flush_lsn) |
| Open or create the data files. More... | |
Public Member Functions inherited from Tablespace | |
| Tablespace () | |
| virtual | ~Tablespace () |
| Tablespace (const Tablespace &) | |
| Tablespace & | operator= (const Tablespace &) |
| void | set_name (const char *name) |
| Set tablespace name. More... | |
| const char * | name () const |
| Get tablespace name. More... | |
| void | set_path (const char *path, size_t len) |
| Set tablespace path and filename members. More... | |
| void | set_path (const char *path) |
| Set tablespace path and filename members. More... | |
| const char * | path () const |
| Get tablespace path. More... | |
| void | set_space_id (space_id_t space_id) |
| Set the space id of the tablespace. More... | |
| space_id_t | space_id () const |
| Get the space id of the tablespace. More... | |
| void | set_flags (uint32_t fsp_flags) |
| Set the tablespace flags. More... | |
| uint32_t | flags () const |
| Get the tablespace flags. More... | |
| void | set_ignore_read_only (bool read_only_status) |
| Set Ignore Read Only Status for tablespace. More... | |
| void | shutdown () |
| Free the memory allocated by the Tablespace object. More... | |
| page_no_t | get_sum_of_sizes () const |
| void | delete_files () |
| Delete all the data files. More... | |
| bool | intersection (const Tablespace *other_space) |
| Check if two tablespaces have common data file names. More... | |
| dberr_t | add_datafile (const char *datafile_added) |
| Use the ADD DATAFILE path to create a Datafile object and add it to the front of m_files. More... | |
| Datafile * | first_datafile () |
| void | set_autoextend_size (uint64_t size) |
| uint64_t | get_autoextend_size () const |
Private Types | |
| enum | file_status_t { FILE_STATUS_VOID = 0 , FILE_STATUS_RW_PERMISSION_ERROR , FILE_STATUS_READ_WRITE_ERROR , FILE_STATUS_NOT_REGULAR_FILE_ERROR } |
Private Member Functions | |
| dberr_t | read_lsn_and_check_flags (lsn_t *flushed_lsn) |
| Check the tablespace header for this tablespace. More... | |
| dberr_t | file_not_found (Datafile &file, bool create_new_db) |
| Note that the data file was not found. More... | |
| void | file_found (Datafile &file) |
| Note that the data file was found. More... | |
| dberr_t | create (Datafile &file) |
| Create a data file. More... | |
| dberr_t | create_file (Datafile &file) |
| Create a data file. More... | |
| dberr_t | open_file (Datafile &file) |
| Open a data file. More... | |
| dberr_t | set_size (Datafile &file) |
| Set the size of the file. More... | |
| page_no_t | parse_units (char *&ptr) |
| Convert a numeric string that optionally ends in upper or lower case G, M, or K, rounding off to the nearest number of megabytes. More... | |
| dberr_t | check_size (Datafile &file) |
| Verify the size of the physical file. More... | |
| dberr_t | check_file_status (const Datafile &file, file_status_t &reason) |
| Check if a file can be opened in the correct mode. More... | |
Static Private Member Functions | |
| static char * | parse_file_name (char *ptr) |
| Put the pointer to the next byte after a valid file name. More... | |
Private Attributes | |
| bool | m_auto_extend_last_file |
| if true, then we auto-extend the last data file More... | |
| page_no_t | m_last_file_size_max |
| if != 0, this tells the max size auto-extending may increase the last data file size More... | |
| bool | m_created_new_raw |
| If the following is true we do not allow inserts etc. More... | |
| bool | m_is_tablespace_full |
| Tablespace full status. More... | |
| bool | m_sanity_checks_done |
| if false, then sanity checks are still pending More... | |
Additional Inherited Members | |
Public Types inherited from Tablespace | |
| typedef std::vector< Datafile, ut::allocator< Datafile > > | files_t |
Public Attributes inherited from Tablespace | |
| files_t | m_files |
| Data file information - each Datafile can be accessed globally. More... | |
Protected Attributes inherited from Tablespace | |
| bool | m_ignore_read_only |
| Ignore server read only configuration for this tablespace. More... | |
Data structure that contains the information about shared tablespaces.
Currently this can be the system tablespace or a temporary table tablespace
|
private |
|
inline |
|
inlineoverride |
|
inline |
Check the data file specification.
| [in] | create_new_db | True if a new database is to be created |
| [in] | min_expected_size | Minimum expected tablespace size in bytes |
|
private |
Check if a file can be opened in the correct mode.
| [in,out] | file | data file object |
| [out] | reason | exact reason if file_status check failed. |
Verify the size of the physical file.
| [in] | file | data file object |
Create a data file.
| [in,out] | file | data file object |
Create a data file.
| [in,out] | file | data file object |
|
inline |
|
private |
Note that the data file was found.
| [in,out] | file | data file object |
Note that the data file was not found.
| [in] | file | data file object |
| [in] | create_new_db | true if a new instance to be created |
|
inline |
| page_no_t SysTablespace::get_increment | ( | ) | const |
|
inline |
Round the number of bytes in the file to MegaBytes and then return the number of pages.
Note: Only system tablespaces are required to be at least 1 megabyte.
|
inline |
Get sanity check status.
|
inline |
Get tablespace full status.
|
inline |
Get the number of pages in the last data file in the tablespace.
Open a data file.
| [in,out] | file | data file object |
| dberr_t SysTablespace::open_or_create | ( | bool | is_temp, |
| bool | create_new_db, | ||
| page_no_t * | sum_new_sizes, | ||
| lsn_t * | flush_lsn | ||
| ) |
Open or create the data files.
| [in] | is_temp | whether this is a temporary tablespace |
| [in] | create_new_db | whether we are creating a new database |
| [out] | sum_new_sizes | sum of sizes of the new files added |
| [out] | flush_lsn | lsn stored at offset FIL_PAGE_FILE_FLUSH_LSN in the system tablespace header; might be nullptr if not interested in having that |
|
staticprivate |
Put the pointer to the next byte after a valid file name.
Note that we must step over the ':' in a Windows filepath. A Windows path normally looks like "C:\ibdata\ibdata1:1G", but a Windows raw partition may have a specification like "\\.\C::1Gnewraw" or "\\.\PHYSICALDRIVE2:1Gnewraw".
| [in] | ptr | system tablespace file path spec |
| bool SysTablespace::parse_params | ( | const char * | filepath_spec, |
| bool | supports_raw | ||
| ) |
Parse the input params and populate member variables.
| [in] | filepath_spec | path to data files |
| [in] | supports_raw | true if the tablespace supports raw devices |
|
private |
Convert a numeric string that optionally ends in upper or lower case G, M, or K, rounding off to the nearest number of megabytes.
Convert a numeric string representing a number of bytes optionally ending in upper or lower case G, M, or K, to a number of megabytes, rounding down to the nearest megabyte.
Then return the number of pages in the file.
| [in,out] | ptr | Pointer to a numeric string |
Check the tablespace header for this tablespace.
| [out] | flushed_lsn | value stored at offset FIL_PAGE_FILE_FLUSH_LSN |
|
inline |
Set the last file size.
| [in] | size | the size to set |
|
inline |
Set sanity check status.
| [in] | status | true if sanity checks are done |
Set the size of the file.
| [in,out] | file | data file object |
|
inline |
Set tablespace full status.
| [in] | is_full | true if full |
| void SysTablespace::shutdown | ( | ) |
Free the memory allocated by parse()
Frees the memory allocated by the parse method.
|
private |
if true, then we auto-extend the last data file
|
private |
If the following is true we do not allow inserts etc.
This protects the user from forgetting the 'newraw' keyword to my.cnf
|
private |
Tablespace full status.
|
private |
if != 0, this tells the max size auto-extending may increase the last data file size
|
private |
if false, then sanity checks are still pending