summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/btr0cur.h60
-rw-r--r--storage/innobase/include/btr0pcur.ic44
-rw-r--r--storage/innobase/include/buf0buf.h12
-rw-r--r--storage/innobase/include/buf0buf.ic4
-rw-r--r--storage/innobase/include/data0type.h9
-rw-r--r--storage/innobase/include/dict0dict.h65
-rw-r--r--storage/innobase/include/dict0dict.ic90
-rw-r--r--storage/innobase/include/dict0mem.h137
-rw-r--r--storage/innobase/include/dict0mem.ic29
-rw-r--r--storage/innobase/include/dict0stats.ic2
-rw-r--r--storage/innobase/include/mtr0mtr.h16
-rw-r--r--storage/innobase/include/mtr0mtr.ic7
-rw-r--r--storage/innobase/include/page0cur.h17
-rw-r--r--storage/innobase/include/page0cur.ic29
-rw-r--r--storage/innobase/include/row0mysql.h22
-rw-r--r--storage/innobase/include/row0sel.h38
-rw-r--r--storage/innobase/include/row0sel.ic9
-rw-r--r--storage/innobase/include/sync0types.h27
18 files changed, 45 insertions, 572 deletions
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index f582f04733c..e445331b60c 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -192,37 +192,6 @@ btr_cur_search_to_nth_level(
ulint line, /*!< in: line where called */
mtr_t* mtr); /*!< in: mtr */
-/** Searches an index tree and positions a tree cursor on a given level.
-This function will avoid placing latches the travesal path and so
-should be used only for cases where-in latching is not needed.
-
-@param[in] index index
-@param[in] level the tree level of search
-@param[in] tuple data tuple; Note: n_fields_cmp in compared
- to the node ptr page node field
-@param[in] mode PAGE_CUR_L, ....
- Insert should always be made using PAGE_CUR_LE
- to search the position.
-@param[in,out] cursor tree cursor; points to record of interest.
-@param[in] file file name
-@param[in[ line line where called from
-@param[in,out] mtr mtr
-@param[in] mark_dirty
- if true then mark the block as dirty
-@return DB_SUCCESS or error code */
-dberr_t
-btr_cur_search_to_nth_level_with_no_latch(
- dict_index_t* index,
- ulint level,
- const dtuple_t* tuple,
- page_cur_mode_t mode,
- btr_cur_t* cursor,
- const char* file,
- ulint line,
- mtr_t* mtr,
- bool mark_dirty = true)
- __attribute__((warn_unused_result));
-
/*****************************************************************//**
Opens a cursor at either end of an index.
@return DB_SUCCESS or error code */
@@ -244,35 +213,6 @@ btr_cur_open_at_index_side_func(
#define btr_cur_open_at_index_side(f,i,l,c,lv,m) \
btr_cur_open_at_index_side_func(f,i,l,c,lv,__FILE__,__LINE__,m)
-/** Opens a cursor at either end of an index.
-Avoid taking latches on buffer, just pin (by incrementing fix_count)
-to keep them in buffer pool. This mode is used by intrinsic table
-as they are not shared and so there is no need of latching.
-@param[in] from_left true if open to low end, false if open
- to high end.
-@param[in] index index
-@param[in] latch_mode latch mode
-@param[in,out] cursor cursor
-@param[in] file file name
-@param[in] line line where called
-@param[in,out] mtr mini transaction
-@return DB_SUCCESS or error code
-*/
-dberr_t
-btr_cur_open_at_index_side_with_no_latch_func(
- bool from_left,
- dict_index_t* index,
- btr_cur_t* cursor,
- ulint level,
- const char* file,
- ulint line,
- mtr_t* mtr)
- __attribute__((warn_unused_result));
-
-#define btr_cur_open_at_index_side_with_no_latch(f,i,c,lv,m) \
- btr_cur_open_at_index_side_with_no_latch_func( \
- f,i,c,lv,__FILE__,__LINE__,m)
-
/**********************************************************************//**
Positions a cursor at a randomly chosen position within a B-tree.
@return true if the index is available and we have put the cursor, false
diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic
index 6cd968b4682..e7ae85dd730 100644
--- a/storage/innobase/include/btr0pcur.ic
+++ b/storage/innobase/include/btr0pcur.ic
@@ -452,20 +452,9 @@ btr_pcur_open_low(
ut_ad(!dict_index_is_spatial(index));
- if (dict_table_is_intrinsic(index->table)) {
- ut_ad((latch_mode & BTR_MODIFY_LEAF)
- || (latch_mode & BTR_SEARCH_LEAF)
- || (latch_mode & BTR_MODIFY_TREE));
- err = btr_cur_search_to_nth_level_with_no_latch(
- index, level, tuple, mode, btr_cursor,
- file, line, mtr,
- (((latch_mode & BTR_MODIFY_LEAF)
- || (latch_mode & BTR_MODIFY_TREE)) ? true : false));
- } else {
- err = btr_cur_search_to_nth_level(
- index, level, tuple, mode, latch_mode,
- btr_cursor, 0, file, line, mtr);
- }
+ err = btr_cur_search_to_nth_level(
+ index, level, tuple, mode, latch_mode,
+ btr_cursor, 0, file, line, mtr);
if (err != DB_SUCCESS) {
ib::warn() << " Error code: " << err
@@ -521,18 +510,9 @@ btr_pcur_open_with_no_init_func(
btr_cursor = btr_pcur_get_btr_cur(cursor);
- if (dict_table_is_intrinsic(index->table)) {
- ut_ad((latch_mode & BTR_MODIFY_LEAF)
- || (latch_mode & BTR_SEARCH_LEAF));
- err = btr_cur_search_to_nth_level_with_no_latch(
- index, 0, tuple, mode, btr_cursor,
- file, line, mtr,
- ((latch_mode & BTR_MODIFY_LEAF) ? true : false));
- } else {
- err = btr_cur_search_to_nth_level(
- index, 0, tuple, mode, latch_mode, btr_cursor,
- has_search_latch, file, line, mtr);
- }
+ err = btr_cur_search_to_nth_level(
+ index, 0, tuple, mode, latch_mode, btr_cursor,
+ has_search_latch, file, line, mtr);
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
@@ -568,15 +548,9 @@ btr_pcur_open_at_index_side(
btr_pcur_init(pcur);
}
- if (dict_table_is_intrinsic(index->table)) {
- err = btr_cur_open_at_index_side_with_no_latch(
- from_left, index,
- btr_pcur_get_btr_cur(pcur), level, mtr);
- } else {
- err = btr_cur_open_at_index_side(
- from_left, index, latch_mode,
- btr_pcur_get_btr_cur(pcur), level, mtr);
- }
+ err = btr_cur_open_at_index_side(
+ from_left, index, latch_mode,
+ btr_pcur_get_btr_cur(pcur), level, mtr);
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
pcur->old_stored = false;
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index c4bc107044d..617bb2b9b5d 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -570,9 +570,6 @@ BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or BUF_GET_IF_IN_POOL_OR_WATCH
@param[in] line line where called
@param[in] mtr mini-transaction
@param[out] err DB_SUCCESS or error code
-@param[in] dirty_with_no_latch
- mark page as dirty even if page
- is being pinned without any latch
@return pointer to the block or NULL */
buf_block_t*
buf_page_get_gen(
@@ -584,8 +581,7 @@ buf_page_get_gen(
const char* file,
ulint line,
mtr_t* mtr,
- dberr_t* err,
- bool dirty_with_no_latch = false);
+ dberr_t* err);
/** Initializes a page to the buffer buf_pool. The page is usually not read
from a file even if it cannot be found in the buffer buf_pool. This is one
@@ -1901,12 +1897,6 @@ struct buf_block_t{
complete, though: there may
have been hash collisions,
record deletions, etc. */
- bool made_dirty_with_no_latch;
- /*!< true if block has been made dirty
- without acquiring X/SX latch as the
- block belongs to temporary tablespace
- and block is always accessed by a
- single thread. */
bool skip_flush_check;
/*!< Skip check in buf_dblwr_check_block
during bulk load, protected by lock.*/
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index a912f3eb127..9c28432d551 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -926,7 +926,7 @@ buf_block_modify_clock_inc(
#ifdef UNIV_DEBUG
buf_pool_t* buf_pool = buf_pool_from_bpage((buf_page_t*) block);
- /* No latch is acquired if block belongs to intrinsic table. */
+ /* No latch is acquired for the shared temporary tablespace. */
if (!fsp_is_system_temporary(block->page.id.space())) {
ut_ad((buf_pool_mutex_own(buf_pool)
&& (block->page.buf_fix_count == 0))
@@ -949,7 +949,7 @@ buf_block_get_modify_clock(
buf_block_t* block) /*!< in: block */
{
#ifdef UNIV_DEBUG
- /* No latch is acquired if block belongs to intrinsic table. */
+ /* No latch is acquired for the shared temporary tablespace. */
if (!fsp_is_system_temporary(block->page.id.space())) {
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_S)
|| rw_lock_own(&(block->lock), RW_LOCK_X)
diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h
index 00073dfca2c..27310963ec5 100644
--- a/storage/innobase/include/data0type.h
+++ b/storage/innobase/include/data0type.h
@@ -166,10 +166,6 @@ be less than 256 */
#define DATA_N_SYS_COLS 3 /* number of system columns defined above */
-#define DATA_ITT_N_SYS_COLS 2
- /* number of system columns for intrinsic
- temporary table */
-
#define DATA_FTS_DOC_ID 3 /* Used as FTS DOC ID column */
#define DATA_SYS_PRTYPE_MASK 0xF /* mask to extract the above from prtype */
@@ -196,6 +192,11 @@ be less than 256 */
for shorter VARCHARs MySQL uses only 1 byte */
#define DATA_VIRTUAL 8192 /* Virtual column */
+/** Get the number of system columns in a table. */
+#define dict_table_get_n_sys_cols(table) DATA_N_SYS_COLS
+/** Check whether locking is disabled (never). */
+#define dict_table_is_locking_disabled(table) false
+
/*-------------------------------------------*/
/* This many bytes we need to store the type information affecting the
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index ccef08ff73f..e7eb558d6fd 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -843,17 +843,6 @@ ulint
dict_table_get_n_tot_u_cols(
const dict_table_t* table);
/********************************************************************//**
-Gets the number of system columns in a table.
-For intrinsic table on ROW_ID column is added for all other
-tables TRX_ID and ROLL_PTR are all also appeneded.
-@return number of system (e.g., ROW_ID) columns of a table */
-UNIV_INLINE
-ulint
-dict_table_get_n_sys_cols(
-/*======================*/
- const dict_table_t* table) /*!< in: table */
- MY_ATTRIBUTE((warn_unused_result));
-/********************************************************************//**
Gets the number of all non-virtual columns (also system) in a table
in the dictionary cache.
@return number of columns of a table */
@@ -2016,24 +2005,6 @@ dict_table_is_encrypted(
const dict_table_t* table) /*!< in: table to check */
MY_ATTRIBUTE((warn_unused_result));
-/** Check whether the table is intrinsic.
-An intrinsic table is a special kind of temporary table that
-is invisible to the end user. It is created internally by the MySQL server
-layer or other module connected to InnoDB in order to gather and use data
-as part of a larger task. Since access to it must be as fast as possible,
-it does not need UNDO semantics, system fields DB_TRX_ID & DB_ROLL_PTR,
-doublewrite, checksum, insert buffer, use of the shared data dictionary,
-locking, or even a transaction. In short, these are not ACID tables at all,
-just temporary
-
-@param[in] table table to check
-@return true if intrinsic table flag is set. */
-UNIV_INLINE
-bool
-dict_table_is_intrinsic(
- const dict_table_t* table)
- MY_ATTRIBUTE((warn_unused_result));
-
/** Check if the table is in a shared tablespace (System or General).
@param[in] id Space ID to check
@return true if id is a shared tablespace, false if not. */
@@ -2043,18 +2014,6 @@ dict_table_in_shared_tablespace(
const dict_table_t* table)
MY_ATTRIBUTE((warn_unused_result));
-/** Check whether locking is disabled for this table.
-Currently this is done for intrinsic table as their visibility is limited
-to the connection only.
-
-@param[in] table table to check
-@return true if locking is disabled. */
-UNIV_INLINE
-bool
-dict_table_is_locking_disabled(
- const dict_table_t* table)
- MY_ATTRIBUTE((warn_unused_result));
-
/********************************************************************//**
Turn-off redo-logging if temporary table. */
UNIV_INLINE
@@ -2064,30 +2023,6 @@ dict_disable_redo_if_temporary(
const dict_table_t* table, /*!< in: table to check */
mtr_t* mtr); /*!< out: mini-transaction */
-/** Get table session row-id and increment the row-id counter for next use.
-@param[in,out] table table handler
-@return next table local row-id. */
-UNIV_INLINE
-row_id_t
-dict_table_get_next_table_sess_row_id(
- dict_table_t* table);
-
-/** Get table session trx-id and increment the trx-id counter for next use.
-@param[in,out] table table handler
-@return next table local trx-id. */
-UNIV_INLINE
-trx_id_t
-dict_table_get_next_table_sess_trx_id(
- dict_table_t* table);
-
-/** Get current session trx-id.
-@param[in] table table handler
-@return table local trx-id. */
-UNIV_INLINE
-trx_id_t
-dict_table_get_curr_table_sess_trx_id(
- const dict_table_t* table);
-
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
This function should be called whenever a page is successfully
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 8165263c95c..5e5fbae9081 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -447,23 +447,6 @@ dict_table_get_n_tot_u_cols(
return(dict_table_get_n_user_cols(table)
+ dict_table_get_n_v_cols(table));
}
-/********************************************************************//**
-Gets the number of system columns in a table.
-For intrinsic table on ROW_ID column is added for all other
-tables TRX_ID and ROLL_PTR are all also appeneded.
-@return number of system (e.g., ROW_ID) columns of a table */
-UNIV_INLINE
-ulint
-dict_table_get_n_sys_cols(
-/*======================*/
- const dict_table_t* table MY_ATTRIBUTE((unused))) /*!< in: table */
-{
- ut_ad(table);
- ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
-
- return(dict_table_is_intrinsic(table)
- ? DATA_ITT_N_SYS_COLS : DATA_N_SYS_COLS);
-}
/********************************************************************//**
Gets the number of all non-virtual columns (also system) in a table
@@ -1816,26 +1799,6 @@ dict_table_is_encrypted(
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_ENCRYPTION));
}
-/** Check whether the table is intrinsic.
-An intrinsic table is a special kind of temporary table that
-is invisible to the end user. It can be created internally by InnoDB, the MySQL
-server layer or other modules connected to InnoDB in order to gather and use
-data as part of a larger task. Since access to it must be as fast as possible,
-it does not need UNDO semantics, system fields DB_TRX_ID & DB_ROLL_PTR,
-doublewrite, checksum, insert buffer, use of the shared data dictionary,
-locking, or even a transaction. In short, these are not ACID tables at all,
-just temporary data stored and manipulated during a larger process.
-
-@param[in] table table to check
-@return true if intrinsic table flag is set. */
-UNIV_INLINE
-bool
-dict_table_is_intrinsic(
- const dict_table_t* table)
-{
- return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_INTRINSIC));
-}
-
/** Check if the table is in a shared tablespace (System or General).
@param[in] id Space ID to check
@return true if id is a shared tablespace, false if not. */
@@ -1848,20 +1811,6 @@ dict_table_in_shared_tablespace(
|| DICT_TF_HAS_SHARED_SPACE(table->flags));
}
-/** Check whether locking is disabled for this table.
-Currently this is done for intrinsic table as their visibility is limited
-to the connection only.
-
-@param[in] table table to check
-@return true if locking is disabled. */
-UNIV_INLINE
-bool
-dict_table_is_locking_disabled(
- const dict_table_t* table)
-{
- return(dict_table_is_intrinsic(table));
-}
-
/********************************************************************//**
Turn-off redo-logging if temporary table. */
UNIV_INLINE
@@ -1946,46 +1895,13 @@ dict_table_get_index_on_first_col(
return(0);
}
-/** Get table session row-id and increment the row-id counter for next use.
-@param[in,out] table table handler
-@return next table session row-id. */
-UNIV_INLINE
-row_id_t
-dict_table_get_next_table_sess_row_id(
- dict_table_t* table)
-{
- return(++table->sess_row_id);
-}
-
-/** Get table session trx-id and increment the trx-id counter for next use.
-@param[in,out] table table handler
-@return next table session trx-id. */
-UNIV_INLINE
-trx_id_t
-dict_table_get_next_table_sess_trx_id(
- dict_table_t* table)
-{
- return(++table->sess_trx_id);
-}
-
-/** Get current session trx-id.
-@param[in] table table handler
-@return table session trx-id. */
-UNIV_INLINE
-trx_id_t
-dict_table_get_curr_table_sess_trx_id(
- const dict_table_t* table)
-{
- return(table->sess_trx_id);
-}
-
/** Get reference count.
@return current value of n_ref_count */
inline
ulint
dict_table_t::get_ref_count() const
{
- ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this));
+ ut_ad(mutex_own(&dict_sys->mutex));
return(n_ref_count);
}
@@ -1994,7 +1910,7 @@ inline
void
dict_table_t::acquire()
{
- ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this));
+ ut_ad(mutex_own(&dict_sys->mutex));
++n_ref_count;
}
@@ -2003,7 +1919,7 @@ inline
void
dict_table_t::release()
{
- ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(this));
+ ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(n_ref_count > 0);
--n_ref_count;
}
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 4ee19f96008..019e20680e5 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -337,12 +337,6 @@ use its own tablespace instead of the system tablespace. */
index tables) of a FTS table are in HEX format. */
#define DICT_TF2_FTS_AUX_HEX_NAME 64
-/** Intrinsic table bit
-Intrinsic table is table created internally by MySQL modules viz. Optimizer,
-FTS, etc.... Intrinsic table has all the properties of the normal table except
-it is not created by user and so not visible to end-user. */
-#define DICT_TF2_INTRINSIC 128
-
/** Encryption table bit. */
#define DICT_TF2_ENCRYPTION 256
@@ -859,95 +853,6 @@ struct zip_pad_info_t {
a certain index.*/
#define STAT_DEFRAG_DATA_SIZE_N_SAMPLE 10
-/** If key is fixed length key then cache the record offsets on first
-computation. This will help save computation cycle that generate same
-redundant data. */
-class rec_cache_t
-{
-public:
- /** Constructor */
- rec_cache_t()
- :
- rec_size(),
- offsets(),
- sz_of_offsets(),
- fixed_len_key(),
- offsets_cached(),
- key_has_null_cols()
- {
- /* Do Nothing. */
- }
-
-public:
- /** Record size. (for fixed length key record size is constant) */
- ulint rec_size;
-
- /** Holds reference to cached offsets for record. */
- ulint* offsets;
-
- /** Size of offset array */
- uint32_t sz_of_offsets;
-
- /** If true, then key is fixed length key. */
- bool fixed_len_key;
-
- /** If true, then offset has been cached for re-use. */
- bool offsets_cached;
-
- /** If true, then key part can have columns that can take
- NULL values. */
- bool key_has_null_cols;
-};
-
-/** Cache position of last inserted or selected record by caching record
-and holding reference to the block where record resides.
-Note: We don't commit mtr and hold it beyond a transaction lifetime as this is
-a special case (intrinsic table) that are not shared accross connection. */
-class last_ops_cur_t
-{
-public:
- /** Constructor */
- last_ops_cur_t()
- :
- rec(),
- block(),
- mtr(),
- disable_caching(),
- invalid()
- {
- /* Do Nothing. */
- }
-
- /* Commit mtr and re-initialize cache record and block to NULL. */
- void release()
- {
- if (mtr.is_active()) {
- mtr_commit(&mtr);
- }
- rec = NULL;
- block = NULL;
- invalid = false;
- }
-
-public:
- /** last inserted/selected record. */
- rec_t* rec;
-
- /** block where record reside. */
- buf_block_t* block;
-
- /** active mtr that will be re-used for next insert/select. */
- mtr_t mtr;
-
- /** disable caching. (disabled when table involves blob/text.) */
- bool disable_caching;
-
- /** If index structure is undergoing structural change viz.
- split then invalidate the cached position as it would be no more
- remain valid. Will be re-cached on post-split insert. */
- bool invalid;
-};
-
/** "GEN_CLUST_INDEX" is the name reserved for InnoDB default
system clustered index when there is no primary key. */
const char innobase_index_reserve_name[] = "GEN_CLUST_INDEX";
@@ -990,18 +895,15 @@ struct dict_index_t{
/*!< number of columns the user defined to
be in the index: in the internal
representation we add more columns */
- unsigned allow_duplicates:1;
- /*!< if true, allow duplicate values
- even if index is created with unique
- constraint */
unsigned nulls_equal:1;
/*!< if true, SQL NULL == SQL NULL */
- unsigned disable_ahi:1;
- /*!< in true, then disable AHI.
- Currently limited to intrinsic
- temporary table as index id is not
- unqiue for such table which is one of the
- validation criterion for ahi. */
+#ifdef MYSQL_INDEX_DISABLE_AHI
+ unsigned disable_ahi:1;
+ /*!< whether to disable the
+ adaptive hash index.
+ Maybe this could be disabled for
+ temporary tables? */
+#endif
unsigned n_uniq:10;/*!< number of fields from the beginning
which are enough to determine an index
entry uniquely */
@@ -1098,19 +1000,6 @@ struct dict_index_t{
/* in which slot the next sample should be
saved. */
/* @} */
- last_ops_cur_t* last_ins_cur;
- /*!< cache the last insert position.
- Currently limited to auto-generated
- clustered index on intrinsic table only. */
- last_ops_cur_t* last_sel_cur;
- /*!< cache the last selected position
- Currently limited to intrinsic table only. */
- rec_cache_t rec_cache;
- /*!< cache the field that needs to be
- re-computed on each insert.
- Limited to intrinsic table as this is common
- share and can't be used without protection
- if table is accessible to multiple-threads. */
rtr_ssn_t rtr_ssn;/*!< Node sequence number for RTree */
rtr_info_track_t*
rtr_track;/*!< tracking all R-Tree search cursors */
@@ -1874,18 +1763,6 @@ public:
/** Timestamp of the last modification of this table. */
time_t update_time;
- /** row-id counter for use by intrinsic table for getting row-id.
- Given intrinsic table semantics, row-id can be locally maintained
- instead of getting it from central generator which involves mutex
- locking. */
- ib_uint64_t sess_row_id;
-
- /** trx_id counter for use by intrinsic table for getting trx-id.
- Intrinsic table are not shared so don't need a central trx-id
- but just need a increased counter to track consistent view while
- proceeding SELECT as part of UPDATE. */
- ib_uint64_t sess_trx_id;
-
#endif /* !UNIV_HOTBACKUP */
bool is_encrypted;
diff --git a/storage/innobase/include/dict0mem.ic b/storage/innobase/include/dict0mem.ic
index 3269596feb7..a50fb615a09 100644
--- a/storage/innobase/include/dict0mem.ic
+++ b/storage/innobase/include/dict0mem.ic
@@ -69,35 +69,10 @@ dict_mem_fill_index_struct(
index->n_fields = (unsigned int) n_fields;
/* The '1 +' above prevents allocation
of an empty mem block */
- index->allow_duplicates = false;
index->nulls_equal = false;
+#ifdef MYSQL_INDEX_DISABLE_AHI
index->disable_ahi = false;
-
- new (&index->rec_cache) rec_cache_t();
-
- if (heap != NULL) {
- index->last_ins_cur =
- static_cast<last_ops_cur_t*>(mem_heap_alloc(
- heap, sizeof(last_ops_cur_t)));
-
- new (index->last_ins_cur) last_ops_cur_t();
-
- index->last_sel_cur =
- static_cast<last_ops_cur_t*>(mem_heap_alloc(
- heap, sizeof(last_ops_cur_t)));
-
- new (index->last_sel_cur) last_ops_cur_t();
-
- index->rec_cache.offsets =
- static_cast<ulint*>(mem_heap_alloc(
- heap, sizeof(ulint) * OFFS_IN_REC_NORMAL_SIZE));
-
- index->rec_cache.sz_of_offsets = OFFS_IN_REC_NORMAL_SIZE;
- } else {
- index->last_ins_cur = NULL;
- index->last_sel_cur = NULL;
- index->rec_cache.offsets = NULL;
- }
+#endif
#ifdef UNIV_DEBUG
index->magic_n = DICT_INDEX_MAGIC_N;
diff --git a/storage/innobase/include/dict0stats.ic b/storage/innobase/include/dict0stats.ic
index 80709091734..61c88773912 100644
--- a/storage/innobase/include/dict0stats.ic
+++ b/storage/innobase/include/dict0stats.ic
@@ -182,7 +182,7 @@ dict_stats_deinit(
/*==============*/
dict_table_t* table) /*!< in/out: table */
{
- ut_ad(mutex_own(&dict_sys->mutex) || dict_table_is_intrinsic(table));
+ ut_ad(mutex_own(&dict_sys->mutex));
ut_a(table->get_ref_count() == 0);
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 4a1d867015d..3526436f042 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -84,17 +84,11 @@ savepoint. */
#ifdef UNIV_DEBUG
-/** Check if memo contains the given item ignore if table is intrinsic
-@return TRUE if contains or table is intrinsic. */
-#define mtr_is_block_fix(m, o, t, table) \
- (mtr_memo_contains(m, o, t) \
- || dict_table_is_intrinsic(table))
-
-/** Check if memo contains the given page ignore if table is intrinsic
-@return TRUE if contains or table is intrinsic. */
-#define mtr_is_page_fix(m, p, t, table) \
- (mtr_memo_contains_page(m, p, t) \
- || dict_table_is_intrinsic(table))
+/** Check if memo contains the given item. */
+#define mtr_is_block_fix(m, o, t, table) mtr_memo_contains(m, o, t)
+
+/** Check if memo contains the given page. */
+#define mtr_is_page_fix(m, p, t, table) mtr_memo_contains_page(m, p, t)
/** Check if memo contains the given item.
@return TRUE if contains */
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic
index b3d9b052d52..f0354756b23 100644
--- a/storage/innobase/include/mtr0mtr.ic
+++ b/storage/innobase/include/mtr0mtr.ic
@@ -47,13 +47,6 @@ mtr_t::memo_push(void* object, mtr_memo_type_t type)
m_impl.m_made_dirty = is_block_dirtied(
reinterpret_cast<const buf_block_t*>(object));
- } else if (type == MTR_MEMO_BUF_FIX && !m_impl.m_made_dirty) {
-
- if (reinterpret_cast<const buf_block_t*>(
- object)->made_dirty_with_no_latch) {
-
- m_impl.m_made_dirty = true;
- }
}
mtr_memo_slot_t* slot;
diff --git a/storage/innobase/include/page0cur.h b/storage/innobase/include/page0cur.h
index c111717d868..94b5896d3ad 100644
--- a/storage/innobase/include/page0cur.h
+++ b/storage/innobase/include/page0cur.h
@@ -201,23 +201,6 @@ page_cur_insert_rec_low(
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
-/** Inserts a record next to page cursor on an uncompressed page.
-@param[in] current_rec pointer to current record after which
- the new record is inserted.
-@param[in] index record descriptor
-@param[in] tuple pointer to a data tuple
-@param[in] n_ext number of externally stored columns
-@param[in] mtr mini-transaction handle, or NULL
-
-@return pointer to record if succeed, NULL otherwise */
-rec_t*
-page_cur_direct_insert_rec_low(
- rec_t* current_rec,
- dict_index_t* index,
- const dtuple_t* tuple,
- ulint n_ext,
- mtr_t* mtr);
-
/***********************************************************//**
Inserts a record next to page cursor on a compressed and uncompressed
page. Returns pointer to inserted record if succeed, i.e.,
diff --git a/storage/innobase/include/page0cur.ic b/storage/innobase/include/page0cur.ic
index 8f580ef2d43..bfd9da47803 100644
--- a/storage/innobase/include/page0cur.ic
+++ b/storage/innobase/include/page0cur.ic
@@ -294,35 +294,6 @@ page_cur_tuple_insert(
ut_ad(!rec || !cmp_dtuple_rec(tuple, rec, *offsets));
return(rec);
}
-
-/** Insert a record next to page cursor. Record is directly copied to
-the page from tuple without creating intermediate copy of the record.
-
-@param[in,out] cursor a page cursor
-@param[in] tuple pointer to a data tuple
-@param[in] index record descriptor
-@param[in] n_ext number of externally stored columns
-@param[in] mtr mini-transaction handle, or NULL
-
-@return pointer to record if succeed, NULL otherwise */
-UNIV_INLINE
-rec_t*
-page_cur_tuple_direct_insert(
- page_cur_t* cursor,
- const dtuple_t* tuple,
- dict_index_t* index,
- ulint n_ext,
- mtr_t* mtr)
-{
- rec_t* rec;
-
- ut_ad(dict_table_is_intrinsic(index->table));
-
- rec = page_cur_direct_insert_rec_low(
- cursor->rec, index, tuple, n_ext, mtr);
-
- return(rec);
-}
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index 2d508c1a7df..f010e717103 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -37,7 +37,6 @@ Created 9/17/2000 Heikki Tuuri
#include "btr0pcur.h"
#include "trx0types.h"
#include "fil0crypt.h"
-#include "sess0sess.h"
// Forward declaration
struct SysIndexCallback;
@@ -292,14 +291,6 @@ row_update_for_mysql(
row_prebuilt_t* prebuilt)
MY_ATTRIBUTE((warn_unused_result));
-/** Delete all rows for the given table by freeing/truncating indexes.
-@param[in,out] table table handler
-@return error code or DB_SUCCESS */
-dberr_t
-row_delete_all_rows(
- dict_table_t* table)
- MY_ATTRIBUTE((warn_unused_result));
-
/** This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
Before calling this function row_search_for_mysql() must have
@@ -402,13 +393,12 @@ row_create_index_for_mysql(
dict_index_t* index, /*!< in, own: index definition
(will be freed) */
trx_t* trx, /*!< in: transaction handle */
- const ulint* field_lengths, /*!< in: if not NULL, must contain
+ const ulint* field_lengths) /*!< in: if not NULL, must contain
dict_index_get_n_fields(index)
actual field lengths for the
index columns, which are
then checked for not being too
large. */
- dict_table_t* handler) /* ! in/out: table handler. */
MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
@@ -427,8 +417,6 @@ fields than mentioned in the constraint.
database id the database of parameter name
@param[in] sql_length length of sql_string
@param[in] name table full name in normalized form
-@param[in] is_temp_table true if table is temporary
-@param[in,out] handler table handler if table is intrinsic
@param[in] reject_fks if TRUE, fail with error code
DB_CANNOT_ADD_CONSTRAINT if any
foreign keys are found.
@@ -493,11 +481,9 @@ row_drop_table_for_mysql(
ibool create_failed,/*!<in: TRUE=create table failed
because e.g. foreign key column
type mismatch. */
- bool nonatomic = true,
+ bool nonatomic = true);
/*!< in: whether it is permitted
to release and reacquire dict_operation_lock */
- dict_table_t* handler = NULL);
- /*!< in/out: table handler. */
/*********************************************************************//**
Drop all temporary tables during crash recovery. */
void
@@ -898,10 +884,6 @@ struct row_prebuilt_t {
ulint magic_n2; /*!< this should be the same as
magic_n */
- bool ins_sel_stmt; /*!< if true then ins_sel_statement. */
-
- innodb_session_t*
- session; /*!< InnoDB session handler. */
byte* srch_key_val1; /*!< buffer used in converting
search key values from MySQL format
to InnoDB format.*/
diff --git a/storage/innobase/include/row0sel.h b/storage/innobase/include/row0sel.h
index 3e6863208af..1186aa6f26e 100644
--- a/storage/innobase/include/row0sel.h
+++ b/storage/innobase/include/row0sel.h
@@ -177,34 +177,7 @@ row_search_for_mysql(
MY_ATTRIBUTE((warn_unused_result));
/** Searches for rows in the database using cursor.
-function is meant for temporary table that are not shared accross connection
-and so lot of complexity is reduced especially locking and transaction related.
-The cursor is an iterator over the table/index.
-
-@param[out] buf buffer for the fetched row in MySQL format
-@param[in] mode search mode PAGE_CUR_L
-@param[in,out] prebuilt prebuilt struct for the table handler;
- this contains the info to search_tuple,
- index; if search tuple contains 0 field then
- we position the cursor at start or the end of
- index, depending on 'mode'
-@param[in] match_mode 0 or ROW_SEL_EXACT or ROW_SEL_EXACT_PREFIX
-@param[in] direction 0 or ROW_SEL_NEXT or ROW_SEL_PREV;
- Note: if this is != 0, then prebuilt must has a
- pcur with stored position! In opening of a
- cursor 'direction' should be 0.
-@return DB_SUCCESS or error code */
-dberr_t
-row_search_no_mvcc(
- byte* buf,
- page_cur_mode_t mode,
- row_prebuilt_t* prebuilt,
- ulint match_mode,
- ulint direction)
- MY_ATTRIBUTE((warn_unused_result));
-
-/** Searches for rows in the database using cursor.
-Function is mainly used for tables that are shared accorss connection and
+Function is mainly used for tables that are shared across connections and
so it employs technique that can help re-construct the rows that
transaction is suppose to see.
It also has optimization such as pre-caching the rows, using AHI, etc.
@@ -221,15 +194,6 @@ It also has optimization such as pre-caching the rows, using AHI, etc.
Note: if this is != 0, then prebuilt must has a
pcur with stored position! In opening of a
cursor 'direction' should be 0.
-@param[in] ins_sel_stmt if true, then this statement is
- insert .... select statement. For normal table
- this can be detected by checking out locked
- tables using trx->mysql_n_tables_locked > 0
- condition. For intrinsic table
- external_lock is not invoked and so condition
- above will not stand valid instead this is
- traced using alternative condition
- at caller level.
@return DB_SUCCESS or error code */
dberr_t
row_search_mvcc(
diff --git a/storage/innobase/include/row0sel.ic b/storage/innobase/include/row0sel.ic
index a816e4440e2..d14b41e3f5f 100644
--- a/storage/innobase/include/row0sel.ic
+++ b/storage/innobase/include/row0sel.ic
@@ -134,12 +134,5 @@ row_search_for_mysql(
ulint match_mode,
ulint direction)
{
- if (!dict_table_is_intrinsic(prebuilt->table)) {
- return(row_search_mvcc(
- buf, mode, prebuilt, match_mode, direction));
- } else {
- return(row_search_no_mvcc(
- buf, mode, prebuilt, match_mode, direction));
- }
+ return(row_search_mvcc(buf, mode, prebuilt, match_mode, direction));
}
-
diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h
index 5fdb916c54c..bd49e034384 100644
--- a/storage/innobase/include/sync0types.h
+++ b/storage/innobase/include/sync0types.h
@@ -1033,10 +1033,10 @@ struct latch_t {
return(m_temp_fsp);
}
- /** Set the temporary tablespace flag. The latch order constraints
- are different for intrinsic tables. We don't always acquire the
- index->lock. We need to figure out the context and add some special
- rules during the checks. */
+ /** Set the temporary tablespace flag. (For internal temporary
+ tables, MySQL 5.7 does not always acquire the index->lock. We
+ need to figure out the context and add some special rules
+ during the checks.) */
void set_temp_fsp()
UNIV_NOTHROW
{
@@ -1090,26 +1090,11 @@ struct btrsea_sync_check : public sync_check_functor_t {
virtual bool operator()(const latch_level_t level)
{
/* If calling thread doesn't hold search latch then
- check if there are latch level exception provided.
-
- Note: Optimizer has added InnoDB intrinsic table as an
- alternative to MyISAM intrinsic table. With this a new
- control flow comes into existence, it is:
-
- Server -> Plugin -> SE
-
- Plugin in this case is I_S which is sharing the latch vector
- of InnoDB and so there could be lock conflicts. Ideally
- the Plugin should use a difference namespace latch vector
- as it doesn't have any depedency with SE latching protocol.
-
- Added check that will allow thread to hold I_S latches */
+ check if there are latch level exception provided. */
if (!m_has_search_latch
&& (level != SYNC_SEARCH_SYS
- && level != SYNC_FTS_CACHE
- && level != SYNC_TRX_I_S_RWLOCK
- && level != SYNC_TRX_I_S_LAST_READ)) {
+ && level != SYNC_FTS_CACHE)) {
m_result = true;