53extern int meb_key_fetch(
const char *key_id,
char **
key_type,
54 const char *user_id,
void **
key,
size_t *key_length);
145 if (
file.m_filepath !=
nullptr) {
184 if (
file.m_filepath !=
nullptr) {
297 lsn_t *flush_lsn,
bool for_import);
494 using WIN32_FILE_INFO = BY_HANDLE_FILE_INFORMATION;
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:50
uint32_t page_no_t
Page number.
Definition: api0api.h:48
Data file control information.
Definition: fsp0file.h:71
Datafile()
Definition: fsp0file.h:76
space_id_t space_id() const
Get Datafile::m_space_id.
Definition: fsp0file.h:334
byte * m_encryption_iv
Encryption iv read from first page.
Definition: fsp0file.h:507
byte * m_encryption_key
Encryption key read from first page.
Definition: fsp0file.h:504
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:722
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:462
bool is_valid() const
Get Datafile::m_is_valid.
Definition: fsp0file.h:346
space_id_t m_space_id
Tablespace ID.
Definition: fsp0file.h:459
const char * filepath() const
Get Datafile::m_filepath.
Definition: fsp0file.h:311
void free_first_page()
Free the first page from memory when it is no longer needed.
Definition: fsp0file.cc:373
bool m_atomic_write
true if atomic writes enabled for this file
Definition: fsp0file.h:482
dberr_t validate_for_recovery(space_id_t space_id)
Validates this datafile for the purpose of recovery.
Definition: fsp0file.cc:460
ulint m_last_os_error
Last OS error received so it can be reported if needed.
Definition: fsp0file.h:489
bool m_exists
true if file already existed on startup
Definition: fsp0file.h:473
bool is_raw_type()
Returns if the Datafile is created in raw partition.
Definition: fsp0file.h:233
Datafile(const Datafile &file)
Definition: fsp0file.h:124
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:451
uint32_t flags() const
Get Datafile::m_flags.
Definition: fsp0file.h:338
void set_open_flags(os_file_create_t open_flags)
Set the Datafile::m_open_flags.
Definition: fsp0file.h:421
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:386
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:876
void set_filename()
Set the filename pointer to the start of the file name in the filepath.
Definition: fsp0file.h:393
page_no_t m_size
size in pages
Definition: fsp0file.h:448
device_t m_type
The type of the data file.
Definition: fsp0file.h:454
pfs_os_file_t handle() const
Get Datafile::m_handle.
Definition: fsp0file.h:315
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:523
lsn_t get_flush_lsn()
Get LSN of first page.
Definition: fsp0file.h:300
dberr_t read_first_page(bool read_only_mode)
Reads a few significant fields from the first page of the datafile, which must already be open.
Definition: fsp0file.cc:317
dberr_t open_or_create(bool read_only_mode)
Create/open a data file.
Definition: fsp0file.cc:90
void init_file_info()
Initialize OS specific file info.
Definition: fsp0file.cc:177
void shutdown()
Release the resources.
Definition: fsp0file.cc:66
ulint order() const
Get Datafile::m_order.
Definition: fsp0file.h:322
~Datafile()
Definition: fsp0file.h:155
struct stat m_file_info
Use the following to determine the uniqueness of this datafile.
Definition: fsp0file.h:500
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:157
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:55
ulint server_version() const
Get Datafile::m_server_version.
Definition: fsp0file.h:326
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:436
byte * m_first_page
Buffer to hold first page.
Definition: fsp0file.h:479
pfs_os_file_t m_handle
Open file handle.
Definition: fsp0file.h:442
bool is_open() const
Definition: fsp0file.h:342
uint32_t m_encryption_master_key_id
Master key id read from first page.
Definition: fsp0file.h:513
uint32_t m_space_version
Space version.
Definition: fsp0file.h:465
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:470
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:510
ulint last_os_error() const
Get the last OS error reported.
Definition: fsp0file.h:350
os_file_create_t m_open_flags
Flags to use for opening the data file.
Definition: fsp0file.h:445
ulint space_version() const
Get Datafile::m_space_version.
Definition: fsp0file.h:330
char * m_filepath
Physical file path with base name and extension.
Definition: fsp0file.h:486
const char * name() const
Get Datafile::m_name.
Definition: fsp0file.h:307
char * m_filename
Points into m_filepath to the file name with extension.
Definition: fsp0file.h:439
bool m_is_valid
Definition: fsp0file.h:476
page_no_t size() const
Definition: fsp0file.h:372
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:53
Progress
Encryption progress type.
Definition: os0enc.h:79
Data structure that contains the information about shared tablespaces.
Definition: fsp0sysspace.h:57
Data structure that contains the information about shared tablespaces.
Definition: fsp0space.h:46
void set_space_id(space_id_t space_id)
Set the space id of the tablespace.
Definition: fsp0space.h:115
void set_flags(uint32_t fsp_flags)
Set the tablespace flags.
Definition: fsp0space.h:126
dberr_t
Definition: db0err.h:38
The low-level file system.
constexpr space_id_t SPACE_UNKNOWN
Unknown space id.
Definition: fil0fil.h:1152
ib_file_suffix
Common InnoDB file extensions.
Definition: fil0fil.h:582
constexpr uint32_t FIL_PAGE_LSN
lsn of the end of the newest modification log record to the page
Definition: fil0types.h:66
device_t
Types of raw partitions in innodb_data_file_path.
Definition: fsp0file.h:58
@ SRV_NOT_RAW
Not a raw partition.
Definition: fsp0file.h:61
@ SRV_NEW_RAW
A 'newraw' partition, only to be initialized.
Definition: fsp0file.h:64
@ SRV_OLD_RAW
An initialized raw partition.
Definition: fsp0file.h:67
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:62
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: http_request.h:49
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:716
The interface to the operating system file io.
os_file_create_t
Options for os_file_create_func.
Definition: os0file.h:198
@ OS_FILE_OPEN
to open an existing file (if doesn't exist, error)
Definition: os0file.h:199
static constexpr os_fd_t OS_FILE_CLOSED
Definition: os0file.h:154
const char * filename
Definition: pfs_example_component_population.cc:66
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Common file descriptor for file IO instrumentation with PFS on windows and other platforms.
Definition: os0file.h:175
os_file_t m_file
Definition: os0file.h:185
#define OS_PATH_SEPARATOR
Definition: univ.i:537
unsigned long int ulint
Definition: univ.i:405
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:68
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:56