summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-11-09 13:05:44 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-11-09 13:05:44 +0200
commitfe9412dbc9ce4cb1764a3669ee89dcf687d68fb5 (patch)
tree80a336f972e7d3a7e877eabcdb0786abbed45cbd /storage/innobase/include
parentd6d8a499b1aef212f35eca7eba9c05ef18dfad7e (diff)
parent27eaa963ff18d12939f798a78720d73cf6ce0b5d (diff)
downloadmariadb-git-fe9412dbc9ce4cb1764a3669ee89dcf687d68fb5.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/dict0dict.h25
-rw-r--r--storage/innobase/include/dict0load.h2
-rw-r--r--storage/innobase/include/ibuf0ibuf.h19
-rw-r--r--storage/innobase/include/page0page.h22
-rw-r--r--storage/innobase/include/page0page.inl34
-rw-r--r--storage/innobase/include/trx0trx.h10
6 files changed, 28 insertions, 84 deletions
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index d867d2f297a..8daa07160a3 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -421,14 +421,6 @@ dict_foreign_add_to_cache(
dict_err_ignore_t ignore_err)
/*!< in: error to be ignored */
MY_ATTRIBUTE((nonnull(1), warn_unused_result));
-/*********************************************************************//**
-Checks if a table is referenced by foreign keys.
-@return TRUE if table is referenced by a foreign key */
-ibool
-dict_table_is_referenced_by_foreign_key(
-/*====================================*/
- const dict_table_t* table) /*!< in: InnoDB table */
- MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Replace the index passed in with another equivalent index in the
foreign key lists of the table.
@@ -1326,7 +1318,7 @@ class dict_sys_t
alignas(CPU_LEVEL1_DCACHE_LINESIZE) srw_lock latch;
#ifdef UNIV_DEBUG
/** whether latch is being held in exclusive mode (by any thread) */
- bool latch_ex;
+ Atomic_relaxed<pthread_t> latch_ex;
/** number of S-latch holders */
Atomic_counter<uint32_t> latch_readers;
#endif
@@ -1500,11 +1492,12 @@ public:
/** @return whether any thread (not necessarily the current thread)
is holding the latch; that is, this check may return false
positives */
- bool frozen() const { return latch_readers || locked(); }
+ bool frozen() const { return latch_readers || latch_ex; }
/** @return whether any thread (not necessarily the current thread)
- is holding the exclusive latch; that is, this check may return false
- positives */
- bool locked() const { return latch_ex; }
+ is holding a shared latch */
+ bool frozen_not_locked() const { return latch_readers; }
+ /** @return whether the current thread holds the exclusive latch */
+ bool locked() const { return latch_ex == pthread_self(); }
#endif
private:
/** Acquire the exclusive latch */
@@ -1523,7 +1516,7 @@ public:
{
ut_ad(!latch_readers);
ut_ad(!latch_ex);
- ut_d(latch_ex= true);
+ ut_d(latch_ex= pthread_self());
}
else
lock_wait(SRW_LOCK_ARGS(file, line));
@@ -1540,9 +1533,9 @@ public:
/** Unlock the data dictionary cache. */
void unlock()
{
- ut_ad(latch_ex);
+ ut_ad(latch_ex == pthread_self());
ut_ad(!latch_readers);
- ut_d(latch_ex= false);
+ ut_d(latch_ex= 0);
latch.wr_unlock();
}
/** Acquire a shared lock on the dictionary cache. */
diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h
index a94823b4a86..f7d33d5b43b 100644
--- a/storage/innobase/include/dict0load.h
+++ b/storage/innobase/include/dict0load.h
@@ -100,7 +100,7 @@ dict_load_foreigns(
which must be loaded
subsequently to load all the
foreign key constraints. */
- MY_ATTRIBUTE((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1)));
/********************************************************************//**
This function opens a system table, and return the first record.
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 23d5258cfbc..e6f72b05087 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -264,7 +264,6 @@ ibuf_page_low(
MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
-
/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages.
Must not be called when recv_no_ibuf_operations==true.
@param[in] page_id tablespace/page identifier
@@ -274,7 +273,7 @@ Must not be called when recv_no_ibuf_operations==true.
# define ibuf_page(page_id, zip_size, mtr) \
ibuf_page_low(page_id, zip_size, true, mtr)
-#else /* UVIV_DEBUG */
+#else /* UNIV_DEBUG */
/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages.
Must not be called when recv_no_ibuf_operations==true.
@@ -285,7 +284,7 @@ Must not be called when recv_no_ibuf_operations==true.
# define ibuf_page(page_id, zip_size, mtr) \
ibuf_page_low(page_id, zip_size, mtr)
-#endif /* UVIV_DEBUG */
+#endif /* UNIV_DEBUG */
/***********************************************************************//**
Frees excess pages from the ibuf free list. This function is called when an OS
thread calls fsp services to allocate a new file segment, or a new page to a
@@ -334,7 +333,7 @@ dberr_t ibuf_merge_or_delete_for_page(buf_block_t *block,
ulint zip_size);
/** Delete all change buffer entries for a tablespace,
-in DISCARD TABLESPACE, IMPORT TABLESPACE, or crash recovery.
+in DISCARD TABLESPACE, IMPORT TABLESPACE, or read-ahead.
@param[in] space missing or to-be-discarded tablespace */
void ibuf_delete_for_discarded_space(uint32_t space);
@@ -385,13 +384,11 @@ ibuf_close(void);
dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
MY_ATTRIBUTE((nonnull, warn_unused_result));
-/** Updates free bits and buffered bits for bulk loaded page.
-@param[in] block index page
-@param]in] reset flag if reset free val */
-void
-ibuf_set_bitmap_for_bulk_load(
- buf_block_t* block,
- bool reset);
+/** Update free bits and buffered bits for bulk loaded page.
+@param block secondary index leaf page
+@param mtr mini-transaction
+@param reset whether the page is full */
+void ibuf_set_bitmap_for_bulk_load(buf_block_t *block, mtr_t *mtr, bool reset);
#define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO
#define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 80c1193d8a0..2978656b508 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -795,17 +795,6 @@ page_rec_is_first(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
-true if the record is the second user record on a page.
-@return true if the second user record */
-UNIV_INLINE
-bool
-page_rec_is_second(
-/*===============*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((warn_unused_result));
-
-/************************************************************//**
true if the record is the last user record on a page.
@return true if the last user record */
UNIV_INLINE
@@ -817,17 +806,6 @@ page_rec_is_last(
MY_ATTRIBUTE((warn_unused_result));
/************************************************************//**
-true if the record is the second last user record on a page.
-@return true if the second last user record */
-UNIV_INLINE
-bool
-page_rec_is_second_last(
-/*====================*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
- MY_ATTRIBUTE((warn_unused_result));
-
-/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap.
@return maximum combined size for inserted records */
diff --git a/storage/innobase/include/page0page.inl b/storage/innobase/include/page0page.inl
index 61c1b96ff79..6c0167edcf9 100644
--- a/storage/innobase/include/page0page.inl
+++ b/storage/innobase/include/page0page.inl
@@ -193,22 +193,6 @@ page_rec_is_first(
}
/************************************************************//**
-true if the record is the second user record on a page.
-@return true if the second user record */
-UNIV_INLINE
-bool
-page_rec_is_second(
-/*===============*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
-{
- ut_ad(page_get_n_recs(page) > 1);
- if (const rec_t *first= page_rec_get_next_const(page_get_infimum_rec(page)))
- return page_rec_get_next_const(first) == rec;
- return false;
-}
-
-/************************************************************//**
true if the record is the last user record on a page.
@return true if the last user record */
UNIV_INLINE
@@ -224,24 +208,6 @@ page_rec_is_last(
}
/************************************************************//**
-true if the record is the second last user record on a page.
-@return true if the second last user record */
-UNIV_INLINE
-bool
-page_rec_is_second_last(
-/*====================*/
- const rec_t* rec, /*!< in: record */
- const page_t* page) /*!< in: page */
-{
- ut_ad(page_get_n_recs(page) > 1);
- ut_ad(!page_rec_is_last(rec, page));
-
- if (const rec_t *next= page_rec_get_next_const(rec))
- return page_rec_is_supremum(page_rec_get_next_const(next));
- return false;
-}
-
-/************************************************************//**
Returns the middle record of the records on the page. If there is an
even number of records in the list, returns the first record of the
upper half-list.
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 7933e9bc883..de3f617f76d 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -430,6 +430,10 @@ class trx_mod_table_time_t
/** First modification of a system versioned column
(NONE= no versioning, BULK= the table was dropped) */
undo_no_t first_versioned= NONE;
+#ifdef UNIV_DEBUG
+ /** Whether the modified table is a FTS auxiliary table */
+ bool fts_aux_table= false;
+#endif /* UNIV_DEBUG */
/** Buffer to store insert opertion */
row_merge_bulk_t *bulk_store= nullptr;
@@ -496,6 +500,12 @@ public:
return false;
}
+#ifdef UNIV_DEBUG
+ void set_aux_table() { fts_aux_table= true; }
+
+ bool is_aux_table() const { return fts_aux_table; }
+#endif /* UNIV_DEBUG */
+
/** @return the first undo record that modified the table */
undo_no_t get_first() const
{