54extern int meb_key_fetch(
const char *key_id,
char **
key_type,
55 const char *user_id,
void **
key,
size_t *key_length);
146 if (
file.m_filepath !=
nullptr) {
185 if (
file.m_filepath !=
nullptr) {
298 lsn_t *flush_lsn,
bool for_import);
493 using WIN32_FILE_INFO = BY_HANDLE_FILE_INFORMATION;
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:47
uint32_t page_no_t
Page number.
Definition: api0api.h:45
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:335
byte * m_encryption_iv
Encryption iv read from first page.
Definition: fsp0file.h:506
byte * m_encryption_key
Encryption key read from first page.
Definition: fsp0file.h:503
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:713
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:148
uint32_t m_server_version
Server version.
Definition: fsp0file.h:461
bool is_valid() const
Get Datafile::m_is_valid.
Definition: fsp0file.h:347
space_id_t m_space_id
Tablespace ID.
Definition: fsp0file.h:458
const char * filepath() const
Get Datafile::m_filepath.
Definition: fsp0file.h:312
void free_first_page()
Free the first page from memory when it is no longer needed.
Definition: fsp0file.cc:363
bool m_atomic_write
true if atomic writes enabled for this file
Definition: fsp0file.h:481
dberr_t validate_for_recovery(space_id_t space_id)
Validates this datafile for the purpose of recovery.
Definition: fsp0file.cc:450
ulint m_last_os_error
Last OS error received so it can be reported if needed.
Definition: fsp0file.h:488
bool m_exists
true if file already existed on startup
Definition: fsp0file.h:472
bool is_raw_type()
Returns if the Datafile is created in raw partition.
Definition: fsp0file.h:234
Datafile(const Datafile &file)
Definition: fsp0file.h:125
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:206
ulint m_order
ordinal position of this datafile in the tablespace
Definition: fsp0file.h:450
uint32_t flags() const
Get Datafile::m_flags.
Definition: fsp0file.h:339
void set_open_flags(os_file_create_t open_flags)
Set the Datafile::m_open_flags.
Definition: fsp0file.h:420
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:254
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:376
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:867
void set_filename()
Set the filename pointer to the start of the file name in the filepath.
Definition: fsp0file.h:394
page_no_t m_size
size in pages
Definition: fsp0file.h:447
device_t m_type
The type of the data file.
Definition: fsp0file.h:453
pfs_os_file_t handle() const
Get Datafile::m_handle.
Definition: fsp0file.h:316
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:513
lsn_t get_flush_lsn()
Get LSN of first page.
Definition: fsp0file.h:301
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:178
void shutdown()
Release the resources.
Definition: fsp0file.cc:67
ulint order() const
Get Datafile::m_order.
Definition: fsp0file.h:323
~Datafile()
Definition: fsp0file.h:156
struct stat m_file_info
Use the following to determine the uniqueness of this datafile.
Definition: fsp0file.h:499
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:113
Datafile(const char *name, uint32_t flags, page_no_t size, ulint order)
Definition: fsp0file.h:100
Datafile & operator=(const Datafile &file)
Definition: fsp0file.h:158
void free_filepath()
Free the filepath buffer.
Definition: fsp0file.cc:240
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:327
bool same_as(const Datafile &other) const
Test if another opened datafile is the same file as this object.
Definition: fsp0file.cc:261
char * m_name
Datafile name at the tablespace location.
Definition: fsp0file.h:435
byte * m_first_page
Buffer to hold first page.
Definition: fsp0file.h:478
pfs_os_file_t m_handle
Open file handle.
Definition: fsp0file.h:441
bool is_open() const
Definition: fsp0file.h:343
uint32_t m_encryption_master_key_id
Master key id read from first page.
Definition: fsp0file.h:512
uint32_t m_space_version
Space version.
Definition: fsp0file.h:464
void set_filepath(const char *filepath)
Set the filepath by duplicating the filepath sent in.
Definition: fsp0file.cc:231
uint32_t m_flags
Tablespace flags.
Definition: fsp0file.h:469
dberr_t close()
Close a data file.
Definition: fsp0file.cc:188
Encryption::Progress m_encryption_op_in_progress
Encryption operation in progress.
Definition: fsp0file.h:509
ulint last_os_error() const
Get the last OS error reported.
Definition: fsp0file.h:351
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:314
os_file_create_t m_open_flags
Flags to use for opening the data file.
Definition: fsp0file.h:444
ulint space_version() const
Get Datafile::m_space_version.
Definition: fsp0file.h:331
char * m_filepath
Physical file path with base name and extension.
Definition: fsp0file.h:485
const char * name() const
Get Datafile::m_name.
Definition: fsp0file.h:308
char * m_filename
Points into m_filepath to the file name with extension.
Definition: fsp0file.h:438
bool m_is_valid
Definition: fsp0file.h:475
page_no_t size() const
Definition: fsp0file.h:373
void set_name(const char *name)
Allocate and set the datafile or tablespace name in m_name.
Definition: fsp0file.cc:279
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:1165
ib_file_suffix
Common InnoDB file extensions.
Definition: fil0fil.h:587
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:52
void free(void *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::malloc*(),...
Definition: ut0new.h:717
The interface to the operating system file io.
os_file_create_t
Options for os_file_create_func.
Definition: os0file.h:199
@ OS_FILE_OPEN
to open an existing file (if doesn't exist, error)
Definition: os0file.h:200
static constexpr os_fd_t OS_FILE_CLOSED
Definition: os0file.h:155
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:176
os_file_t m_file
Definition: os0file.h:186
#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