diff options
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/btr0btr.h | 15 | ||||
-rw-r--r-- | storage/innobase/include/dict0mem.h | 26 | ||||
-rw-r--r-- | storage/innobase/include/row0log.h | 8 | ||||
-rw-r--r-- | storage/innobase/include/trx0rec.h | 4 |
4 files changed, 50 insertions, 3 deletions
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h index 7fae1ad163b..856bcff82c2 100644 --- a/storage/innobase/include/btr0btr.h +++ b/storage/innobase/include/btr0btr.h @@ -330,6 +330,14 @@ btr_node_ptr_get_child_page_no( const rec_offs* offsets)/*!< in: array returned by rec_get_offsets() */ MY_ATTRIBUTE((warn_unused_result)); +/** Initialize the root page of the b-tree +@param[in,out] block root block +@param[in] index_id index id +@param[in] index index of root page +@param[in,out] mtr mini-transaction */ +void btr_root_page_init(buf_block_t *block, index_id_t index_id, + dict_index_t *index, mtr_t *mtr); + /** Create the root node for a new index tree. @param[in] type type of the index @param[in,out] space tablespace where created @@ -757,4 +765,11 @@ Global variable controlling if scrubbing should be performed */ extern my_bool srv_immediate_scrub_data_uncompressed; extern Atomic_counter<uint32_t> btr_validate_index_running; +/** Free a B-tree except the root page. The root page MUST be freed after +this by calling btr_free_root. +@param[in,out] block root page +@param[in] log_mode mtr logging mode */ +void +btr_free_but_not_root(buf_block_t *block, mtr_log_t log_mode); + #endif diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index 1ad2517c8fb..d905b252571 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1368,6 +1368,9 @@ public: everything in overflow) size of the longest possible row and index of a field which made index records too big to fit on a page.*/ inline record_size_info_t record_size_info() const; + + /** Empty the index content and reinitialize the root page */ + void empty(que_thr_t *thr); }; /** Detach a virtual column from an index. @@ -1950,6 +1953,25 @@ struct dict_table_t { char (&tbl_name)[NAME_LEN + 1], size_t *db_name_len, size_t *tbl_name_len) const; + /** Empty the table */ + void empty_table(que_thr_t *thr); + + /** Set bulk operation */ + void set_bulk_trx(ulint trx_id) + { + bulk_trx_id= trx_id; + } + + void remove_bulk_trx() + { + bulk_trx_id= 0; + } + + bool is_bulk_trx(ulint trx_id) + { + return bulk_trx_id == trx_id; + } + private: /** Initialize instant->field_map. @param[in] table table definition to copy from */ @@ -2316,6 +2338,10 @@ public: /** mysql_row_templ_t for base columns used for compute the virtual columns */ dict_vcol_templ_t* vc_templ; + + /** Trx id of bulk operation. This is under the protection of + exclusive lock of table object */ + trx_id_t bulk_trx_id; }; inline void dict_index_t::set_modified(mtr_t& mtr) const diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h index 5ec4b9c1103..b046a19ac7e 100644 --- a/storage/innobase/include/row0log.h +++ b/storage/innobase/include/row0log.h @@ -102,9 +102,8 @@ row_log_online_op( /*==============*/ dict_index_t* index, /*!< in/out: index, S or X latched */ const dtuple_t* tuple, /*!< in: index tuple */ - trx_id_t trx_id) /*!< in: transaction ID for insert, + trx_id_t trx_id);/*!< in: transaction ID for insert, or 0 for delete */ - ATTRIBUTE_COLD __attribute__((nonnull)); /******************************************************//** Gets the error status of the online index rebuild log. @@ -258,6 +257,11 @@ row_log_estimate_work( const dict_index_t* index); #endif /* HAVE_PSI_STAGE_INTERFACE */ +/** Logs an empty operation of the table which means it should empty +the table. +@param index clustered index */ +void row_log_table_empty(dict_index_t *index); + #include "row0log.ic" #endif /* row0log.h */ diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h index 9aeff6312f6..d802deca75f 100644 --- a/storage/innobase/include/trx0rec.h +++ b/storage/innobase/include/trx0rec.h @@ -295,7 +295,9 @@ record */ a not delete marked record; also the fields of the record can change */ #define TRX_UNDO_DEL_MARK_REC 14 /* delete marking of a record; fields - do not change */ + do not change */ +#define TRX_UNDO_EMPTY 15 /* Empty the table */ + #define TRX_UNDO_CMPL_INFO_MULT 16U /* compilation info is multiplied by this and ORed to the type above */ #define TRX_UNDO_UPD_EXTERN 128U /* This bit can be ORed to type_cmpl |