54extern int meb_key_fetch(
const char *key_id,
char **
key_type,
55 const char *user_id,
void **
key,
size_t *key_length);
143 if (
file.m_filepath !=
nullptr) {
182 if (
file.m_filepath !=
nullptr) {
293 lsn_t *flush_lsn,
bool for_import);
485 using WIN32_FILE_INFO = BY_HANDLE_FILE_INFORMATION;
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:48
uint32_t page_no_t
Page number.
Definition: api0api.h:46
Data file control information.
Definition: fsp0file.h:72
Datafile()
Definition: fsp0file.h:77
space_id_t space_id() const
Get Datafile::m_space_id.
Definition: fsp0file.h:330
byte * m_encryption_iv
Encryption iv read from first page.
Definition: fsp0file.h:498
byte * m_encryption_key
Encryption key read from first page.
Definition: fsp0file.h:495
dberr_t find_space_id()
Determine the space id of the given file descriptor by reading a few pages from the beginning of the ...
Definition: fsp0file.cc:712
dberr_t open_read_write(bool read_only_mode)
Open a data file in read-write mode during start-up so that doublewrite pages can be restored and the...
Definition: fsp0file.cc:147
uint32_t m_server_version
Server version.
Definition: fsp0file.h:456
bool is_valid() const
Get Datafile::m_is_valid.
Definition: fsp0file.h:342
space_id_t m_space_id
Tablespace ID.
Definition: fsp0file.h:453
const char * filepath() const
Get Datafile::m_filepath.
Definition: fsp0file.h:307
void free_first_page()
Free the first page from memory when it is no longer needed.
Definition: fsp0file.cc:362
dberr_t validate_for_recovery(space_id_t space_id)
Validates this datafile for the purpose of recovery.
Definition: fsp0file.cc:449
ulint m_last_os_error
Last OS error received so it can be reported if needed.
Definition: fsp0file.h:480
bool m_exists
true if file already existed on startup
Definition: fsp0file.h:467
bool is_raw_type()
Returns if the Datafile is created in raw partition.
Definition: fsp0file.h:229
Datafile(const Datafile &file)
Definition: fsp0file.h:123
void make_filepath(const char *dirpath, const char *filename, ib_file_suffix ext)
Make a full filepath from a directory path and a filename.
Definition: fsp0file.cc:205
ulint m_order
ordinal position of this datafile in the tablespace
Definition: fsp0file.h:445
uint32_t flags() const
Get Datafile::m_flags.
Definition: fsp0file.h:334
void set_open_flags(os_file_create_t open_flags)
Set the Datafile::m_open_flags.
Definition: fsp0file.h:415
bool same_filepath_as(const char *other) const
Do a quick test if the filepath provided looks the same as this filepath byte by byte.
Definition: fsp0file.cc:253
dberr_t validate_to_dd(space_id_t space_id, uint32_t flags, bool for_import)
Validates the datafile and checks that it conforms with the expected space ID and flags.
Definition: fsp0file.cc:375
dberr_t restore_from_doublewrite(page_no_t restore_page_no)
Finds a given page of the given space id from the double write buffer and copies it to the correspond...
Definition: fsp0file.cc:866
void set_filename()
Set the filename pointer to the start of the file name in the filepath.
Definition: fsp0file.h:389
page_no_t m_size
size in pages
Definition: fsp0file.h:442
device_t m_type
The type of the data file.
Definition: fsp0file.h:448
pfs_os_file_t handle() const
Get Datafile::m_handle.
Definition: fsp0file.h:311
dberr_t validate_first_page(space_id_t space_id, lsn_t *flush_lsn, bool for_import)
Checks the consistency of the first page of a datafile when the tablespace is opened.
Definition: fsp0file.cc:512
lsn_t get_flush_lsn()
Get LSN of first page.
Definition: fsp0file.h:296
dberr_t open_or_create(bool read_only_mode)
Create/open a data file.
Definition: fsp0file.cc:91
void init_file_info()
Initialize OS specific file info.
Definition: fsp0file.cc:177
void shutdown()
Release the resources.
Definition: fsp0file.cc:67
ulint order() const
Get Datafile::m_order.
Definition: fsp0file.h:318
~Datafile()
Definition: fsp0file.h:153
struct stat m_file_info
Use the following to determine the uniqueness of this datafile.
Definition: fsp0file.h:491
dberr_t open_read_only(bool strict)
Open a data file in read-only mode to check if it exists so that it can be validated.
Definition: fsp0file.cc:112
Datafile(const char *name, uint32_t flags, page_no_t size, ulint order)
Definition: fsp0file.h:99
Datafile & operator=(const Datafile &file)
Definition: fsp0file.h:155
void free_filepath()
Free the filepath buffer.
Definition: fsp0file.cc:239
void init(const char *name, uint32_t flags)
Initialize the name and flags of this datafile.
Definition: fsp0file.cc:56
ulint server_version() const
Get Datafile::m_server_version.
Definition: fsp0file.h:322
bool same_as(const Datafile &other) const
Test if another opened datafile is the same file as this object.
Definition: fsp0file.cc:260
char * m_name
Datafile name at the tablespace location.
Definition: fsp0file.h:430
byte * m_first_page
Buffer to hold first page.
Definition: fsp0file.h:473
pfs_os_file_t m_handle
Open file handle.
Definition: fsp0file.h:436
bool is_open() const
Definition: fsp0file.h:338
uint32_t m_encryption_master_key_id
Master key id read from first page.
Definition: fsp0file.h:504
uint32_t m_space_version
Space version.
Definition: fsp0file.h:459
void set_filepath(const char *filepath)
Set the filepath by duplicating the filepath sent in.
Definition: fsp0file.cc:230
uint32_t m_flags
Tablespace flags.
Definition: fsp0file.h:464
dberr_t close()
Close a data file.
Definition: fsp0file.cc:187
Encryption::Progress m_encryption_op_in_progress
Encryption operation in progress.
Definition: fsp0file.h:501
ulint last_os_error() const
Get the last OS error reported.
Definition: fsp0file.h:346
dberr_t read_first_page()
Reads a few significant fields from the first page of the datafile, which must already be open.
Definition: fsp0file.cc:313
os_file_create_t m_open_flags
Flags to use for opening the data file.
Definition: fsp0file.h:439
ulint space_version() const
Get Datafile::m_space_version.
Definition: fsp0file.h:326
char * m_filepath
Physical file path with base name and extension.
Definition: fsp0file.h:477
const char * name() const
Get Datafile::m_name.
Definition: fsp0file.h:303
char * m_filename
Points into m_filepath to the file name with extension.
Definition: fsp0file.h:433
bool m_is_valid
Definition: fsp0file.h:470
page_no_t size() const
Definition: fsp0file.h:368
void set_name(const char *name)
Allocate and set the datafile or tablespace name in m_name.
Definition: fsp0file.cc:278
Encryption algorithm.
Definition: os0enc.h:54
Progress
Encryption progress type.
Definition: os0enc.h:80
Data structure that contains the information about shared tablespaces.
Definition: fsp0sysspace.h:58
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:47
void set_space_id(space_id_t space_id)
Set the space id of the tablespace.
Definition: fsp0space.h:116
void set_flags(uint32_t fsp_flags)
Set the tablespace flags.
Definition: fsp0space.h:127
dberr_t
Definition: db0err.h:39
The low-level file system.
constexpr space_id_t SPACE_UNKNOWN
Unknown space id.
Definition: fil0fil.h:1162
ib_file_suffix
Common InnoDB file extensions.
Definition: fil0fil.h:584
constexpr uint32_t FIL_PAGE_LSN
lsn of the end of the newest modification log record to the page
Definition: fil0types.h:67
device_t
Types of raw partitions in innodb_data_file_path.
Definition: fsp0file.h:59
@ SRV_NOT_RAW
Not a raw partition.
Definition: fsp0file.h:62
@ SRV_NEW_RAW
A 'newraw' partition, only to be initialized.
Definition: fsp0file.h:65
@ SRV_OLD_RAW
An initialized raw partition.
Definition: fsp0file.h:68
Prototypes for global functions in ha_innodb.cc that are called by InnoDB C code.
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:63
static uint64_t mach_read_from_8(const byte *b)
The following function is used to fetch data from 8 consecutive bytes.
static char * mem_strdup(const char *str)
Duplicates a NUL-terminated string.
int key_type
Definition: method.h:38
Json_data_extension ext
Definition: backend.cc:50
void free(void *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::malloc*(),...
Definition: ut0new.h:719
The interface to the operating system file io.
os_file_create_t
Options for os_file_create_func.
Definition: os0file.h:195
@ OS_FILE_OPEN
to open an existing file (if doesn't exist, error)
Definition: os0file.h:196
static constexpr os_fd_t OS_FILE_CLOSED
Definition: os0file.h:151
const char * filename
Definition: pfs_example_component_population.cc:67
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Common file descriptor for file IO instrumentation with PFS on windows and other platforms.
Definition: os0file.h:172
os_file_t m_file
Definition: os0file.h:182
#define OS_PATH_SEPARATOR
Definition: univ.i:538
unsigned long int ulint
Definition: univ.i:406
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:93