summaryrefslogtreecommitdiff
path: root/storage/innobase/include/row0row.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/row0row.h')
-rw-r--r--storage/innobase/include/row0row.h78
1 files changed, 56 insertions, 22 deletions
diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h
index b04068c5a5d..4fd93283884 100644
--- a/storage/innobase/include/row0row.h
+++ b/storage/innobase/include/row0row.h
@@ -33,14 +33,13 @@ Created 4/20/1996 Heikki Tuuri
#include "que0types.h"
#include "mtr0mtr.h"
#include "rem0types.h"
-#include "read0types.h"
#include "row0types.h"
#include "btr0types.h"
/*********************************************************************//**
Gets the offset of the DB_TRX_ID field, in bytes relative to the origin of
a clustered index record.
-@return offset of DATA_TRX_ID */
+@return offset of DATA_TRX_ID */
UNIV_INLINE
ulint
row_get_trx_id_offset(
@@ -50,7 +49,7 @@ row_get_trx_id_offset(
MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the trx id field from a clustered index record.
-@return value of the field */
+@return value of the field */
UNIV_INLINE
trx_id_t
row_get_rec_trx_id(
@@ -61,7 +60,7 @@ row_get_rec_trx_id(
MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the roll pointer field from a clustered index record.
-@return value of the field */
+@return value of the field */
UNIV_INLINE
roll_ptr_t
row_get_rec_roll_ptr(
@@ -70,13 +69,18 @@ row_get_rec_roll_ptr(
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
MY_ATTRIBUTE((nonnull, warn_unused_result));
+
+/* Flags for row build type. */
+#define ROW_BUILD_NORMAL 0 /*!< build index row */
+#define ROW_BUILD_FOR_PURGE 1 /*!< build row for purge. */
+#define ROW_BUILD_FOR_UNDO 2 /*!< build row for undo. */
+#define ROW_BUILD_FOR_INSERT 3 /*!< build row for insert. */
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
@return index entry which should be inserted or purged
@retval NULL if the externally stored columns in the clustered index record
are unavailable and ext != NULL, or row is missing some needed columns. */
-UNIV_INTERN
dtuple_t*
row_build_index_entry_low(
/*======================*/
@@ -85,9 +89,12 @@ row_build_index_entry_low(
const row_ext_t* ext, /*!< in: externally stored column
prefixes, or NULL */
dict_index_t* index, /*!< in: index on the table */
- mem_heap_t* heap) /*!< in: memory heap from which
+ mem_heap_t* heap, /*!< in: memory heap from which
the memory for the index entry
is allocated */
+ ulint flag) /*!< in: ROW_BUILD_NORMAL,
+ ROW_BUILD_FOR_PURGE
+ or ROW_BUILD_FOR_UNDO */
MY_ATTRIBUTE((warn_unused_result, nonnull(1,3,4)));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
@@ -111,8 +118,7 @@ row_build_index_entry(
/*******************************************************************//**
An inverse function to row_build_index_entry. Builds a row from a
record in a clustered index.
-@return own: row built; see the NOTE below! */
-UNIV_INTERN
+@return own: row built; see the NOTE below! */
dtuple_t*
row_build(
/*======*/
@@ -156,11 +162,46 @@ row_build(
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
MY_ATTRIBUTE((nonnull(2,3,9)));
+/** An inverse function to row_build_index_entry. Builds a row from a
+record in a clustered index, with possible indexing on ongoing
+addition of new virtual columns.
+@param[in] type ROW_COPY_POINTERS or ROW_COPY_DATA;
+@param[in] index clustered index
+@param[in] rec record in the clustered index
+@param[in] offsets rec_get_offsets(rec,index) or NULL
+@param[in] col_table table, to check which
+ externally stored columns
+ occur in the ordering columns
+ of an index, or NULL if
+ index->table should be
+ consulted instead
+@param[in] add_cols default values of added columns, or NULL
+@param[in] add_v new virtual columns added
+ along with new indexes
+@param[in] col_map mapping of old column
+ numbers to new ones, or NULL
+@param[in] ext cache of externally stored column
+ prefixes, or NULL
+@param[in] heap memory heap from which
+ the memory needed is allocated
+@return own: row built */
+dtuple_t*
+row_build_w_add_vcol(
+ ulint type,
+ const dict_index_t* index,
+ const rec_t* rec,
+ const ulint* offsets,
+ const dict_table_t* col_table,
+ const dtuple_t* add_cols,
+ const dict_add_v_col_t* add_v,
+ const ulint* col_map,
+ row_ext_t** ext,
+ mem_heap_t* heap);
+
/*******************************************************************//**
Converts an index record to a typed data tuple.
@return index entry built; does not set info_bits, and the data fields
in the entry will point directly to rec */
-UNIV_INTERN
dtuple_t*
row_rec_to_index_entry_low(
/*=======================*/
@@ -175,8 +216,7 @@ row_rec_to_index_entry_low(
/*******************************************************************//**
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap.
-@return own: index entry built */
-UNIV_INTERN
+@return own: index entry built */
dtuple_t*
row_rec_to_index_entry(
/*===================*/
@@ -191,8 +231,7 @@ row_rec_to_index_entry(
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record.
-@return own: row reference built; see the NOTE below! */
-UNIV_INTERN
+@return own: row reference built; see the NOTE below! */
dtuple_t*
row_build_row_ref(
/*==============*/
@@ -214,7 +253,6 @@ row_build_row_ref(
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record. */
-UNIV_INTERN
void
row_build_row_ref_in_tuple(
/*=======================*/
@@ -252,8 +290,7 @@ row_build_row_ref_fast(
/***************************************************************//**
Searches the clustered index record for a row, if we have the row
reference.
-@return TRUE if found */
-UNIV_INTERN
+@return TRUE if found */
ibool
row_search_on_row_ref(
/*==================*/
@@ -267,8 +304,7 @@ row_search_on_row_ref(
/*********************************************************************//**
Fetches the clustered index record for a secondary index record. The latches
on the secondary index record are preserved.
-@return record or NULL, if no record found */
-UNIV_INTERN
+@return record or NULL, if no record found */
rec_t*
row_get_clust_rec(
/*==============*/
@@ -294,8 +330,7 @@ enum row_search_result {
/***************************************************************//**
Searches an index record.
-@return whether the record was found or buffered */
-UNIV_INTERN
+@return whether the record was found or buffered */
enum row_search_result
row_search_index_entry(
/*===================*/
@@ -322,8 +357,7 @@ Not more than "buf_size" bytes are written to "buf".
The result is always NUL-terminated (provided buf_size is positive) and the
number of bytes that were written to "buf" is returned (including the
terminating NUL).
-@return number of bytes that were written */
-UNIV_INTERN
+@return number of bytes that were written */
ulint
row_raw_format(
/*===========*/