64 DBUG_PRINT(
"ha_archive", (
"~Archive_share: %p",
this));
85#define ARCHIVE_VERSION 3
110 const char *
table_type()
const override {
return "ARCHIVE"; }
127 [[maybe_unused]])
const override {
134 int index_init(uint keynr,
bool sorted)
override;
140 int open(
const char *
name,
int mode, uint test_if_locked,
142 int close(
void)
override;
146 int rnd_init(
bool scan =
true)
override;
159 int info(uint)
override;
182 uint table_changes)
override;
Definition: ha_archive.h:50
Archive_share()
Definition: ha_archive.cc:249
ha_rows rows_recorded
Definition: ha_archive.h:55
bool crashed
Definition: ha_archive.h:61
azio_stream archive_write
Definition: ha_archive.h:54
~Archive_share() override
Definition: ha_archive.h:63
THR_LOCK lock
Definition: ha_archive.h:53
char table_name[FN_REFLEN]
Definition: ha_archive.h:56
int read_v1_metafile()
Read version 1 meta file (5.0 compatibility routine).
Definition: ha_archive.cc:288
int init_archive_writer()
Definition: ha_archive.cc:469
bool archive_write_open
Definition: ha_archive.h:59
bool dirty
Definition: ha_archive.h:60
void close_archive_writer()
Definition: ha_archive.cc:486
int write_v1_metafile()
Write version 1 meta file (5.0 compatibility routine).
Definition: ha_archive.cc:318
char data_file_name[FN_REFLEN]
Definition: ha_archive.h:57
bool in_optimize
Definition: ha_archive.h:58
mysql_mutex_t mutex
Definition: ha_archive.h:52
Base class to be used by handlers different shares.
Definition: handler.h:4127
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: ha_archive.h:87
archive_record_buffer * record_buffer
Definition: ha_archive.h:100
ha_rows scan_rows
Definition: ha_archive.h:95
~ha_archive() override=default
int truncate(dd::Table *table_def) override
Quickly remove all rows from a table.
Definition: ha_archive.cc:1471
virtual int index_read_idx(uchar *buf, uint index, const uchar *key, uint key_len, enum ha_rkey_function find_flag)
Definition: ha_archive.cc:864
int check(THD *thd, HA_CHECK_OPT *check_opt) override
Definition: ha_archive.cc:1504
uint32 max_row_length(const uchar *buf)
Definition: ha_archive.cc:735
uint max_supported_key_length() const override
Definition: ha_archive.h:125
int close(void) override
Definition: ha_archive.cc:580
int write_row(uchar *buf) override
Write a row.
Definition: ha_archive.cc:786
THR_LOCK_DATA lock
Definition: ha_archive.h:88
bool bulk_insert
Definition: ha_archive.h:96
int real_write_row(uchar *buf, azio_stream *writer)
Definition: ha_archive.cc:710
bool auto_repair() const override
Check if the table can be automatically repaired.
Definition: ha_archive.h:154
int get_row_version3(azio_stream *file_to_read, uchar *buf)
Definition: ha_archive.cc:1033
archive_record_buffer * create_record_buffer(unsigned int length)
Definition: ha_archive.cc:1558
int rnd_pos(uchar *buf, uchar *pos) override
Definition: ha_archive.cc:1145
int extra(enum ha_extra_function operation) override
Handler hints.
Definition: ha_archive.cc:1416
my_off_t current_position
Definition: ha_archive.h:92
int info(uint) override
General method to gather info from handler.
Definition: ha_archive.cc:1350
ulong index_flags(uint, uint, bool) const override
Definition: ha_archive.h:118
void update_create_info(HA_CREATE_INFO *create_info) override
Update create info as part of ALTER TABLE.
Definition: ha_archive.cc:1334
int get_row_version2(azio_stream *file_to_read, uchar *buf)
Definition: ha_archive.cc:1041
int get_row(azio_stream *file_to_read, uchar *buf)
Definition: ha_archive.cc:941
bool archive_reader_open
Definition: ha_archive.h:101
Archive_share * get_share(const char *table_name, int *rc)
Definition: ha_archive.cc:417
int repair(THD *thd, HA_CHECK_OPT *check_opt) override
In this method check_opt can be modified to specify CHECK option to use to call check() upon the tabl...
Definition: ha_archive.cc:1164
int rnd_init(bool scan=true) override
rnd_init() can be called two times without rnd_end() in between (it only makes sense if scan=1).
Definition: ha_archive.cc:918
int rnd_next(uchar *buf) override
Definition: ha_archive.cc:1108
unsigned int pack_row(uchar *record, azio_stream *writer)
Definition: ha_archive.cc:749
bool fix_rec_buff(unsigned int length)
Definition: ha_archive.cc:957
uchar byte_buffer[IO_SIZE]
Definition: ha_archive.h:93
ulonglong table_flags() const override
Definition: ha_archive.h:111
void destroy_record_buffer(archive_record_buffer *r)
Definition: ha_archive.cc:1577
unsigned int pack_row_v1(uchar *record)
Pack version 1 row (5.0 compatibility routine).
Definition: ha_archive.cc:352
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info, dd::Table *table_def) override
Create table (implementation).
Definition: ha_archive.cc:602
int index_next(uchar *buf) override
Definition: ha_archive.cc:895
THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) override
Is not invoked for non-transactional temporary tables.
Definition: ha_archive.cc:1301
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override
Part of old, deprecated in-place ALTER API.
Definition: ha_archive.cc:1583
int end_bulk_insert() override
Definition: ha_archive.cc:1457
int unpack_row(azio_stream *file_to_read, uchar *record)
Definition: ha_archive.cc:977
const char * table_type() const override
The following can be called without an open handler.
Definition: ha_archive.h:110
ha_archive(handlerton *hton, TABLE_SHARE *table_arg)
Definition: ha_archive.cc:263
int init_archive_reader()
Definition: ha_archive.cc:499
String buffer
Definition: ha_archive.h:94
bool check_and_repair(THD *thd) override
Check and repair the table if necessary.
Definition: ha_archive.cc:1551
void position(const uchar *record) override
Definition: ha_archive.cc:1133
int index_read(uchar *buf, const uchar *key, uint key_len, enum ha_rkey_function find_flag) override
Definition: ha_archive.cc:856
int open(const char *name, int mode, uint test_if_locked, const dd::Table *table_def) override
Definition: ha_archive.cc:525
int records(ha_rows *num_rows) override
Number of rows in table.
Definition: ha_archive.h:130
Archive_share * share
Definition: ha_archive.h:89
enum row_type get_real_row_type(const HA_CREATE_INFO *) const override
Get real row type for the table created based on one specified by user, CREATE TABLE options and SE c...
Definition: ha_archive.h:168
uint max_supported_keys() const override
Definition: ha_archive.h:124
uint current_k_offset
Definition: ha_archive.h:99
bool is_crashed() const override
Check if the table is crashed.
Definition: ha_archive.cc:1479
void start_bulk_insert(ha_rows rows) override
Definition: ha_archive.cc:1447
int read_data_header(azio_stream *file_to_read)
Definition: ha_archive.cc:374
uint max_supported_key_part_length(HA_CREATE_INFO *create_info) const override
Definition: ha_archive.h:126
uint current_key_len
Definition: ha_archive.h:98
azio_stream archive
Definition: ha_archive.h:91
int check_for_upgrade(HA_CHECK_OPT *check_opt) override
Check for upgrade.
Definition: ha_archive.cc:1493
int index_init(uint keynr, bool sorted) override
Definition: ha_archive.cc:846
void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values) override
Reserves an interval of auto_increment values from the handler.
Definition: ha_archive.cc:838
int optimize(THD *thd, HA_CHECK_OPT *check_opt) override
Definition: ha_archive.cc:1178
const uchar * current_key
Definition: ha_archive.h:97
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4583
A table definition from the master.
Definition: rpl_utility.h:249
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_destroy(M)
Definition: mysql_mutex.h:46
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
ha_rkey_function
Definition: my_base.h:78
my_off_t ha_rows
Definition: my_base.h:1141
ha_extra_function
Definition: my_base.h:185
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
constexpr const size_t IO_SIZE
Definition: my_io.h:159
static int record
Definition: mysqltest.cc:193
Definition: buf0block_hint.cc:30
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
const char * table_name
Definition: rules_table_service.cc:56
mode
Definition: file_handle.h:61
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#define HA_COUNT_ROWS_INSTANT
Definition: handler.h:340
#define HA_BINLOG_ROW_CAPABLE
Definition: handler.h:347
#define HA_CAN_BIT_FIELD
Definition: handler.h:337
#define HA_FILE_BASED
Definition: handler.h:332
#define HA_UPDATE_NOT_SUPPORTED
Handlers with this flag set do not support UPDATE operations.
Definition: handler.h:507
#define HA_DELETE_NOT_SUPPORTED
Handlers with this flag set do not support DELETE operations.
Definition: handler.h:512
#define HA_CAN_REPAIR
Definition: handler.h:377
#define HA_CAN_GEOMETRY
Definition: handler.h:236
row_type
Definition: handler.h:684
@ ROW_TYPE_COMPRESSED
Definition: handler.h:689
#define HA_BINLOG_STMT_CAPABLE
Definition: handler.h:348
#define HA_NO_TRANSACTIONS
Definition: handler.h:218
#define HA_STATS_RECORDS_IS_EXACT
Definition: handler.h:280
#define HA_ONLY_WHOLE_INDEX
Definition: handler.h:562
Our own string classes, used pervasively throughout the executor.
case opt name
Definition: sslopt-case.h:29
Definition: handler.h:3803
Struct to hold information about the table that should be created.
Definition: handler.h:3210
This structure is shared between different table objects.
Definition: table.h:704
Definition: thr_lock.h:124
Definition: thr_lock.h:139
Definition: ha_archive.h:45
uint32 length
Definition: ha_archive.h:47
uchar * buffer
Definition: ha_archive.h:46
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2740
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
thr_lock_type
Definition: thr_lock.h:51
void thr_lock_delete(THR_LOCK *lock)
Definition: thr_lock.cc:323