From 03fbfeef660b4799f73ed610182aa5dcbb3c2ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 22 Nov 2017 22:21:37 +0200 Subject: Identify system-versioned columns in the InnoDB dictionary Both bits DATA_VERSIONED will be set in prtype if the column is system-versioned. The bits will be 0 for normal unversioned columns. For the special columns identifying the logical start and end times of versions, only one bit will be set: DATA_VERS_START or DATA_VERS_END. create_table_info_t::create_table_def(), prepare_inplace_alter_table_dict(): Set prtype |= DATA_VERSIONED for system-versioned columns. dfield_t::is_version_historical_end(): Determine if a data tuple field is_version_end() and contains a timestamp in the past (not TRX_ID_MAX). dtype_t, dict_col_t: Add the accessors is_versioned(), is_version_start(), is_version_end(). trx_id_max_bytes[]: The bit pattern of TRX_ID_MAX, for use with memcmp(). --- storage/innobase/data/data0data.cc | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'storage/innobase/data') diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index fbdb409dbc5..6601edfec9d 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -861,17 +861,3 @@ dfield_t::clone(mem_heap_t* heap) const return(obj); } - -/** Assuming field is sys_trx_end checks whether its value is not SYS_TRX_MAX. -@param dfield field to check -@return true for historical rows and false otherwise*/ -bool -dfield_is_historical_sys_trx_end(const dfield_t* dfield) -{ - static const trx_id_t MAX = TRX_ID_MAX; - ut_ad(dfield); - ut_ad(dfield->type.prtype & DATA_VERS_END); - const byte* data = static_cast(dfield_get_data(dfield)); - ut_ad(dfield_get_len(dfield) == 8); - return(memcmp(data, &MAX, 8)); -} -- cgit v1.2.1