CUBRID Engine  latest
btree.c File Reference
#include "btree.h"
#include "btree_load.h"
#include "config.h"
#include "db_value_printer.hpp"
#include "file_manager.h"
#include "slotted_page.h"
#include "log_append.hpp"
#include "log_manager.h"
#include "overflow_file.h"
#include "xserver_interface.h"
#include "scan_manager.h"
#include "fetch.h"
#include "locator_sr.h"
#include "network_interface_sr.h"
#include "utility.h"
#include "transform.h"
#include "partition_sr.h"
#include "porting_inline.hpp"
#include "query_executor.h"
#include "query_opfunc.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "perf_monitor.h"
#include "regu_var.hpp"
#include "fault_injection.h"
#include "dbtype.h"
#include "thread_manager.hpp"
#include <assert.h>
#include <algorithm>
#include <cinttypes>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  recset_header
 
struct  recins_struct
 
struct  btree_stats_env
 
struct  btree_range_search_helper
 
struct  show_index_scan_ctx
 
struct  btree_search_key_helper
 
struct  btree_find_unique_helper
 
struct  btree_rec_satisfies_snapshot_helper
 
struct  btree_find_fk_object
 
struct  btree_insert_helper
 
struct  btree_delete_helper
 
struct  btree_helper
 

Macros

#define BTREE_HEALTH_CHECK
 
#define BTREE_DEBUG_DUMP_SIMPLE   0x0001 /* simple message in SMO */
 
#define BTREE_DEBUG_DUMP_FULL   0x0002 /* full dump in insert or delete */
 
#define BTREE_DEBUG_HEALTH_SIMPLE   0x0010 /* simple health check in SMO */
 
#define BTREE_DEBUG_HEALTH_FULL   0x0020 /* full health check (traverse all slot in page) */
 
#define BTREE_DEBUG_TEST_SPLIT   0x0100 /* full split test */
 
#define BTREE_SPLIT_LOWER_BOUND   0.20f
 
#define BTREE_SPLIT_UPPER_BOUND   (1.0f - BTREE_SPLIT_LOWER_BOUND)
 
#define BTREE_SPLIT_MIN_PIVOT   0.05f
 
#define BTREE_SPLIT_MAX_PIVOT   (1.0f - BTREE_SPLIT_MIN_PIVOT)
 
#define BTREE_SPLIT_DEFAULT_PIVOT   0.5f
 
#define DISK_PAGE_BITS   (DB_PAGESIZE * CHAR_BIT) /* Num of bits per page */
 
#define BTREE_NODE_MAX_SPLIT_SIZE(thread_p, page_ptr)   (db_page_size() - spage_header_size() - spage_get_space_for_record(thread_p, (page_ptr), HEADER))
 
#define OID_MSG_BUF_SIZE   64
 
#define MIN_KEY_SIZE   DB_ALIGN (1, BTREE_MAX_ALIGN)
 
#define MIN_LEAF_REC_SIZE   (OR_OID_SIZE + MIN_KEY_SIZE)
 
#define MAX_LEAF_REC_NUM   (IO_MAX_PAGE_SIZE / MIN_LEAF_REC_SIZE)
 
#define MAX_MERGE_ALIGN_WASTE   ((DB_PAGESIZE/MIN_LEAF_REC_SIZE) * (BTREE_MAX_ALIGN - 1))
 
#define CAN_MERGE_WHEN_EMPTY   (MAX (DB_PAGESIZE * 0.33, MAX_MERGE_ALIGN_WASTE * 1.3))
 
#define FORCE_MERGE_WHEN_EMPTY   (MAX (DB_PAGESIZE * 0.66, MAX_MERGE_ALIGN_WASTE * 1.3))
 
#define NOT_FOUND   -1
 
#define BTREE_LEAF_RECORD_FENCE   ((short) 0x1000)
 
#define BTREE_LEAF_RECORD_OVERFLOW_OIDS   ((short) 0x2000)
 
#define BTREE_LEAF_RECORD_OVERFLOW_KEY   ((short) 0x4000)
 
#define BTREE_LEAF_RECORD_CLASS_OID   ((short) 0x8000)
 
#define BTREE_LEAF_RECORD_MASK   ((short) 0xF000)
 
#define BTREE_OID_HAS_MVCC_INSID   ((short) 0x4000)
 
#define BTREE_OID_HAS_MVCC_DELID   ((short) 0x8000)
 
#define BTREE_OID_MVCC_FLAGS_MASK   ((short) 0xC000)
 
#define BTREE_OID_HAS_MVCC_INSID_AND_DELID   (BTREE_OID_HAS_MVCC_INSID | BTREE_OID_HAS_MVCC_DELID)
 
#define BTREE_MAX_OID_COUNT   IO_MAX_PAGE_SIZE / OR_OID_SIZE
 
#define BTREE_OID_CLEAR_MVCC_FLAGS(oid_ptr)   ((oid_ptr)->volid &= ~BTREE_OID_MVCC_FLAGS_MASK)
 
#define BTREE_OID_CLEAR_RECORD_FLAGS(oid_ptr)   ((oid_ptr)->slotid &= ~BTREE_LEAF_RECORD_MASK)
 
#define BTREE_OID_CLEAR_ALL_FLAGS(oid_ptr)
 
#define BTREE_OID_IS_MVCC_FLAG_SET(oid_ptr, mvcc_flag)   (((oid_ptr)->volid & (mvcc_flag)) == (mvcc_flag))
 
#define BTREE_OID_IS_RECORD_FLAG_SET(oid_ptr, mvcc_flag)   (((oid_ptr)->slotid & (mvcc_flag)) == (mvcc_flag))
 
#define BTREE_OID_SET_MVCC_FLAG(oid_ptr, mvcc_flag)   ((oid_ptr)->volid |= (mvcc_flag))
 
#define BTREE_OID_SET_RECORD_FLAG(oid_ptr, mvcc_flag)   ((oid_ptr)->slotid |= (mvcc_flag))
 
#define BTREE_OID_GET_MVCC_FLAGS(oid_ptr)   ((oid_ptr)->volid & BTREE_OID_MVCC_FLAGS_MASK)
 
#define BTREE_OID_GET_RECORD_FLAGS(oid_ptr)   ((oid_ptr)->slotid & BTREE_LEAF_RECORD_MASK)
 
#define BTREE_MVCC_INFO_HAS_INSID(mvcc_info)   (((mvcc_info)->flags & BTREE_OID_HAS_MVCC_INSID) != 0)
 
#define BTREE_MVCC_INFO_HAS_DELID(mvcc_info)   (((mvcc_info)->flags & BTREE_OID_HAS_MVCC_DELID) != 0)
 
#define BTREE_MVCC_INFO_CLEAR_INSID(mvcc_info)   ((mvcc_info)->flags &= ~BTREE_OID_HAS_MVCC_INSID)
 
#define BTREE_MVCC_INFO_CLEAR_DELID(mvcc_info)   ((mvcc_info)->flags &= ~BTREE_OID_HAS_MVCC_DELID)
 
#define BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE(mvcc_info)   (BTREE_MVCC_INFO_HAS_INSID (mvcc_info) && MVCCID_IS_NOT_ALL_VISIBLE ((mvcc_info)->insert_mvccid))
 
#define BTREE_MVCC_INFO_IS_DELID_VALID(mvcc_info)   (BTREE_MVCC_INFO_HAS_DELID (mvcc_info) && (mvcc_info)->delete_mvccid != MVCCID_NULL)
 
#define BTREE_MVCC_INFO_INSID(mvcc_info)   (BTREE_MVCC_INFO_HAS_INSID (mvcc_info) ? (mvcc_info)->insert_mvccid : MVCCID_ALL_VISIBLE)
 
#define BTREE_MVCC_INFO_DELID(mvcc_info)   (BTREE_MVCC_INFO_HAS_DELID (mvcc_info) ? (mvcc_info)->delete_mvccid : MVCCID_NULL)
 
#define BTREE_MVCC_INFO_SET_FIXED_SIZE(mvcc_info)
 
#define BTREE_MVCC_INFO_CLEAR_FIXED_SIZE(mvcc_info)
 
#define BTREE_MVCC_INFO_SET_INSID(mvcc_info, insid)
 
#define BTREE_MVCC_INFO_SET_DELID(mvcc_info, delid)
 
#define BTREE_GET_OID(buf, oid_ptr)
 
#define BTREE_RECORD_OR_BUF_INIT(buf, btree_rec)
 
#define BTREE_GET_MVCC_INFO_SIZE_FROM_FLAGS(mvcc_flags)
 
#define BTREE_IS_PAGE_VALID_LEAF(thread_p, page)
 
#define RECINS_STRUCT_INITIALIZER   { OID_INITIALIZER, OID_INITIALIZER, VPID_INITIALIZER, 0 }
 
#define BTID_DOMAIN_CHECK_MAX_SIZE   1024
 
#define OFFS1   0 /* Node Type Offset: Leaf/NonLeaf Information */
 
#define OFFS2   2 /* RECDES Type Offset */
 
#define OFFS3   4 /* RECDES Data Offset */
 
#define LOFFS1   0 /* Key Len Offset */
 
#define LOFFS2   2 /* Node Type Offset: Leaf/NonLeaf Information */
 
#define LOFFS3   4 /* RECDES Type Offset */
 
#define LOFFS4   6 /* RECDES Data Offset */
 
#define BTREE_SEARCH_KEY_HELPER_INITIALIZER   { BTREE_KEY_NOTFOUND, NULL_SLOTID, btree_search_key_helper::NO_FENCE_KEY }
 
#define BTREE_FIND_UNIQUE_HELPER_INITIALIZER
 
#define BTREE_REC_SATISFIES_SNAPSHOT_HELPER_INITIALIZER
 
#define BTS_IS_INDEX_COVERED(bts)   ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_COVERED ((bts)->index_scan_idp))
 
#define BTS_IS_INDEX_MRO(bts)   ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_MRO ((bts)->index_scan_idp))
 
#define BTS_IS_INDEX_ISS(bts)   ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_ISS ((bts)->index_scan_idp))
 
#define BTS_IS_INDEX_ILS(bts)
 
#define BTS_NEED_COUNT_ONLY(bts)   ((bts) != NULL && (bts)->index_scan_idp != NULL && (bts)->index_scan_idp->need_count_only)
 
#define BTS_INCREMENT_READ_OIDS(bts)
 
#define BTS_IS_SOFT_CAPACITY_ENOUGH(bts, count)
 
#define BTS_IS_HARD_CAPACITY_ENOUGH(bts, count)
 
#define BTS_SAVE_OID_IN_BUFFER(bts, oid)
 
#define BTREE_FIND_FK_OBJECT_INITIALIZER   { OID_INITIALIZER }
 
#define BTREE_INSERT_OID(ins_helper)   (&((ins_helper)->obj_info.oid))
 
#define BTREE_INSERT_CLASS_OID(ins_helper)   (&((ins_helper)->obj_info.class_oid))
 
#define BTREE_INSERT_MVCC_INFO(ins_helper)   (&((ins_helper)->obj_info.mvcc_info))
 
#define BTREE_DELETE_OID(helper)   (&((helper)->object_info.oid))
 
#define BTREE_DELETE_CLASS_OID(helper)   (&((helper)->object_info.class_oid))
 
#define BTREE_DELETE_MVCC_INFO(helper)   (&((helper)->object_info.mvcc_info))
 
#define BTREE_RV_OVERFLOW_FLAG   0x2000
 
#define BTREE_RV_DEBUG_INFO_FLAG   0x1000
 
#define BTREE_RV_EXCLUSIVE_FLAGS_MASK   0x3C00
 
#define BTREE_RV_FLAGS_MASK   (LOG_RV_RECORD_MODIFY_MASK | BTREE_RV_EXCLUSIVE_FLAGS_MASK)
 
#define BTREE_RV_SET_OVERFLOW_NODE(addr)   ((addr)->offset |= BTREE_RV_OVERFLOW_FLAG)
 
#define BTREE_RV_REDO_SET_DEBUG_INFO(addr, rv_ptr, btid_int, id)
 
#define BTREE_RV_UNDOREDO_SET_DEBUG_INFO(addr, rv_redo_ptr, rv_undo_ptr, btid_int, id)
 
#define BTREE_RV_DEBUG_INFO_MAX_SIZE
 
#define BTREE_RV_IS_OVERFLOW_NODE(flags)   ((flags & BTREE_RV_OVERFLOW_FLAG) != 0)
 
#define BTREE_RV_HAS_DEBUG_INFO(flags)   ((flags & BTREE_RV_DEBUG_INFO_FLAG) != 0)
 
#define BTREE_RV_UPDATE_MAX_KEY_LEN   0x0800
 
#define BTREE_RV_SET_UPDATE_MAX_KEY_LEN(addr)   ((addr)->offset |= BTREE_RV_UPDATE_MAX_KEY_LEN)
 
#define BTREE_RV_IS_UPDATE_MAX_KEY_LEN(flags)   ((flags & BTREE_RV_UPDATE_MAX_KEY_LEN) != 0)
 
#define BTREE_RV_UNDO_MVCCDEL_MYOBJ   0x0800
 
#define BTREE_RV_SET_UNDO_MVCCDEL_MYOBJ(addr)   ((addr)->offset |= BTREE_RV_UNDO_MVCCDEL_MYOBJ)
 
#define BTREE_RV_IS_UNDO_MVCCDEL_MYOBJ(flags)   ((flags & BTREE_RV_UNDO_MVCCDEL_MYOBJ) != 0)
 
#define btree_log_if_enabled(...)   if (prm_get_bool_value(PRM_ID_LOG_BTREE_OPS)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
 
#define btree_log(prefix, msg, ...)
 
#define btree_insert_log(helper, msg, ...)   if ((helper)->log_operations) btree_log ("BTREE_INSERT ", msg, __VA_ARGS__)
 
#define btree_delete_log(helper, msg, ...)   if ((helper)->log_operations) btree_log ("BTREE_DELETE ", msg, __VA_ARGS__)
 
#define BTREE_ID_MSG   "index = %d, %d|%d"
 
#define BTREE_MVCC_INFO_AS_ARGS(mvcc_info)   (unsigned long long) BTREE_MVCC_INFO_INSID (mvcc_info), (unsigned long long) BTREE_MVCC_INFO_DELID (mvcc_info)
 
#define BTREE_OBJINFO_MSG(name)   name " { OID = %d|%d|%d, CLASS = %d|%d|%d, MVCC_INFO = %llu|%llu } "
 
#define BTREE_OBJINFO_AS_ARGS(objinfo)
 
#define BTREE_PRINT_KEY_MSG(key)   key " = %.32s"
 
#define BTREE_PRINT_KEY_ARGS(key)   (key) != NULL ? (key) : "** UNKNOWN KEY **"
 
#define BTREE_INSERT_HELPER_MSG(tabs)
 
#define BTREE_INSERT_HELPER_AS_ARGS(helper)
 
#define BTREE_DELETE_HELPER_MSG(tabs)
 
#define BTREE_DELETE_HELPER_AS_ARGS(helper)
 
#define BTREE_INSERT_MODIFY_MSG(desc)
 
#define BTREE_INSERT_MODIFY_ARGS(thread_p, helper, page, save_lsa, is_leaf, slotid, new_size, btid)
 
#define BTREE_DELETE_MODIFY_MSG(desc)
 
#define BTREE_DELETE_MODIFY_ARGS(thread_p, helper, page, save_lsa, is_leaf, slotid, new_size, btid)
 
#define NEXT_MERGE_RECORD()
 
#define MIGRATE_90BETA_TO_91
 
#define BTREE_CHECK_VALID_PRINT_REC_MAX_LENGTH   1024
 

Typedefs

typedef struct recset_header RECSET_HEADER
 
typedef struct recins_struct RECINS_STRUCT
 
typedef struct btree_stats_env BTREE_STATS_ENV
 
typedef struct btree_range_search_helper BTREE_RANGE_SEARCH_HELPER
 
typedef struct show_index_scan_ctx SHOW_INDEX_SCAN_CTX
 
typedef struct btree_search_key_helper BTREE_SEARCH_KEY_HELPER
 
typedef struct btree_find_unique_helper BTREE_FIND_UNIQUE_HELPER
 
typedef struct btree_rec_satisfies_snapshot_helper BTREE_REC_SATISFIES_SNAPSHOT_HELPER
 
typedef int BTREE_ROOT_WITH_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *root_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
typedef int BTREE_ADVANCE_WITH_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *crt_page, PAGE_PTR *advance_to_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
typedef int BTREE_PROCESS_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
typedef int BTREE_PROCESS_OBJECT_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, bool *stop, void *args)
 
typedef struct btree_find_fk_object BTREE_FIND_FK_OBJECT
 
typedef struct btree_insert_helper BTREE_INSERT_HELPER
 
typedef struct btree_delete_helper BTREE_DELETE_HELPER
 
typedef enum btree_rv_debug_id BTREE_RV_DEBUG_ID
 
typedef struct btree_helper BTREE_HELPER
 

Enumerations

enum  LEAF_RECORD_TYPE { LEAF_RECORD_REGULAR = 1, LEAF_RECORD_OVERFLOW }
 
enum  BTREE_BOUNDARY { BTREE_BOUNDARY_FIRST = 1, BTREE_BOUNDARY_LAST }
 
enum  BTREE_MERGE_STATUS { BTREE_MERGE_NO = 0, BTREE_MERGE_TRY, BTREE_MERGE_FORCE }
 
enum  btree_rv_debug_id {
  BTREE_RV_REDO_NO_ID = 0, BTREE_RV_DEBUG_ID_INSERT_DELID, BTREE_RV_DEBUG_ID_START_OVF, BTREE_RV_DEBUG_ID_INS_NEW_OVF,
  BTREE_RV_DEBUG_ID_INS_OLD_OVF, BTREE_RV_DEBUG_ID_UNIQUE, BTREE_RV_DEBUG_ID_NON_UNIQUE, BTREE_RV_DEBUG_ID_REM_INSID,
  BTREE_RV_DEBUG_ID_REM_DELID_UNIQUE, BTREE_RV_DEBUG_ID_REM_DELID_NON_UNIQUE, BTREE_RV_DEBUG_ID_OVF_REPLACE, BTREE_RV_DEBUG_ID_SWAP_LEAF,
  BTREE_RV_DEBUG_ID_OVF_LINK, BTREE_RV_DEBUG_ID_LAST_OID, BTREE_RV_DEBUG_ID_REM_OBJ, BTREE_RV_DEBUG_ID_INS_KEY,
  BTREE_RV_DEBUG_ID_UNDO_INS_UNQ_MUPD, BTREE_RV_DEBUG_ID_INS_REM_LEAF_LAST
}
 

Functions

static void bts_reset_scan (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
template<typename Helper >
static void btree_perf_track_time (THREAD_ENTRY *thread_p, Helper *helper)
 
template<typename Helper >
static void btree_perf_track_traverse_time (THREAD_ENTRY *thread_p, Helper *helper)
 
static void btree_perf_ovf_oids_fix_time (THREAD_ENTRY *thread_p, PERF_UTIME_TRACKER *track)
 
static void btree_perf_unique_lock_time (THREAD_ENTRY *thread_p, PERF_UTIME_TRACKER *track, LOCK lock)
 
static void BTREE_RV_GET_DATA_LENGTH (const char *rv_ptr, const char *rv_start, int &rv_length)
 
STATIC_INLINE PAGE_PTR btree_fix_root_with_info (THREAD_ENTRY *thread_p, BTID *btid, PGBUF_LATCH_MODE latch_mode, VPID *root_vpid_p, BTREE_ROOT_HEADER **root_header_p, BTID_INT *btid_int_p) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE bool btree_is_fence_key (PAGE_PTR leaf_page, PGSLOTID slotid) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int btree_count_oids (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, MVCC_REC_HEADER *mvcc_header, bool *stop, void *args) __attribute__((ALWAYS_INLINE))
 
static int btree_store_overflow_key (THREAD_ENTRY *thread_p, BTID_INT *btid, DB_VALUE *key, int size, BTREE_NODE_TYPE node_type, VPID *firstpg_vpid)
 
static int btree_load_overflow_key (THREAD_ENTRY *thread_p, BTID_INT *btid, VPID *firstpg_vpid, DB_VALUE *key, BTREE_NODE_TYPE node_type)
 
static int btree_delete_overflow_key (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, INT16 slot_id, BTREE_NODE_TYPE node_type)
 
static void btree_write_fixed_portion_of_non_leaf_record (RECDES *rec, NON_LEAF_REC *nlf_rec)
 
static void btree_read_fixed_portion_of_non_leaf_record (RECDES *rec, NON_LEAF_REC *nlf_rec)
 
static void btree_write_fixed_portion_of_non_leaf_record_to_orbuf (OR_BUF *buf, NON_LEAF_REC *nlf_rec)
 
static int btree_read_fixed_portion_of_non_leaf_record_from_orbuf (OR_BUF *buf, NON_LEAF_REC *nlf_rec)
 
static void btree_append_oid (RECDES *rec, OID *oid)
 
STATIC_INLINE void btree_add_mvccid (RECDES *rec, int oid_offset, int mvccid_offset, MVCCID mvccid, short flag, char **rv_undo_data_ptr, char **rv_redo_data_ptr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void btree_set_mvccid (RECDES *rec, int mvccid_offset, MVCCID *p_mvccid, char **rv_undo_data_ptr, char **rv_redo_data_ptr) __attribute__((ALWAYS_INLINE))
 
static void btree_remove_mvccid (RECDES *record, int oid_offset, int mvccid_offset, short flag, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
static void btree_record_append_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, BTREE_OBJECT_INFO *object_info, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
static void btree_insert_object_ordered_by_oid (THREAD_ENTRY *thread_p, RECDES *record, BTID_INT *btid_int, BTREE_OBJECT_INFO *object_info, char **rv_undo_data_ptr, char **rv_redo_data_ptr, int *offset_to_objptr)
 
static int btree_start_overflow_page (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_OBJECT_INFO *object_info, VPID *first_overflow_vpid, VPID *near_vpid, VPID *new_vpid, PAGE_PTR *new_page_ptr)
 
static int btree_read_record_without_decompression (THREAD_ENTRY *thread_p, BTID_INT *btid, RECDES *Rec, DB_VALUE *key, void *rec_header, BTREE_NODE_TYPE node_type, bool *clear_key, int *offset, int copy)
 
static PAGE_PTR btree_get_new_page (THREAD_ENTRY *thread_p, BTID_INT *btid, VPID *vpid, VPID *near_vpid)
 
static int btree_search_nonleaf_page (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, DB_VALUE *key, INT16 *slot_id, VPID *child_vpid, page_key_boundary *page_bounds)
 
static int btree_search_leaf_page (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, DB_VALUE *key, BTREE_SEARCH_KEY_HELPER *search_key)
 
static int btree_leaf_is_key_between_min_max (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR leaf, DB_VALUE *key, BTREE_SEARCH_KEY_HELPER *search_key)
 
static int xbtree_test_unique (THREAD_ENTRY *thread_p, BTID *btid)
 
static int btree_get_stats_midxkey (THREAD_ENTRY *thread_p, BTREE_STATS_ENV *env, DB_MIDXKEY *midxkey)
 
static int btree_get_stats_key (THREAD_ENTRY *thread_p, BTREE_STATS_ENV *env, MVCC_SNAPSHOT *mvcc_snapshot)
 
static int btree_get_stats_with_AR_sampling (THREAD_ENTRY *thread_p, BTREE_STATS_ENV *env)
 
static int btree_get_stats_with_fullscan (THREAD_ENTRY *thread_p, BTREE_STATS_ENV *env)
 
static DISK_ISVALID btree_check_page_key (THREAD_ENTRY *thread_p, const OID *class_oid_p, BTID_INT *btid, const char *btname, PAGE_PTR page_ptr, VPID *page_vpid)
 
static DISK_ISVALID btree_check_pages (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, VPID *pg_vpid)
 
static DISK_ISVALID btree_verify_subtree (THREAD_ENTRY *thread_p, const OID *class_oid_p, BTID_INT *btid, const char *btname, PAGE_PTR pg_ptr, VPID *pg_vpid, BTREE_NODE_INFO *INFO)
 
static int btree_get_subtree_capacity (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, BTREE_CAPACITY *cpc)
 
static void btree_print_space (FILE *fp, int n)
 
static int btree_delete_meta_record (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, int slot_id)
 
static int btree_merge_root (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR P, PAGE_PTR Q, PAGE_PTR R)
 
static int btree_merge_node (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR P, PAGE_PTR Q, PAGE_PTR R, INT16 p_slot_id, VPID *child_vpid, BTREE_MERGE_STATUS status)
 
static int btree_node_size_uncompressed (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr)
 
static BTREE_MERGE_STATUS btree_node_mergeable (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR L, PAGE_PTR R)
 
static DB_VALUEbtree_find_split_point (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, int *mid_slot, DB_VALUE *key, BTREE_INSERT_HELPER *helper, bool *clear_midkey)
 
static int btree_split_next_pivot (BTREE_NODE_SPLIT_INFO *split_info, float new_value, int max_index)
 
static int btree_split_find_pivot (int total, BTREE_NODE_SPLIT_INFO *split_info)
 
static int btree_split_node (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR P, PAGE_PTR Q, PAGE_PTR R, VPID *P_vpid, VPID *Q_vpid, VPID *R_vpid, INT16 p_slot_id, BTREE_NODE_TYPE node_type, DB_VALUE *key, BTREE_INSERT_HELPER *helper, VPID *child_vpid)
 
static int btree_split_root (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR P, PAGE_PTR Q, PAGE_PTR R, VPID *P_vpid, VPID *Q_vpid, VPID *R_vpid, BTREE_NODE_TYPE node_type, DB_VALUE *key, BTREE_INSERT_HELPER *helper, VPID *child_vpid)
 
static int btree_find_lower_bound_leaf (THREAD_ENTRY *thread_p, BTREE_SCAN *BTS, BTREE_STATS *stat_info_p)
 
static PAGE_PTR btree_find_leftmost_leaf (THREAD_ENTRY *thread_p, BTID *btid, VPID *pg_vpid, BTREE_STATS *stat_info_p)
 
static PAGE_PTR btree_find_rightmost_leaf (THREAD_ENTRY *thread_p, BTID *btid, VPID *pg_vpid, BTREE_STATS *stat_info_p)
 
static PAGE_PTR btree_find_AR_sampling_leaf (THREAD_ENTRY *thread_p, BTID *btid, VPID *pg_vpid, BTREE_STATS *stat_info_p, bool *found_p)
 
static PAGE_PTR btree_find_boundary_leaf (THREAD_ENTRY *thread_p, BTID *btid, VPID *pg_vpid, BTREE_STATS *stat_info, BTREE_BOUNDARY where)
 
static int btree_find_next_index_record (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_find_next_index_record_holding_current (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, RECDES *peek_rec)
 
static int btree_find_next_index_record_holding_current_helper (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, PAGE_PTR first_page)
 
static int btree_apply_key_range_and_filter (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, bool is_iss, bool *key_range_satisfied, bool *key_filter_satisfied, bool need_to_check_null)
 
static int btree_dump_curr_key (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, FILTER_INFO *filter, OID *oid, INDX_SCAN_ID *iscan_id)
 
static DISK_ISVALID btree_find_key_from_leaf (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, int key_cnt, OID *oid, DB_VALUE *key, bool *clear_key)
 
static DISK_ISVALID btree_find_key_from_nleaf (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, int key_cnt, OID *oid, DB_VALUE *key, bool *clear_key)
 
static DISK_ISVALID btree_find_key_from_page (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, OID *oid, DB_VALUE *key, bool *clear_key)
 
static void btree_dump_root_header (THREAD_ENTRY *thread_p, FILE *fp, PAGE_PTR page_ptr)
 
static void btree_dump_leaf_record (THREAD_ENTRY *thread_p, FILE *fp, BTID_INT *btid, RECDES *rec, int n)
 
static void btree_dump_non_leaf_record (THREAD_ENTRY *thread_p, FILE *fp, BTID_INT *btid, RECDES *rec, int n, int print_key)
 
static void btree_dump_page (THREAD_ENTRY *thread_p, FILE *fp, const OID *class_oid_p, BTID_INT *btid, const char *btname, PAGE_PTR page_ptr, VPID *pg_vpid, int depth, int level)
 
static void btree_dump_page_with_subtree (THREAD_ENTRY *thread_p, FILE *fp, BTID_INT *btid, PAGE_PTR pg_ptr, VPID *pg_vpid, int depth, int level)
 
static DB_VALUEbtree_set_split_point (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, INT16 mid_slot, DB_VALUE *key, bool *clear_midkey)
 
static void btree_split_test (THREAD_ENTRY *thread_p, BTID_INT *btid, DB_VALUE *key, VPID *S_vpid, PAGE_PTR S_page, BTREE_NODE_TYPE node_type)
 
static int btree_verify_node (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR page_ptr)
 
static int btree_verify_nonleaf_node (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR page_ptr)
 
static int btree_verify_leaf_node (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR page_ptr)
 
static void btree_set_unknown_key_error (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, const char *debug_msg)
 
static int btree_rv_write_log_record_for_key_insert (char *log_rec, int *log_length, INT16 key_len, RECDES *recp)
 
static int btree_rv_write_log_record (char *log_rec, int *log_length, RECDES *recp, BTREE_NODE_TYPE node_type)
 
static int btree_find_oid_and_its_page (THREAD_ENTRY *thread_p, BTID_INT *btid_int, OID *oid, PAGE_PTR leaf_page, BTREE_OP_PURPOSE purpose, BTREE_MVCC_INFO *match_mvccinfo, RECDES *leaf_record, LEAF_REC *leaf_rec_info, int after_key_offset, PAGE_PTR *found_page, PAGE_PTR *prev_page, int *offset_to_object, BTREE_MVCC_INFO *object_mvcc_info)
 
static int btree_find_oid_does_mvcc_info_match (THREAD_ENTRY *thread_p, BTREE_MVCC_INFO *mvcc_info, BTREE_OP_PURPOSE purpose, BTREE_MVCC_INFO *match_mvccinfo, bool *is_match)
 
static int btree_find_oid_from_leaf (THREAD_ENTRY *thread_p, BTID_INT *btid, RECDES *leaf_record, int after_key_offset, OID *oid, BTREE_MVCC_INFO *match_mvccinfo, BTREE_OP_PURPOSE purpose, int *offset_to_object, BTREE_MVCC_INFO *mvcc_info)
 
static int btree_find_oid_from_ovfl (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR overflow_page, OID *oid, BTREE_OP_PURPOSE purpose, BTREE_MVCC_INFO *match_mvccinfo, int *offset_to_object, BTREE_MVCC_INFO *mvcc_info)
 
static int btree_leaf_get_vpid_for_overflow_oids (RECDES *rec, VPID *vpid)
 
static int btree_record_get_last_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *recp, BTREE_NODE_TYPE node_type, int after_key_offset, OID *oidp, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, int *last_oid_mvcc_offset)
 
static void btree_record_remove_last_object (THREAD_ENTRY *thread_p, BTID_INT *btid, RECDES *recp, BTREE_NODE_TYPE node_type, int last_oid_mvcc_offset, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
static char * btree_leaf_get_nth_oid_ptr (BTID_INT *btid, RECDES *recp, BTREE_NODE_TYPE node_type, int oid_list_offset, int n)
 
static void btree_leaf_set_flag (RECDES *recp, short record_flag)
 
static void btree_leaf_clear_flag (RECDES *recp, short record_flag)
 
static short btree_leaf_get_flag (RECDES *recp)
 
static bool btree_leaf_is_flaged (RECDES *recp, short record_flag)
 
static void btree_record_object_set_mvcc_flags (char *data, short mvcc_flags)
 
static void btree_record_object_clear_mvcc_flags (char *rec_data, short mvcc_flags)
 
static INLINE short btree_record_object_get_mvcc_flags (char *data) __attribute__((ALWAYS_INLINE))
 
static INLINE bool btree_record_object_is_flagged (char *data, short mvcc_flag) __attribute__((ALWAYS_INLINE))
 
static void btree_leaf_record_handle_first_overflow (THREAD_ENTRY *thread_p, RECDES *recp, BTID_INT *btid_int, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
static int btree_record_get_num_oids (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *rec, int offset, BTREE_NODE_TYPE node_type)
 
static int btree_record_get_num_visible_oids (THREAD_ENTRY *thread_p, BTID_INT *btid, RECDES *rec, int oid_offset, BTREE_NODE_TYPE node_type, int *max_visible_oids, MVCC_SNAPSHOT *mvcc_snapshot, int *num_visible)
 
static int btree_get_num_visible_oids_from_all_ovf (THREAD_ENTRY *thread_p, BTID_INT *btid, VPID *first_ovfl_vpid, int *num_visible_oids, int *max_visible_oids, MVCC_SNAPSHOT *mvcc_snapshot)
 
static void btree_write_default_split_info (BTREE_NODE_SPLIT_INFO *info)
 
static int btree_set_vpid_previous_vpid (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_p, VPID *prev)
 
static int btree_compare_individual_key_value (DB_VALUE *key1, DB_VALUE *key2, TP_DOMAIN *key_domain)
 
static int btree_get_next_page_vpid (THREAD_ENTRY *thread_p, PAGE_PTR leaf_page, VPID *next_vpid)
 
static PAGE_PTR btree_get_next_page (THREAD_ENTRY *thread_p, PAGE_PTR page_p)
 
static int btree_range_opt_check_add_index_key (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, MULTI_RANGE_OPT *multi_range_opt, OID *p_new_oid, bool *key_added)
 
static int btree_top_n_items_binary_search (RANGE_OPT_ITEM **top_n_items, int *att_idxs, TP_DOMAIN **domains, bool *desc_order, DB_VALUE *new_key_values, int num_keys, int first, int last, int *new_pos)
 
static int btree_iss_set_key (BTREE_SCAN *bts, INDEX_SKIP_SCAN *iss)
 
static int btree_insert_mvcc_delid_into_page (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr, BTREE_NODE_TYPE node_type, DB_VALUE *key, BTREE_INSERT_HELPER *insert_helper, PGSLOTID slot_id, RECDES *rec, int oid_offset)
 
static int btree_key_append_object_as_new_overflow (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR leaf_page, BTREE_OBJECT_INFO *object_info, BTREE_INSERT_HELPER *insert_helper, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_rec, VPID *first_ovfl_vpid)
 
static int btree_key_append_object_to_overflow (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR ovfl_page, BTREE_OBJECT_INFO *object_info, BTREE_INSERT_HELPER *insert_helper)
 
static int btree_find_free_overflow_oids_page (THREAD_ENTRY *thread_p, BTID_INT *btid, VPID *first_ovfl_vpid, PAGE_PTR *overflow_page)
 
static int btree_delete_key_from_leaf (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR leaf_pg, LEAF_REC *leafrec_pnt, BTREE_DELETE_HELPER *delete_helper, BTREE_SEARCH_KEY_HELPER *search_key)
 
static int btree_replace_first_oid_with_ovfl_oid (THREAD_ENTRY *thread_p, BTID_INT *btid, DB_VALUE *key, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_rec, VPID *ovfl_vpid)
 
static int btree_modify_leaf_ovfl_vpid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR leaf_page, RECDES *leaf_record, BTREE_SEARCH_KEY_HELPER *search_key, VPID *next_ovfl_vpid)
 
static int btree_modify_overflow_link (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR ovfl_page, VPID *next_ovfl_vpid)
 
static DISK_ISVALID btree_repair_prev_link_by_btid (THREAD_ENTRY *thread_p, BTID *btid, bool repair, char *index_name)
 
static DISK_ISVALID btree_repair_prev_link_by_class_oid (THREAD_ENTRY *thread_p, OID *oid, BTID *idx_btid, bool repair)
 
static bool btree_node_is_compressed (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr)
 
static int btree_node_common_prefix (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr)
 
static int btree_recompress_record (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, DB_VALUE *fence_key, int old_prefix, int new_prefix)
 
static int btree_compress_node (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR page_ptr)
 
static const char * node_type_to_string (short node_type)
 
static char * key_type_to_string (char *buf, int buf_size, TP_DOMAIN *key_type)
 
static int index_attrs_to_string (char *buf, int buf_size, OR_INDEX *index_p, RECDES *recdes)
 
static SCAN_CODE btree_scan_for_show_index_header (THREAD_ENTRY *thread_p, DB_VALUE **out_values, int out_cnt, const char *class_name, OR_INDEX *index_p, OID *class_oid_p)
 
static SCAN_CODE btree_scan_for_show_index_capacity (THREAD_ENTRY *thread_p, DB_VALUE **out_values, int out_cnt, const char *class_name, OR_INDEX *index_p)
 
static bool btree_leaf_lsa_eq (THREAD_ENTRY *thread_p, LOG_LSA *a, LOG_LSA *b)
 
static int btree_get_node_level (THREAD_ENTRY *thread_p, PAGE_PTR page_ptr)
 
static BTREE_SEARCH btree_key_find_first_visible_row (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *rec, int offset, BTREE_NODE_TYPE node_type, OID *oid, OID *class_oid, int max_oids)
 
static BTREE_SEARCH btree_key_find_first_visible_row_from_all_ovf (THREAD_ENTRY *thread_p, BTID_INT *btid_int, VPID *first_ovfl_vpid, OID *oid, OID *class_oid)
 
static int btree_or_put_mvccinfo (OR_BUF *buf, BTREE_MVCC_INFO *mvcc_info)
 
static int btree_or_get_mvccinfo (OR_BUF *buf, BTREE_MVCC_INFO *mvcc_info, short btree_mvcc_flags)
 
static int btree_or_put_object (OR_BUF *buf, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, BTREE_OBJECT_INFO *object_info)
 
static int btree_or_get_object (OR_BUF *buf, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, int after_key_offset, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info)
 
static char * btree_unpack_object (char *ptr, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, RECDES *record, int after_key_offset, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info)
 
static char * btree_pack_object (char *ptr, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, RECDES *record, BTREE_OBJECT_INFO *object_info)
 
static int btree_search_key_and_apply_functions (THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, BTREE_ROOT_WITH_KEY_FUNCTION *root_fnct, void *root_args, BTREE_ADVANCE_WITH_KEY_FUNCTION *advance_fnct, void *advance_args, BTREE_PROCESS_KEY_FUNCTION *leaf_fnct, void *process_key_args, BTREE_SEARCH_KEY_HELPER *search_key, PAGE_PTR *leaf_page_ptr)
 
static int btree_get_root_with_key (THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *root_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_advance_and_find_key (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *crt_page, PAGE_PTR *advance_to_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_key_find_unique_version_oid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_find_and_lock_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_find_and_lock_unique_of_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_find_and_lock_unique_of_non_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_process_objects (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *leaf_record, int after_key_offset, LEAF_REC *leaf_info, BTREE_PROCESS_OBJECT_FUNCTION *func, void *args)
 
static int btree_record_process_objects (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, RECDES *record, int after_key_offset, bool *stop, BTREE_PROCESS_OBJECT_FUNCTION *func, void *args)
 
static int btree_record_satisfies_snapshot (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, bool *stop, void *args)
 
static int btree_range_scan_read_record (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_range_scan_advance_over_filtered_keys (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_range_scan_descending_fix_prev_leaf (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, int *key_count, BTREE_NODE_HEADER **node_header_ptr, VPID *next_vpid)
 
static int btree_range_scan_start (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_range_scan_resume (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_range_scan_count_oids_leaf_and_one_ovf (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_scan_update_range (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, key_val_range *kv_range)
 
static int btree_ils_adjust_range (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_select_visible_object_for_range_scan (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, bool *stop, void *args)
 
static int btree_range_scan_find_fk_any_object (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
static int btree_fk_object_does_exist (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, bool *stop, void *args)
 
static int btree_insert_internal (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, BTREE_MVCC_INFO *mvcc_info, LOG_LSA *undo_nxlsa, BTREE_OP_PURPOSE purpose)
 
static int btree_undo_delete_physical (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *oid, BTREE_MVCC_INFO *mvcc_info, LOG_LSA *undo_nxlsa)
 
static int btree_fix_root_for_insert (THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *root_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_split_node_and_advance (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *crt_page, PAGE_PTR *advance_to_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_get_max_new_data_size (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR page, BTREE_NODE_TYPE node_type, int key_len, BTREE_INSERT_HELPER *helper, bool known_to_be_found)
 
static int btree_key_insert_new_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_online_index_IB_insert_list (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_online_index_IB_insert (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_insert_new_key (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf_page, BTREE_INSERT_HELPER *insert_helper, BTREE_SEARCH_KEY_HELPER *search_key)
 
static int btree_key_find_and_insert_delete_mvccid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_insert_delete_mvccid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, BTREE_INSERT_HELPER *insert_helper, RECDES *leaf_record, PAGE_PTR object_page, int offset_to_found_object)
 
static int btree_key_lock_and_append_object_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf, bool *restart, BTREE_SEARCH_KEY_HELPER *search_key, BTREE_INSERT_HELPER *insert_helper, RECDES *leaf_record)
 
static int btree_key_append_object_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_record, LEAF_REC *leaf_record_info, int offset_after_key, BTREE_INSERT_HELPER *insert_helper, BTREE_OBJECT_INFO *first_object)
 
static int btree_key_append_object_non_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_record, int offset_after_key, LEAF_REC *leaf_info, BTREE_OBJECT_INFO *btree_obj, BTREE_INSERT_HELPER *insert_helper)
 
static int btree_key_relocate_last_into_ovf (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_record, LEAF_REC *leaf_record_info, int offset_after_key, BTREE_INSERT_HELPER *insert_helper)
 
static int btree_key_append_object_into_ovf (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR leaf, BTREE_SEARCH_KEY_HELPER *search_key, RECDES *leaf_record, LEAF_REC *leaf_record_info, BTREE_INSERT_HELPER *insert_helper, BTREE_OBJECT_INFO *append_object)
 
static void btree_key_record_check_no_visible (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR leaf_page, PGSLOTID slotid)
 
static int btree_delete_internal (THREAD_ENTRY *thread_p, BTID *btid, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, DB_VALUE *key, OR_BUF *buffered_key, int *unique, int op_type, btree_unique_stats *unique_stat_info, BTREE_MVCC_INFO *match_mvccinfo, LOG_LSA *undo_nxlsa, BTREE_OBJECT_INFO *second_obj_info, BTREE_OP_PURPOSE purpose)
 
static int btree_fix_root_for_delete (THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *root_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_merge_node_and_advance (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *crt_page, PAGE_PTR *advance_to_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)
 
static int btree_key_delete_remove_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_remove_object_and_keep_visible_first (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_leaf_record_replace_first_with_last (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR leaf_page, RECDES *leaf_record, BTREE_SEARCH_KEY_HELPER *search_key, OID *last_oid, OID *last_class_oid, BTREE_MVCC_INFO *last_mvcc_info, int offset_to_last_object)
 
static int btree_record_remove_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR page, RECDES *record, BTREE_SEARCH_KEY_HELPER *search_key, BTREE_NODE_TYPE node_type, int offset_to_object, LOG_DATA_ADDR *addr)
 
static void btree_record_remove_object_internal (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int offset_to_object, char **rv_undo_data, char **rv_redo_data, int *displacement)
 
static int btree_key_remove_object (THREAD_ENTRY *thread_p, DB_VALUE *key, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR leaf_page, RECDES *leaf_record, LEAF_REC *leaf_info, int offset_after_key, BTREE_SEARCH_KEY_HELPER *search_key, PAGE_PTR *overflow_page, PAGE_PTR prev_page, BTREE_NODE_TYPE node_type, int offset_to_object)
 
static int btree_overflow_remove_object (THREAD_ENTRY *thread_p, DB_VALUE *key, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR *overflow_page, PAGE_PTR prev_page, PAGE_PTR leaf_page, RECDES *leaf_record, BTREE_SEARCH_KEY_HELPER *search_key, int offset_to_object)
 
static int btree_leaf_remove_object (THREAD_ENTRY *thread_p, DB_VALUE *key, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR leaf_page, RECDES *leaf_record, LEAF_REC *leaf_rec_info, int offset_after_key, BTREE_SEARCH_KEY_HELPER *search_key, int offset_to_object)
 
static int btree_key_remove_insert_mvccid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static void btree_record_remove_insid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int offset_to_object, char **rv_undo_data, char **rv_redo_data, int *displacement)
 
static int btree_key_remove_delete_mvccid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static void btree_record_remove_delid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int offset_to_object, char **rv_undo_data, char **rv_redo_data)
 
static void btree_record_add_delid (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int offset_to_object, MVCCID delete_mvccid, char **rv_undo_data, char **rv_redo_data)
 
static int btree_undo_mvcc_delete (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, OID *oid, OID *class_oid, BTREE_MVCC_INFO *match_mvccinfo, LOG_LSA *undo_nxlsa)
 
static int btree_undo_insert_object (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, OID *oid, OID *class_oid, MVCCID insert_mvccid, LOG_LSA *undo_nxlsa)
 
static int btree_undo_insert_object_unique_multiupd (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, BTREE_OBJECT_INFO *inserted_object, BTREE_OBJECT_INFO *second_object, MVCCID insert_mvccid, LOG_LSA *undo_nxlsa)
 
static int btree_key_remove_delete_mvccid_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, BTREE_SEARCH_KEY_HELPER *search_key, PAGE_PTR leaf_page, RECDES *leaf_record, PAGE_PTR overflow_page, RECDES *overflow_record, BTREE_NODE_TYPE node_type, int offset_to_object)
 
static int btree_remove_delete_mvccid_unique_internal (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *helper, PAGE_PTR leaf_page, RECDES *leaf_record, BTREE_NODE_TYPE node_type, PAGE_PTR overflow_page, RECDES *overflow_record, int offset_to_object, char **rv_undo_data, char **rv_redo_data)
 
static int btree_key_remove_delete_mvccid_non_unique (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR page, RECDES *record, PGSLOTID slotid, BTREE_NODE_TYPE node_type, int offset_to_object)
 
static int btree_overflow_record_replace_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_DELETE_HELPER *delete_helper, PAGE_PTR overflow_page, RECDES *overflow_record, int *offset_to_replaced_object, BTREE_OBJECT_INFO *replacing_object)
 
static void btree_record_replace_object (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int *offset_to_replaced, BTREE_OBJECT_INFO *replacement, char **rv_undo_data, char **rv_redo_data)
 
static int btree_rv_record_modify_internal (THREAD_ENTRY *thread_p, LOG_RCV *rcv, bool is_undo)
 
static int btree_delete_postponed (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, BTREE_OBJECT_INFO *btree_obj, MVCCID tran_mvccid, LOG_LSA *reference_lsa)
 
static MVCCID btree_get_creator_mvccid (THREAD_ENTRY *thread_p, PAGE_PTR root_page)
 
static int btree_seq_find_oid_from_ovfl (THREAD_ENTRY *thread_p, BTID_INT *btid_int, OID *oid, RECDES *ovf_record, char *initial_oid_ptr, char *oid_ptr_lower_bound, char *oid_ptr_upper_bound, BTREE_OP_PURPOSE purpose, BTREE_MVCC_INFO *match_mvccinfo, int *offset_to_object, BTREE_MVCC_INFO *mvcc_info)
 
STATIC_INLINE void btree_delete_sysop_end (THREAD_ENTRY *thread_p, BTREE_DELETE_HELPER *helper) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void btree_insert_sysop_end (THREAD_ENTRY *thread_p, BTREE_INSERT_HELPER *helper) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE const char * btree_purpose_to_string (BTREE_OP_PURPOSE purpose) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE const char * btree_op_type_to_string (int op_type) __attribute__((ALWAYS_INLINE))
 
static bool btree_is_class_oid_packed (BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, bool is_first)
 
static bool btree_is_fixed_size (BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, bool is_first)
 
static bool btree_is_insert_data_purpose (BTREE_OP_PURPOSE purpose)
 
static bool btree_is_insert_object_purpose (BTREE_OP_PURPOSE purpose)
 
static bool btree_is_insert_delid_purpose (BTREE_OP_PURPOSE purpose)
 
static bool btree_is_delete_data_purpose (BTREE_OP_PURPOSE purpose)
 
static bool btree_is_delete_object_purpose (BTREE_OP_PURPOSE purpose)
 
static void btree_rv_log_delete_object (THREAD_ENTRY *thread_p, const BTREE_DELETE_HELPER &delete_helper, LOG_DATA_ADDR &addr, int undo_length, int redo_length, const char *undo_data, const char *redo_data)
 
static void btree_rv_log_insert_object (THREAD_ENTRY *thread_p, const BTREE_INSERT_HELPER &insert_helper, LOG_DATA_ADDR &addr, int undo_length, int redo_length, const char *undo_data, const char *redo_data)
 
static void btree_online_index_check_state (MVCCID state)
 
static bool btree_online_index_is_insert_flag_state (MVCCID state)
 
static bool btree_online_index_is_delete_flag_state (MVCCID state)
 
static bool btree_online_index_is_normal_state (MVCCID state)
 
static void btree_online_index_set_insert_flag_state (MVCCID &state)
 
static void btree_online_index_set_delete_flag_state (MVCCID &state)
 
static void btree_online_index_set_normal_state (MVCCID &state)
 
static void btree_online_index_change_state (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, BTREE_NODE_TYPE node_type, int offset_to_object, MVCCID new_state, char **rv_undo_data, char **rv_redo_data)
 
static int btree_find_oid_with_page_and_record (THREAD_ENTRY *thread_p, BTID_INT *btid_int, OID *oid, PAGE_PTR leaf_page, BTREE_OP_PURPOSE purpose, BTREE_MVCC_INFO *match_mvccinfo, RECDES *record, LEAF_REC *leaf_info, int offset_after_key, PAGE_PTR *found_page, PAGE_PTR *prev_page, int *offset_to_object, BTREE_MVCC_INFO *object_mvcc_info, RECDES *new_record)
 
static int btree_key_online_index_tran_insert (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_online_index_tran_insert_DF (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static int btree_key_online_index_tran_delete (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)
 
static void btree_insert_helper_to_delete_helper (BTREE_INSERT_HELPER *insert_helper, BTREE_DELETE_HELPER *delete_helper)
 
static void btree_delete_helper_to_insert_helper (BTREE_DELETE_HELPER *delete_helper, BTREE_INSERT_HELPER *insert_helper)
 
static bool btree_is_online_index_loading (BTREE_OP_PURPOSE purpose)
 
static bool btree_is_single_object_key (THREAD_ENTRY *thread_p, BTID_INT *btid_int, BTREE_NODE_TYPE node_type, RECDES *record, int offset_after_key)
 
static bool btree_check_locking_for_insert_unique (THREAD_ENTRY *thread_p, const BTREE_INSERT_HELPER *insert_helper)
 
static bool btree_check_locking_for_delete_unique (THREAD_ENTRY *thread_p, const BTREE_DELETE_HELPER *delete_helper)
 
bool btree_clear_key_value (bool *clear_flag, DB_VALUE *key_value)
 
void btree_init_temp_key_value (bool *clear_flag, DB_VALUE *key_value)
 
int btree_create_overflow_key_file (THREAD_ENTRY *thread_p, BTID_INT *btid)
 
void btree_leaf_record_change_overflow_link (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *leaf_record, VPID *new_overflow_vpid, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
int btree_leaf_get_first_object (BTID_INT *btid, RECDES *recp, OID *oidp, OID *class_oid, BTREE_MVCC_INFO *mvcc_info)
 
int btree_get_num_visible_from_leaf_and_ovf (THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *leaf_record, int offset_after_key, LEAF_REC *leaf_info, int *max_visible_oids, MVCC_SNAPSHOT *mvcc_snapshot, int *num_visible)
 
void btree_leaf_change_first_object (THREAD_ENTRY *thread_p, RECDES *recp, BTID_INT *btid, OID *oidp, OID *class_oidp, BTREE_MVCC_INFO *mvcc_info, int *key_offset, char **rv_undo_data_ptr, char **rv_redo_data_ptr)
 
int btree_get_disk_size_of_key (DB_VALUE *key)
 
int btree_write_record (THREAD_ENTRY *thread_p, BTID_INT *btid, void *node_rec, DB_VALUE *key, BTREE_NODE_TYPE node_type, int key_type, int key_len, bool during_loading, OID *class_oid, OID *oid, BTREE_MVCC_INFO *mvcc_info, RECDES *rec)
 
int btree_read_record (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pgptr, RECDES *rec, DB_VALUE *key, void *rec_header, BTREE_NODE_TYPE node_type, bool *clear_key, int *offset, int copy_key, BTREE_SCAN *bts)
 
void btree_dump_key (FILE *fp, const DB_VALUE *key)
 
int btree_initialize_new_page (THREAD_ENTRY *thread_p, PAGE_PTR page, void *args)
 
BTIDxbtree_add_index (THREAD_ENTRY *thread_p, BTID *btid, TP_DOMAIN *key_type, OID *class_oid, int attr_id, int unique_pk, int num_oids, int num_nulls, int num_keys)
 
int xbtree_delete_index (THREAD_ENTRY *thread_p, BTID *btid)
 
TP_DOMAINbtree_generate_prefix_domain (BTID_INT *btid)
 
int btree_glean_root_header_info (THREAD_ENTRY *thread_p, BTREE_ROOT_HEADER *root_header, BTID_INT *btid)
 
BTREE_SEARCH xbtree_find_multi_uniques (THREAD_ENTRY *thread_p, OID *class_oid, int pruning_type, BTID *btids, DB_VALUE *values, int count, SCAN_OPERATION_TYPE op_type, OID **oids, int *oids_count)
 
int btree_find_foreign_key (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *found_oid)
 
void btree_scan_clear_key (BTREE_SCAN *btree_scan)
 
bool btree_is_unique_type (BTREE_TYPE type)
 
int xbtree_class_test_unique (THREAD_ENTRY *thread_p, char *buf, int buf_size)
 
int xbtree_get_unique_pk (THREAD_ENTRY *thread_p, BTID *btid)
 
int btree_get_unique_statistics_for_count (THREAD_ENTRY *thread_p, BTID *btid, int *oid_cnt, int *null_cnt, int *key_cnt)
 
int btree_get_unique_statistics (THREAD_ENTRY *thread_p, BTID *btid, int *oid_cnt, int *null_cnt, int *key_cnt)
 
void btree_get_root_vpid_from_btid (THREAD_ENTRY *thread_p, BTID *btid, VPID *root_vpid)
 
int btree_get_btid_from_file (THREAD_ENTRY *thread_p, const VFID *vfid, BTID *btid_out)
 
int btree_get_stats (THREAD_ENTRY *thread_p, BTREE_STATS *stat_info_p, bool with_fullscan)
 
int xbtree_get_key_type (THREAD_ENTRY *thread_p, BTID btid, TP_DOMAIN **key_type)
 
DISK_ISVALID btree_verify_tree (THREAD_ENTRY *thread_p, const OID *class_oid_p, BTID_INT *btid_int, const char *btname)
 
DISK_ISVALID btree_check_tree (THREAD_ENTRY *thread_p, const OID *class_oid_p, BTID *btid, const char *btname)
 
DISK_ISVALID btree_check_by_btid (THREAD_ENTRY *thread_p, BTID *btid)
 
int btree_get_pkey_btid (THREAD_ENTRY *thread_p, OID *cls_oid, BTID *pkey_btid)
 
DISK_ISVALID btree_check_by_class_oid (THREAD_ENTRY *thread_p, OID *cls_oid, BTID *idx_btid)
 
DISK_ISVALID btree_repair_prev_link (THREAD_ENTRY *thread_p, OID *oid, BTID *index_btid, bool repair)
 
DISK_ISVALID btree_check_all (THREAD_ENTRY *thread_p)
 
int btree_keyoid_checkscan_start (THREAD_ENTRY *thread_p, BTID *btid, BTREE_CHECKSCAN *btscan)
 
DISK_ISVALID btree_keyoid_checkscan_check (THREAD_ENTRY *thread_p, BTREE_CHECKSCAN *btscan, OID *cls_oid, DB_VALUE *key, OID *oid)
 
void btree_keyoid_checkscan_end (THREAD_ENTRY *thread_p, BTREE_CHECKSCAN *btscan)
 
int btree_index_capacity (THREAD_ENTRY *thread_p, BTID *btid, BTREE_CAPACITY *cpc)
 
int btree_dump_capacity (THREAD_ENTRY *thread_p, FILE *fp, BTID *btid)
 
void btree_dump (THREAD_ENTRY *thread_p, FILE *fp, BTID *btid, int level)
 
TP_DOMAINbtree_read_key_type (THREAD_ENTRY *thread_p, BTID *btid)
 
int btree_get_prefix_separator (const DB_VALUE *key1, const DB_VALUE *key2, DB_VALUE *prefix_key, TP_DOMAIN *key_domain)
 
int btree_update (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *old_key, DB_VALUE *new_key, OID *cls_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
 
int btree_reflect_global_unique_statistics (THREAD_ENTRY *thread_p, GLOBAL_UNIQUE_STATS *unique_stat_info, bool only_active_tran)
 
int btree_locate_key (THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, VPID *pg_vpid, INT16 *slot_id, PAGE_PTR *leaf_page_out, bool *found_p)
 
int btree_keyval_search (THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, BTREE_SCAN *bts, key_val_range *kv_range, OID *class_oid, FILTER_INFO *filter, INDX_SCAN_ID *isidp, bool is_all_class_srch)
 
int btree_coerce_key (DB_VALUE *keyp, int keysize, TP_DOMAIN *btree_domainp, int key_minmax)
 
int btree_prepare_bts (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, BTID *btid, INDX_SCAN_ID *index_scan_id_p, key_val_range *kv_range, FILTER_INFO *filter, const OID *match_class_oid, DB_BIGINT *key_limit_upper, DB_BIGINT *key_limit_lower, bool need_to_check_null, void *bts_other)
 
int btree_attrinfo_read_dbvalues (THREAD_ENTRY *thread_p, DB_VALUE *curr_key, int *btree_att_ids, int btree_num_att, HEAP_CACHE_ATTRINFO *attr_info, int func_index_col_id)
 
SCAN_CODE btree_get_next_key_info (THREAD_ENTRY *thread_p, BTID *btid, BTREE_SCAN *bts, int num_classes, OID *class_oids_ptr, INDX_SCAN_ID *index_scan_id_p, DB_VALUE **key_info)
 
int btree_find_min_or_max_key (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, int find_min_key)
 
int btree_rv_util_save_page_records (THREAD_ENTRY *thread_p, PAGE_PTR page_ptr, INT16 first_slotid, int rec_cnt, INT16 ins_slotid, char *data, int *length)
 
int btree_rv_save_keyval_for_undo (BTID_INT *btid, DB_VALUE *key, OID *cls_oid, OID *oid, BTREE_MVCC_INFO *mvcc_info, BTREE_OP_PURPOSE purpose, char *preallocated_buffer, char **data, int *capacity, int *length)
 
int btree_rv_save_keyval_for_undo_two_objects (BTID_INT *btid, DB_VALUE *key, BTREE_OBJECT_INFO *first_version, BTREE_OBJECT_INFO *second_version, BTREE_OP_PURPOSE purpose, char *preallocated_buffer, char **data, int *capacity, int *length)
 
int btree_rv_update_tran_stats (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_roothdr_undo_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
void btree_rv_roothdr_dump (FILE *fp, int length, void *data)
 
int btree_rv_ovfid_undoredo_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
void btree_rv_ovfid_dump (FILE *fp, int length, void *data)
 
int btree_rv_nodehdr_undoredo_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_nodehdr_redo_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_nodehdr_undo_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_noderec_undoredo_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_noderec_redo_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_noderec_undo_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
void btree_rv_noderec_dump (FILE *fp, int length, void *data)
 
void btree_rv_noderec_dump_slot_id (FILE *fp, int length, void *data)
 
int btree_rv_pagerec_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_pagerec_delete (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_newpage_redo_init (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_read_keyval_info_nocopy (THREAD_ENTRY *thread_p, char *datap, int data_size, BTID_INT *btid, OID *cls_oid, OID *oid, BTREE_MVCC_INFO *mvcc_info, DB_VALUE *key)
 
void btree_rv_read_keybuf_nocopy (THREAD_ENTRY *thread_p, char *datap, int data_size, BTID_INT *btid, OID *cls_oid, OID *oid, BTREE_MVCC_INFO *mvcc_info, OR_BUF *key_buf)
 
void btree_rv_read_keybuf_two_objects (THREAD_ENTRY *thread_p, char *datap, int data_size, BTID_INT *btid_int, BTREE_OBJECT_INFO *first_version, BTREE_OBJECT_INFO *second_version, OR_BUF *key_buf)
 
int btree_rv_keyval_undo_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_keyval_undo_insert_unique (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_keyval_undo_insert_mvcc_delid (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_keyval_undo_delete (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_remove_marked_for_delete (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void btree_rv_keyval_dump (FILE *fp, int length, void *data)
 
int btree_rv_undoredo_copy_page (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_nop (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
bool btree_multicol_key_is_null (DB_VALUE *key)
 
int btree_multicol_key_has_null (DB_VALUE *key)
 
DISK_ISVALID btree_find_key (THREAD_ENTRY *thread_p, BTID *btid, OID *oid, DB_VALUE *key, bool *clear_key)
 
int btree_set_error (THREAD_ENTRY *thread_p, const DB_VALUE *key, const OID *obj_oid, const OID *class_oid, const BTID *btid, const char *bt_name, int severity, int err_id, const char *filename, int lineno)
 
int btree_get_asc_desc (THREAD_ENTRY *thread_p, BTID *btid, int col_idx, int *asc_desc)
 
DB_VALUE_COMPARE_RESULT btree_compare_key (DB_VALUE *key1, DB_VALUE *key2, TP_DOMAIN *key_domain, int do_coercion, int total_order, int *start_colp)
 
static int btree_fix_ovfl_oid_pages_by_btid (THREAD_ENTRY *thread_p, BTID *btid)
 
static int btree_fix_ovfl_oid_pages_tree (THREAD_ENTRY *thread_p, BTID *btid, char *btname)
 
static int btree_fix_ovfl_oid_page (THREAD_ENTRY *thread_p, BTID_INT *btid, PAGE_PTR pg_ptr, char *btname)
 
static int btree_compare_oid (const void *oid_mem1, const void *oid_mem2)
 
SCAN_CODE btree_get_next_node_info (THREAD_ENTRY *thread_p, BTID *btid, BTREE_NODE_SCAN *btns, DB_VALUE **node_info)
 
int btree_index_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 
SCAN_CODE btree_index_next_scan (THREAD_ENTRY *thread_p, int cursor, DB_VALUE **out_values, int out_cnt, void *ptr)
 
int btree_index_end_scan (THREAD_ENTRY *thread_p, void **ptr)
 
void btree_set_mvcc_header_ids_for_update (THREAD_ENTRY *thread_p, bool do_delete_only, bool do_insert_only, MVCCID *mvcc_id, MVCC_REC_HEADER *mvcc_rec_header)
 
char * btree_unpack_mvccinfo (char *ptr, BTREE_MVCC_INFO *mvcc_info, short btree_mvcc_flags)
 
char * btree_pack_mvccinfo (char *ptr, BTREE_MVCC_INFO *mvcc_info)
 
int btree_packed_mvccinfo_size (BTREE_MVCC_INFO *mvcc_info)
 
void btree_set_mvcc_flags_into_oid (MVCC_REC_HEADER *p_mvcc_header, OID *oid)
 
void btree_clear_mvcc_flags_from_oid (OID *oid)
 
int btree_compare_btids (void *mem_btid1, void *mem_btid2)
 
int btree_check_valid_record (THREAD_ENTRY *thread_p, BTID_INT *btid, RECDES *recp, BTREE_NODE_TYPE node_type, DB_VALUE *key)
 
int btree_check_foreign_key (THREAD_ENTRY *thread_p, OID *cls_oid, HFID *hfid, OID *oid, DB_VALUE *keyval, int n_attrs, OID *pk_cls_oid, BTID *pk_btid, const char *fk_name)
 
int btree_rv_undo_global_unique_stats_commit (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_redo_global_unique_stats_commit (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
BTREE_SEARCH xbtree_find_unique (THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, DB_VALUE *key, OID *class_oid, OID *oid, bool is_all_class_srch)
 
int btree_range_scan (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, BTREE_RANGE_SCAN_PROCESS_KEY_FUNC *key_func)
 
int btree_range_scan_select_visible_oids (THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 
int btree_insert (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *cls_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
 
int btree_mvcc_delete (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *class_oid, OID *oid, int op_type, btree_unique_stats *unique_stat_info, int *unique, MVCC_REC_HEADER *p_mvcc_rec_header)
 
static bool btree_key_insert_does_leaf_need_split (THREAD_ENTRY *thread_p, BTID_INT *btid_int, PAGE_PTR leaf_page, BTREE_INSERT_HELPER *insert_helper, BTREE_SEARCH_KEY_HELPER *search_key)
 
void btree_mvcc_info_from_heap_mvcc_header (MVCC_REC_HEADER *mvcc_header, BTREE_MVCC_INFO *mvcc_info)
 
void btree_mvcc_info_to_heap_mvcc_header (BTREE_MVCC_INFO *mvcc_info, MVCC_REC_HEADER *mvcc_header)
 
int btree_rv_redo_record_modify (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int btree_rv_undo_record_modify (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int btree_rv_remove_unique_stats (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_physical_delete (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *oid, OID *class_oid, int *unique, int op_type, btree_unique_stats *unique_stat_info)
 
int btree_vacuum_insert_mvccid (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, OID *oid, OID *class_oid, MVCCID insert_mvccid)
 
int btree_vacuum_object (THREAD_ENTRY *thread_p, BTID *btid, OR_BUF *buffered_key, OID *oid, OID *class_oid, MVCCID delete_mvccid)
 
int btree_rv_undo_mark_dealloc_page (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
unsigned int btree_hash_btid (void *btid, int hash_size)
 
int btree_create_file (THREAD_ENTRY *thread_p, const OID *class_oid, int attrid, BTID *btid)
 
PERF_PAGE_TYPE btree_get_perf_btree_page_type (THREAD_ENTRY *thread_p, PAGE_PTR page_ptr)
 
int btree_online_index_dispatcher (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, OID *cls_oid, OID *oid, int unique, BTREE_OP_PURPOSE purpose, LOG_LSA *undo_nxlsa)
 
int btree_online_index_list_dispatcher (THREAD_ENTRY *thread_p, BTID *btid, OID *class_oid, btree_insert_list *insert_list, int unique, BTREE_OP_PURPOSE purpose, LOG_LSA *undo_nxlsa)
 
int btree_rv_keyval_undo_online_index_tran_delete (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_keyval_undo_online_index_tran_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_online_index_check_unique_constraint (THREAD_ENTRY *thread_p, BTID *btid, const char *index_name, OID *class_oid)
 
int btree_get_class_oid_of_unique_btid (THREAD_ENTRY *thread_p, BTID *btid, OID *class_oid)
 
bool btree_is_btid_online_index (THREAD_ENTRY *thread_p, OID *class_oid, BTID *btid)
 

Variables

const size_t BTREE_RV_BUFFER_SIZE
 
const MVCCID BTREE_ONLINE_INDEX_NORMAL_FLAG_STATE = MVCCID_ALL_VISIBLE
 
const MVCCID BTREE_ONLINE_INDEX_INSERT_FLAG_STATE = 0x4000000000000000 | MVCCID_ALL_VISIBLE
 
const MVCCID BTREE_ONLINE_INDEX_DELETE_FLAG_STATE = 0x8000000000000000 | MVCCID_ALL_VISIBLE
 
const MVCCID BTREE_ONLINE_INDEX_FLAG_MASK = 0xC000000000000000
 
const MVCCID BTREE_ONLINE_INDEX_MVCCID_MASK = ~0xC000000000000000
 
static int fixed_pages
 

Macro Definition Documentation

#define BTID_DOMAIN_CHECK_MAX_SIZE   1024

Definition at line 329 of file btree.c.

#define BTREE_CHECK_VALID_PRINT_REC_MAX_LENGTH   1024
#define BTREE_DEBUG_DUMP_FULL   0x0002 /* full dump in insert or delete */

Definition at line 63 of file btree.c.

#define BTREE_DEBUG_DUMP_SIMPLE   0x0001 /* simple message in SMO */
#define BTREE_DEBUG_HEALTH_FULL   0x0020 /* full health check (traverse all slot in page) */

Definition at line 66 of file btree.c.

Referenced by btree_verify_node().

#define BTREE_DEBUG_HEALTH_SIMPLE   0x0010 /* simple health check in SMO */

Definition at line 65 of file btree.c.

#define BTREE_DEBUG_TEST_SPLIT   0x0100 /* full split test */

Definition at line 68 of file btree.c.

Referenced by btree_split_node(), and btree_split_root().

#define BTREE_DELETE_HELPER_AS_ARGS (   helper)
Value:
BTREE_OBJINFO_AS_ARGS (&(helper)->object_info), \
btree_purpose_to_string ((helper)->purpose), \
btree_op_type_to_string ((helper)->op_type), \
BTREE_PRINT_KEY_ARGS((helper)->printed_key), SHA1_AS_ARGS (&(helper)->printed_key_sha1), \
BTREE_MVCC_INFO_AS_ARGS (&(helper)->match_mvccinfo)
#define BTREE_OBJINFO_AS_ARGS(objinfo)
Definition: btree.c:1164
STATIC_INLINE const char * btree_purpose_to_string(BTREE_OP_PURPOSE purpose) __attribute__((ALWAYS_INLINE))
Definition: btree.c:33076
#define SHA1_AS_ARGS(sha1)
Definition: sha1.h:56
#define BTREE_PRINT_KEY_ARGS(key)
Definition: btree.c:1171
STATIC_INLINE const char * btree_op_type_to_string(int op_type) __attribute__((ALWAYS_INLINE))
Definition: btree.c:33129
#define BTREE_MVCC_INFO_AS_ARGS(mvcc_info)
Definition: btree.c:1158

Definition at line 1194 of file btree.c.

Referenced by btree_delete_internal(), btree_key_delete_remove_object(), btree_key_remove_insert_mvccid(), and btree_remove_delete_mvccid_unique_internal().

#define BTREE_DELETE_HELPER_MSG (   tabs)
Value:
tabs "DELETE HELPER: \n" \
tabs "\t" BTREE_OBJINFO_MSG("object_info") "\n" \
tabs "\t" "purpose = %s \n " \
tabs "\t" "op_type = %s \n" \
tabs "\t" BTREE_PRINT_KEY_MSG("printed_key") "... (sha1 = %08x | %08x | %08x | %08x | %08x) \n" \
tabs "\t" "match_mvccinfo = %llu|%llu \n"
#define BTREE_PRINT_KEY_MSG(key)
Definition: btree.c:1170
#define BTREE_OBJINFO_MSG(name)
Definition: btree.c:1162

Definition at line 1187 of file btree.c.

Referenced by btree_delete_internal(), btree_key_delete_remove_object(), btree_key_remove_insert_mvccid(), and btree_remove_delete_mvccid_unique_internal().

#define BTREE_DELETE_MODIFY_ARGS (   thread_p,
  helper,
  page,
  save_lsa,
  is_leaf,
  slotid,
  new_size,
  btid 
)
#define BTREE_FIND_FK_OBJECT_INITIALIZER   { OID_INITIALIZER }

Definition at line 700 of file btree.c.

Referenced by btree_find_foreign_key().

#define BTREE_FIND_UNIQUE_HELPER_INITIALIZER
Value:
{ OID_INITIALIZER, /* oid */ \
OID_INITIALIZER, /* match_class_oid */ \
NULL_LOCK, /* lock_mode */ \
NULL, /* snapshot */ \
false, /* found_object */ \
PERF_UTIME_TRACKER_INITIALIZER /* time_track */ \
}
#define OID_INITIALIZER
Definition: oid.h:36
#define NULL
Definition: freelistheap.h:34

Definition at line 472 of file btree.c.

Referenced by btree_key_lock_and_append_object_unique(), and xbtree_find_unique().

#define BTREE_GET_MVCC_INFO_SIZE_FROM_FLAGS (   mvcc_flags)
#define BTREE_GET_OID (   buf,
  oid_ptr 
)
Value:
do \
{ \
OR_GET_OID (buf, oid_ptr); \
} \
while (0)
#define BTREE_OID_CLEAR_MVCC_FLAGS(oid_ptr)
Definition: btree.c:128
#define OR_GET_OID(ptr, oid)
while(1)
Definition: cnvlex.c:816

Definition at line 242 of file btree.c.

Referenced by btree_compare_oid(), btree_find_oid_from_ovfl(), btree_insert_object_ordered_by_oid(), and btree_seq_find_oid_from_ovfl().

#define BTREE_HEALTH_CHECK

Definition at line 60 of file btree.c.

#define BTREE_INSERT_HELPER_AS_ARGS (   helper)
Value:
BTREE_OBJINFO_AS_ARGS (&(helper)->obj_info), \
btree_purpose_to_string ((helper)->purpose), \
btree_op_type_to_string ((helper)->op_type), \
BTREE_PRINT_KEY_ARGS((helper)->printed_key), SHA1_AS_ARGS (&(helper)->printed_key_sha1)
#define BTREE_OBJINFO_AS_ARGS(objinfo)
Definition: btree.c:1164
STATIC_INLINE const char * btree_purpose_to_string(BTREE_OP_PURPOSE purpose) __attribute__((ALWAYS_INLINE))
Definition: btree.c:33076
#define SHA1_AS_ARGS(sha1)
Definition: sha1.h:56
#define BTREE_PRINT_KEY_ARGS(key)
Definition: btree.c:1171
STATIC_INLINE const char * btree_op_type_to_string(int op_type) __attribute__((ALWAYS_INLINE))
Definition: btree.c:33129

Definition at line 1180 of file btree.c.

Referenced by btree_fix_root_for_insert(), and btree_insert_internal().

#define BTREE_INSERT_HELPER_MSG (   tabs)
Value:
tabs "INSERT HELPER: \n" \
tabs "\t" BTREE_OBJINFO_MSG("obj_info") "\n" \
tabs "\t" "purpose = %s \n" \
tabs "\t" "op_type = %s \n" \
tabs "\t" BTREE_PRINT_KEY_MSG("printed_key") "... (sha1 = %08x | %08x | %08x | %08x | %08x) \n"
#define BTREE_PRINT_KEY_MSG(key)
Definition: btree.c:1170
#define BTREE_OBJINFO_MSG(name)
Definition: btree.c:1162

Definition at line 1174 of file btree.c.

Referenced by btree_fix_root_for_insert(), and btree_insert_internal().

#define BTREE_INSERT_MODIFY_ARGS (   thread_p,
  helper,
  page,
  save_lsa,
  is_leaf,
  slotid,
  new_size,
  btid 
)
#define BTREE_INSERT_MODIFY_MSG (   desc)
#define BTREE_IS_PAGE_VALID_LEAF (   thread_p,
  page 
)
Value:
((page) != NULL \
&& pgbuf_get_page_ptype (thread_p, page) == PAGE_BTREE \
&& spage_get_slot (page, HEADER) != NULL \
&& (btree_get_node_header (thread_p, page))->node_level == 1)
#define HEADER
Definition: btree_load.h:100
BTREE_NODE_HEADER * btree_get_node_header(THREAD_ENTRY *thread_p, PAGE_PTR page_ptr)
Definition: btree_load.c:275
struct btree_node_header BTREE_NODE_HEADER
Definition: btree_load.h:193
SPAGE_SLOT * spage_get_slot(PAGE_PTR page_p, PGSLOTID slot_id)
PAGE_TYPE pgbuf_get_page_ptype(THREAD_ENTRY *thread_p, PAGE_PTR pgptr)
Definition: page_buffer.c:4675
unsigned int record_length
Definition: slotted_page.h:88
#define NULL
Definition: freelistheap.h:34

Definition at line 280 of file btree.c.

Referenced by btree_key_find_and_lock_unique_of_non_unique(), btree_range_scan_descending_fix_prev_leaf(), and btree_range_scan_resume().

#define BTREE_LEAF_RECORD_MASK   ((short) 0xF000)
#define btree_log (   prefix,
  msg,
  ... 
)
Value:
cubthread::entry * thread_get_thread_entry_info(void)
#define LOG_THREAD_TRAN_MSG
Definition: log_impl.h:796
#define LOG_THREAD_TRAN_ARGS(thread_p)
Definition: log_impl.h:797
void _er_log_debug(const char *file_name, const int line_no, const char *fmt,...)
#define ARG_FILE_LINE
Definition: error_manager.h:44

Definition at line 1146 of file btree.c.

#define btree_log_if_enabled (   ...)    if (prm_get_bool_value(PRM_ID_LOG_BTREE_OPS)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
#define BTREE_MAX_OID_COUNT   IO_MAX_PAGE_SIZE / OR_OID_SIZE

Definition at line 125 of file btree.c.

#define BTREE_MVCC_INFO_AS_ARGS (   mvcc_info)    (unsigned long long) BTREE_MVCC_INFO_INSID (mvcc_info), (unsigned long long) BTREE_MVCC_INFO_DELID (mvcc_info)

Definition at line 1158 of file btree.c.

Referenced by btree_leaf_record_replace_first_with_last().

#define BTREE_MVCC_INFO_CLEAR_DELID (   mvcc_info)    ((mvcc_info)->flags &= ~BTREE_OID_HAS_MVCC_DELID)

Definition at line 169 of file btree.c.

Referenced by btree_remove_delete_mvccid_unique_internal().

#define BTREE_MVCC_INFO_CLEAR_FIXED_SIZE (   mvcc_info)
Value:
do \
{ \
{ \
} \
{ \
} \
} \
while (false)
#define BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE(mvcc_info)
Definition: btree.c:173
#define BTREE_MVCC_INFO_IS_DELID_VALID(mvcc_info)
Definition: btree.c:177
#define BTREE_MVCC_INFO_CLEAR_INSID(mvcc_info)
Definition: btree.c:167
#define BTREE_MVCC_INFO_CLEAR_DELID(mvcc_info)
Definition: btree.c:169
if(extra_options)
Definition: dynamic_load.c:958
while(1)
Definition: cnvlex.c:816

Definition at line 207 of file btree.c.

Referenced by btree_remove_delete_mvccid_unique_internal().

#define BTREE_MVCC_INFO_CLEAR_INSID (   mvcc_info)    ((mvcc_info)->flags &= ~BTREE_OID_HAS_MVCC_INSID)

Definition at line 167 of file btree.c.

#define BTREE_MVCC_INFO_SET_DELID (   mvcc_info,
  delid 
)
Value:
do \
{ \
(mvcc_info)->delete_mvccid = delid; \
} \
while (false)
while(1)
Definition: cnvlex.c:816
#define BTREE_OID_HAS_MVCC_DELID
Definition: btree.c:117

Definition at line 231 of file btree.c.

Referenced by btree_delete_postponed(), btree_physical_delete(), btree_rv_keyval_undo_insert_mvcc_delid(), and btree_vacuum_object().

#define BTREE_MVCC_INFO_SET_FIXED_SIZE (   mvcc_info)
Value:
do \
{ \
{ \
(mvcc_info)->insert_mvccid = MVCCID_ALL_VISIBLE; \
} \
{ \
(mvcc_info)->delete_mvccid = MVCCID_NULL; \
} \
} \
while (false)
#define MVCCID_NULL
#define MVCCID_ALL_VISIBLE
#define BTREE_MVCC_INFO_HAS_DELID(mvcc_info)
Definition: btree.c:163
#define BTREE_MVCC_INFO_HAS_INSID(mvcc_info)
Definition: btree.c:161
if(extra_options)
Definition: dynamic_load.c:958
#define BTREE_OID_HAS_MVCC_INSID_AND_DELID
Definition: btree.c:121
while(1)
Definition: cnvlex.c:816

Definition at line 191 of file btree.c.

Referenced by btree_key_append_object_non_unique(), btree_key_append_object_to_overflow(), btree_key_append_object_unique(), btree_leaf_change_first_object(), btree_record_replace_object(), and btree_remove_delete_mvccid_unique_internal().

#define BTREE_MVCC_INFO_SET_INSID (   mvcc_info,
  insid 
)
Value:
do \
{ \
(mvcc_info)->insert_mvccid = insid; \
} \
while (false)
#define BTREE_OID_HAS_MVCC_INSID
Definition: btree.c:115
while(1)
Definition: cnvlex.c:816

Definition at line 222 of file btree.c.

Referenced by btree_key_find_and_insert_delete_mvccid(), btree_rv_keyval_undo_insert_mvcc_delid(), btree_undo_insert_object(), btree_undo_insert_object_unique_multiupd(), and btree_vacuum_insert_mvccid().

#define BTREE_NODE_MAX_SPLIT_SIZE (   thread_p,
  page_ptr 
)    (db_page_size() - spage_header_size() - spage_get_space_for_record(thread_p, (page_ptr), HEADER))

Definition at line 79 of file btree.c.

Referenced by btree_find_split_point().

#define BTREE_OBJINFO_AS_ARGS (   objinfo)
Value:
OID_AS_ARGS (&((objinfo)->oid)), \
OID_AS_ARGS (&((objinfo)->class_oid)), \
#define OID_AS_ARGS(oidp)
Definition: oid.h:39
#define BTREE_MVCC_INFO_AS_ARGS(mvcc_info)
Definition: btree.c:1158

Definition at line 1164 of file btree.c.

Referenced by btree_key_append_object_unique(), btree_key_relocate_last_into_ovf(), btree_key_remove_object_and_keep_visible_first(), btree_remove_delete_mvccid_unique_internal(), and btree_replace_first_oid_with_ovfl_oid().

#define BTREE_OID_CLEAR_ALL_FLAGS (   oid_ptr)
Value:
do \
{ \
} \
while (0)
#define BTREE_OID_CLEAR_RECORD_FLAGS(oid_ptr)
Definition: btree.c:131
#define BTREE_OID_CLEAR_MVCC_FLAGS(oid_ptr)
Definition: btree.c:128
while(1)
Definition: cnvlex.c:816

Definition at line 134 of file btree.c.

Referenced by btree_check_valid_record(), btree_key_find_first_visible_row(), btree_or_get_object(), btree_rv_keyval_dump(), btree_rv_read_keybuf_nocopy(), and btree_rv_read_keybuf_two_objects().

#define BTREE_OID_CLEAR_MVCC_FLAGS (   oid_ptr)    ((oid_ptr)->volid &= ~BTREE_OID_MVCC_FLAGS_MASK)

Definition at line 128 of file btree.c.

Referenced by btree_dump_leaf_record().

#define BTREE_OID_CLEAR_RECORD_FLAGS (   oid_ptr)    ((oid_ptr)->slotid &= ~BTREE_LEAF_RECORD_MASK)

Definition at line 131 of file btree.c.

Referenced by btree_compare_oid().

#define BTREE_OID_GET_MVCC_FLAGS (   oid_ptr)    ((oid_ptr)->volid & BTREE_OID_MVCC_FLAGS_MASK)
#define BTREE_OID_GET_RECORD_FLAGS (   oid_ptr)    ((oid_ptr)->slotid & BTREE_LEAF_RECORD_MASK)

Definition at line 157 of file btree.c.

#define BTREE_OID_IS_MVCC_FLAG_SET (   oid_ptr,
  mvcc_flag 
)    (((oid_ptr)->volid & (mvcc_flag)) == (mvcc_flag))
#define BTREE_OID_IS_RECORD_FLAG_SET (   oid_ptr,
  mvcc_flag 
)    (((oid_ptr)->slotid & (mvcc_flag)) == (mvcc_flag))
#define BTREE_OID_SET_MVCC_FLAG (   oid_ptr,
  mvcc_flag 
)    ((oid_ptr)->volid |= (mvcc_flag))
#define BTREE_OID_SET_RECORD_FLAG (   oid_ptr,
  mvcc_flag 
)    ((oid_ptr)->slotid |= (mvcc_flag))
#define BTREE_PRINT_KEY_ARGS (   key)    (key) != NULL ? (key) : "** UNKNOWN KEY **"

Definition at line 1171 of file btree.c.

#define BTREE_PRINT_KEY_MSG (   key)    key " = %.32s"

Definition at line 1170 of file btree.c.

#define BTREE_REC_SATISFIES_SNAPSHOT_HELPER_INITIALIZER
Value:
{ NULL /* snapshot */, OID_INITIALIZER /* match_class_oid */, \
NULL /* oid_ptr */, 0 /* oid_cnt */, 0 /* oid_capacity */ }
#define OID_INITIALIZER
Definition: oid.h:36
#define NULL
Definition: freelistheap.h:34

Definition at line 495 of file btree.c.

Referenced by btree_key_find_unique_version_oid().

#define BTREE_RECORD_OR_BUF_INIT (   buf,
  btree_rec 
)
Value:
do \
{ \
int size = (btree_rec)->length; \
{ \
} \
OR_BUF_INIT (buf, (btree_rec)->data, size); \
} \
while (false)
#define DISK_VPID_SIZE
#define OR_BUF_INIT(buf, data, size)
static bool btree_leaf_is_flaged(RECDES *recp, short record_flag)
Definition: btree.c:3408
if(extra_options)
Definition: dynamic_load.c:958
#define BTREE_MAX_ALIGN
Definition: btree_load.h:66
#define DB_ALIGN(offset, align)
Definition: memory_alloc.h:84
#define BTREE_LEAF_RECORD_OVERFLOW_OIDS
Definition: btree.c:106
while(1)
Definition: cnvlex.c:816

Definition at line 251 of file btree.c.

Referenced by btree_find_oid_from_leaf(), btree_key_find_and_lock_unique_of_non_unique(), btree_leaf_get_first_object(), btree_leaf_get_nth_oid_ptr(), btree_record_get_last_object(), btree_record_get_num_oids(), btree_record_process_objects(), and btree_unpack_object().

#define BTREE_RV_DEBUG_INFO_FLAG   0x1000

Definition at line 1003 of file btree.c.

#define BTREE_RV_DEBUG_INFO_MAX_SIZE
Value:
(OR_INT_SIZE /* Debug ID. */ \
+ OR_INT_SIZE /* unique_pk */ \
+ OR_OID_SIZE /* topclass_oid */ \
+ BTID_DOMAIN_CHECK_MAX_SIZE /* key_type. */)
#define BTID_DOMAIN_CHECK_MAX_SIZE
Definition: btree.c:329

Definition at line 1071 of file btree.c.

#define BTREE_RV_EXCLUSIVE_FLAGS_MASK   0x3C00

Definition at line 1005 of file btree.c.

#define BTREE_RV_FLAGS_MASK   (LOG_RV_RECORD_MODIFY_MASK | BTREE_RV_EXCLUSIVE_FLAGS_MASK)

Definition at line 1014 of file btree.c.

Referenced by btree_rv_record_modify_internal().

#define BTREE_RV_HAS_DEBUG_INFO (   flags)    ((flags & BTREE_RV_DEBUG_INFO_FLAG) != 0)

Definition at line 1082 of file btree.c.

Referenced by btree_delete_key_from_leaf(), and btree_rv_record_modify_internal().

#define BTREE_RV_IS_OVERFLOW_NODE (   flags)    ((flags & BTREE_RV_OVERFLOW_FLAG) != 0)

Definition at line 1079 of file btree.c.

#define BTREE_RV_IS_UNDO_MVCCDEL_MYOBJ (   flags)    ((flags & BTREE_RV_UNDO_MVCCDEL_MYOBJ) != 0)

Definition at line 1098 of file btree.c.

Referenced by btree_rv_keyval_undo_insert_mvcc_delid().

#define BTREE_RV_IS_UPDATE_MAX_KEY_LEN (   flags)    ((flags & BTREE_RV_UPDATE_MAX_KEY_LEN) != 0)

Definition at line 1090 of file btree.c.

Referenced by btree_rv_record_modify_internal().

#define BTREE_RV_OVERFLOW_FLAG   0x2000

Definition at line 1001 of file btree.c.

Referenced by btree_rv_record_modify_internal().

#define BTREE_RV_REDO_SET_DEBUG_INFO (   addr,
  rv_ptr,
  btid_int,
  id 
)
Value:
do \
{ \
assert ((addr) != NULL); \
assert ((rv_ptr) != NULL); \
assert (!BTREE_RV_HAS_DEBUG_INFO ((addr)->offset)); \
{ \
/* Too much space required. Give up packing debug info. */ \
break; \
} \
/* Put debug ID. */ \
OR_PUT_INT (rv_ptr, id); \
(rv_ptr) += OR_INT_SIZE; \
/* Put unique_pk */ \
OR_PUT_INT (rv_ptr, (btid_int)->unique_pk); \
(rv_ptr) += OR_INT_SIZE; \
if (BTREE_IS_UNIQUE ((btid_int)->unique_pk)) \
{ \
/* Put topclass_oid. */ \
OR_PUT_OID (rv_ptr, &(btid_int)->topclass_oid); \
(rv_ptr) += OR_OID_SIZE; \
} \
/* Put key type. */ \
(rv_ptr) = or_pack_domain (rv_ptr, btid_int->key_type, 0, 0); \
(rv_ptr) = PTR_ALIGN (rv_ptr, INT_ALIGNMENT); \
(addr)->offset |= BTREE_RV_DEBUG_INFO_FLAG; \
} \
while (false)
#define OR_PUT_OID(ptr, oid)
#define BTREE_RV_HAS_DEBUG_INFO(flags)
Definition: btree.c:1082
#define BTREE_IS_UNIQUE(unique_pk)
Definition: btree.h:89
#define PTR_ALIGN(addr, boundary)
Definition: memory_alloc.h:77
int or_packed_domain_size(struct tp_domain *domain, int include_classoids)
#define assert(x)
#define BTID_DOMAIN_CHECK_MAX_SIZE
Definition: btree.c:329
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
char * or_pack_domain(char *ptr, struct tp_domain *domain, int include_classoids, int is_null)
#define INT_ALIGNMENT
Definition: memory_alloc.h:61
#define OR_PUT_INT(ptr, val)
while(1)
Definition: cnvlex.c:816
#define BTREE_RV_DEBUG_INFO_FLAG
Definition: btree.c:1003
TP_DOMAIN * key_type
Definition: btree.h:124

Definition at line 1023 of file btree.c.

Referenced by btree_insert_mvcc_delid_into_page(), btree_key_append_object_non_unique(), btree_key_append_object_unique(), btree_key_insert_new_key(), btree_key_remove_delete_mvccid_non_unique(), btree_key_remove_insert_mvccid(), btree_key_remove_object_and_keep_visible_first(), and btree_start_overflow_page().

#define BTREE_RV_SET_UNDO_MVCCDEL_MYOBJ (   addr)    ((addr)->offset |= BTREE_RV_UNDO_MVCCDEL_MYOBJ)

Definition at line 1096 of file btree.c.

Referenced by btree_insert_mvcc_delid_into_page().

#define BTREE_RV_SET_UPDATE_MAX_KEY_LEN (   addr)    ((addr)->offset |= BTREE_RV_UPDATE_MAX_KEY_LEN)

Definition at line 1088 of file btree.c.

Referenced by btree_key_insert_new_key().

#define BTREE_RV_UNDO_MVCCDEL_MYOBJ   0x0800

Definition at line 1095 of file btree.c.

#define BTREE_RV_UNDOREDO_SET_DEBUG_INFO (   addr,
  rv_redo_ptr,
  rv_undo_ptr,
  btid_int,
  id 
)
Value:
do \
{ \
char *save_rv_redo_ptr = (rv_redo_ptr); \
BTREE_RV_REDO_SET_DEBUG_INFO (addr, rv_redo_ptr, btid_int, id); \
if ((rv_undo_ptr) != NULL) \
{ \
memcpy (rv_undo_ptr, save_rv_redo_ptr, CAST_BUFLEN ((rv_redo_ptr) - save_rv_redo_ptr)); \
(rv_undo_ptr) += CAST_BUFLEN ((rv_redo_ptr) - save_rv_redo_ptr); \
} \
} \
while (false)
#define BTREE_RV_REDO_SET_DEBUG_INFO(addr, rv_ptr, btid_int, id)
Definition: btree.c:1023
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
#define CAST_BUFLEN
Definition: porting.h:471
while(1)
Definition: cnvlex.c:816

Definition at line 1057 of file btree.c.

Referenced by btree_key_append_object_as_new_overflow(), btree_key_append_object_to_overflow(), btree_key_relocate_last_into_ovf(), btree_key_remove_delete_mvccid_unique(), btree_key_remove_object_and_keep_visible_first(), btree_leaf_record_replace_first_with_last(), btree_modify_leaf_ovfl_vpid(), btree_overflow_record_replace_object(), btree_record_remove_object(), and btree_replace_first_oid_with_ovfl_oid().

#define BTREE_RV_UPDATE_MAX_KEY_LEN   0x0800

Definition at line 1087 of file btree.c.

#define BTREE_SPLIT_DEFAULT_PIVOT   0.5f

Definition at line 76 of file btree.c.

Referenced by btree_write_default_split_info().

#define BTREE_SPLIT_LOWER_BOUND   0.20f

Definition at line 70 of file btree.c.

Referenced by btree_split_find_pivot().

#define BTREE_SPLIT_MAX_PIVOT   (1.0f - BTREE_SPLIT_MIN_PIVOT)

Definition at line 74 of file btree.c.

Referenced by btree_split_find_pivot().

#define BTREE_SPLIT_MIN_PIVOT   0.05f

Definition at line 73 of file btree.c.

Referenced by btree_split_find_pivot().

#define BTREE_SPLIT_UPPER_BOUND   (1.0f - BTREE_SPLIT_LOWER_BOUND)

Definition at line 71 of file btree.c.

Referenced by btree_split_find_pivot().

#define BTS_INCREMENT_READ_OIDS (   bts)
Value:
do \
{ \
(bts)->n_oids_read++; \
(bts)->n_oids_read_last_iteration++; \
} \
while (false)
while(1)
Definition: cnvlex.c:816

Definition at line 614 of file btree.c.

Referenced by btree_select_visible_object_for_range_scan().

#define BTS_IS_HARD_CAPACITY_ENOUGH (   bts,
  count 
)
Value:
? /* Covering index: no hard limit. */ true \
: /* Normal scan: use buffer capacity as hard limit. */ (count) <= (bts)->index_scan_idp->oid_list->capacity)
#define BTS_IS_INDEX_COVERED(bts)
Definition: btree.c:598
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)

Definition at line 639 of file btree.c.

Referenced by btree_range_scan_select_visible_oids().

#define BTS_IS_INDEX_COVERED (   bts)    ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_COVERED ((bts)->index_scan_idp))
#define BTS_IS_INDEX_ILS (   bts)
Value:
((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_ILS ((bts)->index_scan_idp) \
#define BTS_IS_INDEX_COVERED(bts)
Definition: btree.c:598
#define NULL
Definition: freelistheap.h:34
#define SCAN_IS_INDEX_ILS(iscan_id_p)
Definition: scan_manager.h:373

Definition at line 607 of file btree.c.

Referenced by btree_range_scan(), btree_range_scan_resume(), and btree_select_visible_object_for_range_scan().

#define BTS_IS_INDEX_ISS (   bts)    ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_ISS ((bts)->index_scan_idp))
#define BTS_IS_INDEX_MRO (   bts)    ((bts) != NULL && (bts)->index_scan_idp != NULL && SCAN_IS_INDEX_MRO ((bts)->index_scan_idp))
#define BTS_IS_SOFT_CAPACITY_ENOUGH (   bts,
  count 
)
Value:
? /* Covering index: use max tuples as soft limit. */ (bts)->index_scan_idp->indx_cov.max_tuples \
: /* Normal scan: use max_oid_cnt as soft limit. */ (bts)->index_scan_idp->oid_list->max_oid_cnt))
#define BTS_IS_INDEX_COVERED(bts)
Definition: btree.c:598
int count(int &result, const cub_regex_object &reg, const std::string &src, const int position, const INTL_CODESET codeset)

Definition at line 625 of file btree.c.

Referenced by btree_range_scan_select_visible_oids().

#define BTS_NEED_COUNT_ONLY (   bts)    ((bts) != NULL && (bts)->index_scan_idp != NULL && (bts)->index_scan_idp->need_count_only)
#define BTS_SAVE_OID_IN_BUFFER (   bts,
  oid 
)
Value:
do \
{ \
/* Assert this is not used in an inappropriate context. */ \
assert (!BTS_IS_INDEX_ISS (bts) || bts->index_scan_idp->iss.current_op == ISS_OP_DO_RANGE_SEARCH); \
COPY_OID ((bts)->oid_ptr, oid); \
(bts)->oid_ptr++; \
assert ((bts)->n_oids_read_last_iteration <= (bts)->index_scan_idp->oid_list->capacity); \
assert (((bts)->oid_ptr - (bts)->index_scan_idp->oid_list->oidp) <= (bts)->index_scan_idp->oid_list->capacity); \
/* Should we also increment (bts)->index_scan_idp->oid_list.oid_cnt? */ \
} \
while (false)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
Definition: oid.h:63
#define assert(x)
#define BTS_IS_INDEX_COVERED(bts)
Definition: btree.c:598
#define BTS_IS_INDEX_ISS(bts)
Definition: btree.c:604
#define BTS_INCREMENT_READ_OIDS(bts)
Definition: btree.c:614
while(1)
Definition: cnvlex.c:816
#define BTS_IS_INDEX_MRO(bts)
Definition: btree.c:601

Definition at line 649 of file btree.c.

Referenced by btree_select_visible_object_for_range_scan().

#define CAN_MERGE_WHEN_EMPTY   (MAX (DB_PAGESIZE * 0.33, MAX_MERGE_ALIGN_WASTE * 1.3))

Definition at line 92 of file btree.c.

Referenced by btree_merge_node_and_advance(), and btree_node_mergeable().

#define DISK_PAGE_BITS   (DB_PAGESIZE * CHAR_BIT) /* Num of bits per page */

Definition at line 77 of file btree.c.

#define FORCE_MERGE_WHEN_EMPTY   (MAX (DB_PAGESIZE * 0.66, MAX_MERGE_ALIGN_WASTE * 1.3))

Definition at line 95 of file btree.c.

Referenced by btree_merge_node_and_advance(), and btree_node_mergeable().

#define LOFFS1   0 /* Key Len Offset */

Definition at line 337 of file btree.c.

Referenced by btree_rv_write_log_record_for_key_insert().

#define LOFFS2   2 /* Node Type Offset: Leaf/NonLeaf Information */

Definition at line 338 of file btree.c.

Referenced by btree_rv_write_log_record_for_key_insert().

#define LOFFS3   4 /* RECDES Type Offset */

Definition at line 339 of file btree.c.

Referenced by btree_rv_write_log_record_for_key_insert().

#define LOFFS4   6 /* RECDES Data Offset */

Definition at line 340 of file btree.c.

Referenced by btree_rv_write_log_record_for_key_insert().

#define MAX_LEAF_REC_NUM   (IO_MAX_PAGE_SIZE / MIN_LEAF_REC_SIZE)

Definition at line 86 of file btree.c.

Referenced by btree_merge_node().

#define MAX_MERGE_ALIGN_WASTE   ((DB_PAGESIZE/MIN_LEAF_REC_SIZE) * (BTREE_MAX_ALIGN - 1))

Definition at line 88 of file btree.c.

Referenced by btree_merge_node().

#define MIGRATE_90BETA_TO_91

Definition at line 19230 of file btree.c.

#define MIN_KEY_SIZE   DB_ALIGN (1, BTREE_MAX_ALIGN)

Definition at line 84 of file btree.c.

#define MIN_LEAF_REC_SIZE   (OR_OID_SIZE + MIN_KEY_SIZE)

Definition at line 85 of file btree.c.

#define NEXT_MERGE_RECORD ( )
Value:
do \
{ \
/* If not first record, add last record length to merge_idx. */ \
merge_idx += (rec_idx >= 0) ? rec[rec_idx].length : 0; \
/* Increment record index. */ \
rec_idx++; \
/* Set aligned record data pointer. */ \
rec[rec_idx].data = \
PTR_ALIGN (&merge_buf_ptr[merge_idx], BTREE_MAX_ALIGN); \
/* Update merge_idx. */ \
merge_idx = CAST_BUFLEN (rec[rec_idx].data - merge_buf_ptr); \
/* Set area size. */ \
rec[rec_idx].area_size = merge_buf_size - merge_idx; \
rec[rec_idx].type = REC_HOME; \
} \
while (false)
#define PTR_ALIGN(addr, boundary)
Definition: memory_alloc.h:77
#define CAST_BUFLEN
Definition: porting.h:471
#define BTREE_MAX_ALIGN
Definition: btree_load.h:66
while(1)
Definition: cnvlex.c:816

Referenced by btree_merge_node().

#define OFFS1   0 /* Node Type Offset: Leaf/NonLeaf Information */

Definition at line 332 of file btree.c.

Referenced by btree_rv_noderec_dump(), and btree_rv_write_log_record().

#define OFFS2   2 /* RECDES Type Offset */
#define OFFS3   4 /* RECDES Data Offset */
#define OID_MSG_BUF_SIZE   64

Definition at line 82 of file btree.c.

Referenced by btree_set_error().

#define RECINS_STRUCT_INITIALIZER   { OID_INITIALIZER, OID_INITIALIZER, VPID_INITIALIZER, 0 }

Definition at line 325 of file btree.c.

Typedef Documentation

typedef int BTREE_ADVANCE_WITH_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *crt_page, PAGE_PTR *advance_to_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)

Definition at line 551 of file btree.c.

Definition at line 812 of file btree.c.

Definition at line 686 of file btree.c.

Definition at line 443 of file btree.c.

typedef struct btree_helper BTREE_HELPER

Definition at line 1243 of file btree.c.

Definition at line 708 of file btree.c.

typedef int BTREE_PROCESS_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *leaf_page, BTREE_SEARCH_KEY_HELPER *search_key, bool *restart, void *other_args)

Definition at line 578 of file btree.c.

typedef int BTREE_PROCESS_OBJECT_FUNCTION(THREAD_ENTRY *thread_p, BTID_INT *btid_int, RECDES *record, char *object_ptr, OID *oid, OID *class_oid, BTREE_MVCC_INFO *mvcc_info, bool *stop, void *args)

Definition at line 592 of file btree.c.

Definition at line 355 of file btree.c.

typedef int BTREE_ROOT_WITH_KEY_FUNCTION(THREAD_ENTRY *thread_p, BTID *btid, BTID_INT *btid_int, DB_VALUE *key, PAGE_PTR *root_page, bool *is_leaf, BTREE_SEARCH_KEY_HELPER *search_key, bool *stop, bool *restart, void *other_args)

Definition at line 524 of file btree.c.

Definition at line 1141 of file btree.c.

Definition at line 414 of file btree.c.

Definition at line 343 of file btree.c.

typedef struct recins_struct RECINS_STRUCT

Definition at line 315 of file btree.c.

typedef struct recset_header RECSET_HEADER

Definition at line 287 of file btree.c.

Definition at line 400 of file btree.c.

Enumeration Type Documentation

Enumerator
BTREE_BOUNDARY_FIRST 
BTREE_BOUNDARY_LAST 

Definition at line 300 of file btree.c.

Enumerator
BTREE_MERGE_NO 
BTREE_MERGE_TRY 
BTREE_MERGE_FORCE 

Definition at line 306 of file btree.c.

Enumerator
BTREE_RV_REDO_NO_ID 
BTREE_RV_DEBUG_ID_INSERT_DELID 
BTREE_RV_DEBUG_ID_START_OVF 
BTREE_RV_DEBUG_ID_INS_NEW_OVF 
BTREE_RV_DEBUG_ID_INS_OLD_OVF 
BTREE_RV_DEBUG_ID_UNIQUE 
BTREE_RV_DEBUG_ID_NON_UNIQUE 
BTREE_RV_DEBUG_ID_REM_INSID 
BTREE_RV_DEBUG_ID_REM_DELID_UNIQUE 
BTREE_RV_DEBUG_ID_REM_DELID_NON_UNIQUE 
BTREE_RV_DEBUG_ID_OVF_REPLACE 
BTREE_RV_DEBUG_ID_SWAP_LEAF 
BTREE_RV_DEBUG_ID_OVF_LINK 
BTREE_RV_DEBUG_ID_LAST_OID 
BTREE_RV_DEBUG_ID_REM_OBJ 
BTREE_RV_DEBUG_ID_INS_KEY 
BTREE_RV_DEBUG_ID_UNDO_INS_UNQ_MUPD 
BTREE_RV_DEBUG_ID_INS_REM_LEAF_LAST 

Definition at line 1120 of file btree.c.

Enumerator
LEAF_RECORD_REGULAR 
LEAF_RECORD_OVERFLOW 

Definition at line 294 of file btree.c.

Function Documentation

STATIC_INLINE void btree_add_mvccid ( RECDES rec,
int  oid_offset,
int  mvccid_offset,
MVCCID  mvccid,
short  flag,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
static int btree_advance_and_find_key ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR crt_page,
PAGE_PTR advance_to_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static
static void btree_append_oid ( RECDES rec,
OID oid 
)
static

Definition at line 3613 of file btree.c.

References recdes::data, recdes::length, OR_OID_SIZE, OR_PUT_OID, and STATIC_INLINE.

int btree_attrinfo_read_dbvalues ( THREAD_ENTRY thread_p,
DB_VALUE curr_key,
int *  btree_att_ids,
int  btree_num_att,
HEAP_CACHE_ATTRINFO attr_info,
int  func_index_col_id 
)
static bool btree_check_locking_for_delete_unique ( THREAD_ENTRY thread_p,
const BTREE_DELETE_HELPER delete_helper 
)
static

Definition at line 35424 of file btree.c.

References BTREE_DELETE_CLASS_OID, BTREE_DELETE_OID, BU_LOCK, lock_has_lock_on_object(), LOG_FIND_CURRENT_TDES(), LOG_ISTRAN_ABORTED, oid_Root_class_oid, and X_LOCK.

Referenced by btree_key_delete_remove_object().

Here is the caller graph for this function:

static bool btree_check_locking_for_insert_unique ( THREAD_ENTRY thread_p,
const BTREE_INSERT_HELPER insert_helper 
)
static

Definition at line 35394 of file btree.c.

References BTREE_INSERT_CLASS_OID, BTREE_INSERT_OID, BU_LOCK, lock_has_lock_on_object(), oid_Root_class_oid, and X_LOCK.

Referenced by btree_key_insert_new_key(), and btree_key_lock_and_append_object_unique().

Here is the caller graph for this function:

int btree_check_valid_record ( THREAD_ENTRY thread_p,
BTID_INT btid,
RECDES recp,
BTREE_NODE_TYPE  node_type,
DB_VALUE key 
)

Definition at line 21828 of file btree.c.

References assert, btree_compare_key(), btree_is_class_oid_packed(), BTREE_IS_UNIQUE, btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_OVERFLOW_KEY, BTREE_LEAF_RECORD_OVERFLOW_OIDS, BTREE_OID_CLEAR_ALL_FLAGS, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_ONLINE_INDEX_MVCCID_MASK, BTREE_OVERFLOW_NODE, btree_record_object_get_mvcc_flags(), recdes::data, db_make_null(), DB_PAGESIZE, DISK_INVALID, DISK_VPID_ALIGNED_SIZE, DISK_VPID_SIZE, or_buf::endptr, ER_FAILED, log_global::hdr, pr_type::index_readval(), btid_int::key_type, recdes::length, log_Gl, log_is_in_crash_recovery(), MVCC_ID_PRECEDES, log_header::mvcc_next_id, MVCCID_IS_VALID, MVCCID_NULL, NO_ERROR, NULL, or_get_mvccid(), or_get_oid(), OR_GET_VPID, or_init(), OR_INT_SIZE, db_identifier::pageid, pgbuf_is_valid_page(), pr_clear_value(), or_buf::ptr, PTR_ALIGN, db_identifier::slotid, tp_domain::type, btid_int::unique_pk, db_identifier::volid, and VPID_INITIALIZER.

Referenced by btree_compress_node(), btree_construct_leafs(), btree_insert_object_ordered_by_oid(), btree_key_find_and_insert_delete_mvccid(), btree_key_insert_new_key(), btree_key_insert_new_object(), btree_key_lock_and_append_object_unique(), btree_key_remove_delete_mvccid(), btree_key_remove_insert_mvccid(), btree_leaf_change_first_object(), btree_leaf_record_change_overflow_link(), btree_leaf_record_handle_first_overflow(), btree_leaf_remove_object(), btree_online_index_change_state(), btree_overflow_remove_object(), btree_record_add_delid(), btree_record_append_object(), btree_record_remove_delid(), btree_record_remove_insid(), btree_record_remove_last_object(), btree_record_remove_object_internal(), btree_record_replace_object(), btree_remove_delete_mvccid_unique_internal(), btree_replace_first_oid_with_ovfl_oid(), btree_rv_record_modify_internal(), and btree_start_overflow_page().

void btree_clear_mvcc_flags_from_oid ( OID oid)

Definition at line 21763 of file btree.c.

References BTREE_OID_MVCC_FLAGS_MASK, and db_identifier::volid.

Referenced by btree_construct_leafs().

Here is the caller graph for this function:

int btree_compare_btids ( void *  mem_btid1,
void *  mem_btid2 
)

Definition at line 21777 of file btree.c.

References vfid::fileid, btid::root_pageid, btid::vfid, and vfid::volid.

Referenced by logtb_initialize_global_unique_stats_table().

Here is the caller graph for this function:

static int btree_compare_individual_key_value ( DB_VALUE key1,
DB_VALUE key2,
TP_DOMAIN key_domain 
)
static
static int btree_compare_oid ( const void *  oid_mem1,
const void *  oid_mem2 
)
static

Definition at line 19458 of file btree.c.

References BTREE_GET_OID, BTREE_OID_CLEAR_RECORD_FLAGS, and oid_compare().

Referenced by btree_fix_ovfl_oid_page().

Here is the caller graph for this function:

STATIC_INLINE int btree_count_oids ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
char *  object_ptr,
OID oid,
OID class_oid,
MVCC_REC_HEADER mvcc_header,
bool stop,
void *  args 
)

Definition at line 24158 of file btree.c.

References assert, NO_ERROR, and NULL.

static int btree_delete_internal ( THREAD_ENTRY thread_p,
BTID btid,
OID oid,
OID class_oid,
BTREE_MVCC_INFO mvcc_info,
DB_VALUE key,
OR_BUF buffered_key,
int *  unique,
int  op_type,
btree_unique_stats unique_stat_info,
BTREE_MVCC_INFO match_mvccinfo,
LOG_LSA undo_nxlsa,
BTREE_OBJECT_INFO second_obj_info,
BTREE_OP_PURPOSE  purpose 
)
static

Definition at line 29616 of file btree.c.

References assert, ASSERT_ERROR, assert_release, BTID_AS_ARGS, BTREE_DELETE_CLASS_OID, BTREE_DELETE_HELPER_AS_ARGS, BTREE_DELETE_HELPER_MSG, btree_delete_log, BTREE_DELETE_MVCC_INFO, BTREE_DELETE_OID, btree_fix_root_for_delete(), BTREE_ID_MSG, BTREE_INVALID_INDEX_ID, BTREE_IS_UNIQUE, btree_key_delete_remove_object(), btree_key_remove_delete_mvccid(), btree_key_remove_insert_mvccid(), btree_key_remove_object_and_keep_visible_first(), btree_merge_node_and_advance(), BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_DELETE_OBJECT_PHYSICAL_POSTPONED, BTREE_OP_DELETE_UNDO_INSERT, BTREE_OP_DELETE_UNDO_INSERT_DELID, BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OP_DELETE_VACUUM_INSID, BTREE_OP_DELETE_VACUUM_OBJECT, btree_search_key_and_apply_functions(), btree_delete_helper::buffered_key, btree_delete_helper::check_key_deleted, COPY_OID, db_make_null(), db_private_free, btree_unique_stats::delete_row(), ER_FAILED, FI_RESET, FI_SET, FI_TEST_BTREE_MANAGER_PAGE_DEALLOC_FAIL, btree_unique_stats::insert_key_and_row(), btree_delete_helper::is_key_deleted, btree_delete_helper::log_operations, logtb_set_check_interrupt(), LSA_COPY(), btree_delete_helper::match_mvccinfo, MULTI_ROW_DELETE, MULTI_ROW_UPDATE, NO_ERROR, NULL, btree_delete_helper::op_type, perfmon_inc_stat(), pr_clear_value(), btree_delete_helper::printed_key, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, PSTAT_BT_NUM_DELETES, btree_delete_helper::purpose, btree_delete_helper::reference_lsa, btree_delete_helper::second_object_info, SINGLE_ROW_DELETE, SINGLE_ROW_MODIFY, SINGLE_ROW_UPDATE, btree_delete_helper::time_track, btid_int::unique_pk, and btree_delete_helper::unique_stats_info.

Referenced by btree_delete_postponed(), btree_physical_delete(), btree_undo_insert_object(), btree_undo_insert_object_unique_multiupd(), btree_undo_mvcc_delete(), btree_vacuum_insert_mvccid(), and btree_vacuum_object().

Here is the caller graph for this function:

void btree_dump_key ( FILE *  fp,
const DB_VALUE key 
)

Definition at line 4615 of file btree.c.

References db_fprint_value().

Referenced by btree_construct_leafs(), btree_dump_leaf_record(), and btree_dump_non_leaf_record().

Here is the caller graph for this function:

static void btree_dump_non_leaf_record ( THREAD_ENTRY thread_p,
FILE *  fp,
BTID_INT btid,
RECDES rec,
int  n,
int  print_key 
)
static
static void btree_dump_page_with_subtree ( THREAD_ENTRY thread_p,
FILE *  fp,
BTID_INT btid,
PAGE_PTR  pg_ptr,
VPID pg_vpid,
int  depth,
int  level 
)
static
static int btree_find_free_overflow_oids_page ( THREAD_ENTRY thread_p,
BTID_INT btid,
VPID first_ovfl_vpid,
PAGE_PTR overflow_page 
)
static
static DISK_ISVALID btree_find_key_from_leaf ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  pg_ptr,
int  key_cnt,
OID oid,
DB_VALUE key,
bool clear_key 
)
static
static DISK_ISVALID btree_find_key_from_nleaf ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  pg_ptr,
int  key_cnt,
OID oid,
DB_VALUE key,
bool clear_key 
)
static
static DISK_ISVALID btree_find_key_from_page ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  pg_ptr,
OID oid,
DB_VALUE key,
bool clear_key 
)
static
static PAGE_PTR btree_find_leftmost_leaf ( THREAD_ENTRY thread_p,
BTID btid,
VPID pg_vpid,
BTREE_STATS stat_info_p 
)
static

Definition at line 14311 of file btree.c.

References BTREE_BOUNDARY_FIRST, and btree_find_boundary_leaf().

Referenced by btree_find_lower_bound_leaf(), and btree_fix_ovfl_oid_pages_tree().

Here is the caller graph for this function:

static int btree_find_next_index_record ( THREAD_ENTRY thread_p,
BTREE_SCAN bts 
)
static
static int btree_find_oid_from_leaf ( THREAD_ENTRY thread_p,
BTID_INT btid,
RECDES leaf_record,
int  after_key_offset,
OID oid,
BTREE_MVCC_INFO match_mvccinfo,
BTREE_OP_PURPOSE  purpose,
int *  offset_to_object,
BTREE_MVCC_INFO mvcc_info 
)
static
static int btree_find_oid_with_page_and_record ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
OID oid,
PAGE_PTR  leaf_page,
BTREE_OP_PURPOSE  purpose,
BTREE_MVCC_INFO match_mvccinfo,
RECDES record,
LEAF_REC leaf_info,
int  offset_after_key,
PAGE_PTR found_page,
PAGE_PTR prev_page,
int *  offset_to_object,
BTREE_MVCC_INFO object_mvcc_info,
RECDES new_record 
)
static
static PAGE_PTR btree_find_rightmost_leaf ( THREAD_ENTRY thread_p,
BTID btid,
VPID pg_vpid,
BTREE_STATS stat_info_p 
)
static

Definition at line 14326 of file btree.c.

References BTREE_BOUNDARY_LAST, and btree_find_boundary_leaf().

Referenced by btree_find_lower_bound_leaf().

Here is the caller graph for this function:

static int btree_fix_root_for_delete ( THREAD_ENTRY thread_p,
BTID btid,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR root_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static

Definition at line 29778 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, BTREE_DELETE_CLASS_OID, btree_fix_root_with_info(), btree_is_delete_data_purpose(), btree_is_delete_object_purpose(), BTREE_IS_MULTI_ROW_OP, btree_is_online_index_loading(), BTREE_IS_UNIQUE, btree_multicol_key_is_null(), BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_DELETE_OBJECT_PHYSICAL_POSTPONED, BTREE_OP_DELETE_UNDO_INSERT, BTREE_OP_DELETE_UNDO_INSERT_DELID, BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OP_DELETE_VACUUM_INSID, BTREE_OP_DELETE_VACUUM_OBJECT, BTREE_OP_ONLINE_INDEX_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_INSERT, btree_delete_helper::buffered_key, CAST_BUFLEN, btree_delete_helper::check_key_deleted, btree_object_info::class_oid, COPY_OID, db_value::data, DB_IS_NULL, DB_TYPE_MIDXKEY, DB_VALUE_DOMAIN_TYPE, btree_unique_stats::delete_key_and_row(), btree_unique_stats::delete_null_and_row(), db_midxkey::domain, or_buf::endptr, pr_type::id, pr_type::index_readval(), btree_delete_helper::is_first_search, btree_delete_helper::is_key_deleted, btree_delete_helper::is_root, btid_int::key_type, LOG_ISRESTARTED, btree_delete_helper::log_operations, logtb_tran_update_unique_stats(), db_data::midxkey, MULTI_ROW_UPDATE, mvcc_is_mvcc_disabled_class(), NO_ERROR, btree_delete_helper::nonleaf_latch_mode, NULL, OID_ISNULL, btree_delete_helper::op_type, pgbuf_unfix_and_init, pr_valstring(), btree_delete_helper::printed_key, btree_delete_helper::printed_key_sha1, or_buf::ptr, btree_delete_helper::purpose, btree_delete_helper::second_object_info, SHA1Compute(), strlen, btid_int::topclass_oid, TP_ARE_COMPARABLE_KEY_TYPES, tp_domain::type, btid_int::unique_pk, and btree_delete_helper::unique_stats_info.

Referenced by btree_delete_internal(), and btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_fix_root_for_insert ( THREAD_ENTRY thread_p,
BTID btid,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR root_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static

Definition at line 26247 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, BTID_AS_ARGS, btree_create_overflow_key_file(), btree_fix_root_with_info(), btree_get_disk_size_of_key(), BTREE_GET_KEY_LEN_IN_PAGE, BTREE_ID_MSG, BTREE_INSERT_CLASS_OID, BTREE_INSERT_HELPER_AS_ARGS, BTREE_INSERT_HELPER_MSG, btree_insert_log, BTREE_INSERT_OID, btree_is_insert_data_purpose(), btree_is_insert_object_purpose(), BTREE_IS_MULTI_ROW_OP, btree_is_online_index_loading(), BTREE_IS_UNIQUE, BTREE_MAX_KEYLEN_INPAGE, BTREE_OP_INSERT_MARK_DELETED, BTREE_OP_INSERT_MVCC_DELID, BTREE_OP_INSERT_UNDO_PHYSICAL_DELETE, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_DELETE, BTREE_SET_CREATED_OVERFLOW_KEY_NOTIFICATION, COPY_OID, db_value::data, DB_TYPE_MIDXKEY, DB_VALUE_DOMAIN_TYPE, btree_unique_stats::delete_key_and_row(), btree_unique_stats::delete_null_and_row(), db_midxkey::domain, DONT_FREE, ER_FAILED, ER_PAGE_LATCH_PROMOTE_FAIL, error(), HEADER, pr_type::id, btree_unique_stats::insert_key_and_row(), btree_unique_stats::insert_null_and_row(), btree_insert_helper::is_crt_node_write_latched, btree_insert_helper::is_first_try, btree_insert_helper::is_null, btree_insert_helper::is_root, btree_insert_helper::key_len_in_page, btid_int::key_type, log_append_undoredo_data2(), btree_insert_helper::log_operations, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), logtb_tran_update_unique_stats(), db_data::midxkey, btree_insert_helper::need_update_max_key_len, NO_ERROR, btree_insert_helper::nonleaf_latch_mode, NULL, OID_ISNULL, btree_insert_helper::op_type, btid_int::ovfid, btree_root_header::ovfid, PGBUF_LATCH_WRITE, pgbuf_promote_read_latch, PGBUF_PROMOTE_SHARED_READER, pgbuf_set_dirty(), pgbuf_unfix_and_init, pr_valstring(), btree_insert_helper::printed_key, btree_insert_helper::printed_key_sha1, btree_insert_helper::purpose, RVBT_UPDATE_OVFID, SHA1Compute(), strlen, btid_int::sys_btid, btid_int::topclass_oid, TP_ARE_COMPARABLE_KEY_TYPES, tp_domain::type, btid_int::unique_pk, btree_insert_helper::unique_stats_info, btid::vfid, VFID_COPY, and VFID_ISNULL.

Referenced by btree_insert_internal(), and btree_online_index_list_dispatcher().

Here is the caller graph for this function:

int btree_get_btid_from_file ( THREAD_ENTRY thread_p,
const VFID vfid,
BTID btid_out 
)
int btree_get_class_oid_of_unique_btid ( THREAD_ENTRY thread_p,
BTID btid,
OID class_oid 
)
static MVCCID btree_get_creator_mvccid ( THREAD_ENTRY thread_p,
PAGE_PTR  root_page 
)
static

Definition at line 32827 of file btree.c.

References assert, btree_get_root_header(), btree_root_header::creator_mvccid, and NULL.

Referenced by btree_prepare_bts().

Here is the caller graph for this function:

static PAGE_PTR btree_get_new_page ( THREAD_ENTRY thread_p,
BTID_INT btid,
VPID vpid,
VPID near_vpid 
)
static
SCAN_CODE btree_get_next_key_info ( THREAD_ENTRY thread_p,
BTID btid,
BTREE_SCAN bts,
int  num_classes,
OID class_oids_ptr,
INDX_SCAN_ID index_scan_id_p,
DB_VALUE **  key_info 
)

Definition at line 16115 of file btree.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, btree_scan::btid_int, BTREE_INVALID_INDEX_ID, BTREE_IS_UNIQUE, btree_key_find_first_visible_row(), btree_key_find_first_visible_row_from_all_ovf(), BTREE_KEY_INFO_FIRST_OID, BTREE_KEY_INFO_KEY, BTREE_KEY_INFO_OID_COUNT, BTREE_KEY_INFO_OVERFLOW_KEY, BTREE_KEY_INFO_OVERFLOW_OIDS, BTREE_KEY_INFO_PAGEID, BTREE_KEY_INFO_SLOTID, BTREE_KEY_INFO_VOLUMEID, BTREE_KEY_NOTFOUND, btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_OVERFLOW_KEY, BTREE_LEAF_RECORD_OVERFLOW_OIDS, btree_prepare_bts(), btree_range_scan_resume(), btree_range_scan_start(), btree_record_get_num_oids(), btree_scan_clear_key(), BTS_KEY_IS_CONSUMED, btree_scan::C_page, btree_scan::C_vpid, btree_scan::cur_key, btree_scan::cur_leaf_lsa, db_make_int(), db_make_oid(), db_make_string(), btree_scan::end_scan, ER_BTREE_INVALID_INDEX_ID, ER_ERROR_SEVERITY, er_set(), error(), vfid::fileid, indx_scan_id::indx_info, btree_scan::key_filter, btree_scan::key_record, btree_scan::key_status, btree_scan::leaf_rec_info, LSA_COPY(), NO_ERROR, NULL, NULL_PAGEID, btree_scan::O_page, btree_scan::offset, oid_Null_oid, OID_SET_NULL, OR_OID_SIZE, leaf_rec::ovfl, btree_scan::P_page, vpid::pageid, perfmon_inc_stat(), pgbuf_get_lsa(), pgbuf_unfix_and_init, pr_clear_value(), pr_clone_value(), PSTAT_BT_NUM_RESUMES, btid::root_pageid, S_END, S_ERROR, S_SUCCESS, btree_scan::slot_id, btid_int::unique_pk, indx_info::use_desc_index, btree_scan::use_desc_index, btid::vfid, vpid::volid, vfid::volid, VPID_ISNULL, and VPID_SET_NULL.

Referenced by scan_next_index_key_info_scan().

Here is the caller graph for this function:

static PAGE_PTR btree_get_next_page ( THREAD_ENTRY thread_p,
PAGE_PTR  page_p 
)
static
static int btree_get_next_page_vpid ( THREAD_ENTRY thread_p,
PAGE_PTR  leaf_page,
VPID next_vpid 
)
static
static int btree_get_node_level ( THREAD_ENTRY thread_p,
PAGE_PTR  page_ptr 
)
static
int btree_get_num_visible_from_leaf_and_ovf ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES leaf_record,
int  offset_after_key,
LEAF_REC leaf_info,
int *  max_visible_oids,
MVCC_SNAPSHOT mvcc_snapshot,
int *  num_visible 
)
static int btree_get_num_visible_oids_from_all_ovf ( THREAD_ENTRY thread_p,
BTID_INT btid,
VPID first_ovfl_vpid,
int *  num_visible_oids,
int *  max_visible_oids,
MVCC_SNAPSHOT mvcc_snapshot 
)
static
int btree_get_pkey_btid ( THREAD_ENTRY thread_p,
OID cls_oid,
BTID pkey_btid 
)
int btree_get_prefix_separator ( const DB_VALUE key1,
const DB_VALUE key2,
DB_VALUE prefix_key,
TP_DOMAIN key_domain 
)
void btree_get_root_vpid_from_btid ( THREAD_ENTRY thread_p,
BTID btid,
VPID root_vpid 
)

Definition at line 6912 of file btree.c.

References assert, NULL, vpid::pageid, btid::root_pageid, btid::vfid, VFID_ISNULL, vpid::volid, and vfid::volid.

Referenced by btree_build_nleafs(), xbtree_add_index(), and xbtree_load_index().

Here is the caller graph for this function:

static int btree_get_root_with_key ( THREAD_ENTRY thread_p,
BTID btid,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR root_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static
static int btree_get_stats_midxkey ( THREAD_ENTRY thread_p,
BTREE_STATS_ENV env,
DB_MIDXKEY midxkey 
)
static
int btree_get_unique_statistics_for_count ( THREAD_ENTRY thread_p,
BTID btid,
int *  oid_cnt,
int *  null_cnt,
int *  key_cnt 
)
unsigned int btree_hash_btid ( void *  btid,
int  hash_size 
)

Definition at line 32874 of file btree.c.

Referenced by logtb_initialize_global_unique_stats_table().

Here is the caller graph for this function:

int btree_index_end_scan ( THREAD_ENTRY thread_p,
void **  ptr 
)

Definition at line 20769 of file btree.c.

References show_index_scan_ctx::class_oids, db_private_free_and_init, show_index_scan_ctx::index_name, NO_ERROR, and NULL.

Referenced by showstmt_scan_init().

Here is the caller graph for this function:

int btree_initialize_new_page ( THREAD_ENTRY thread_p,
PAGE_PTR  page,
void *  args 
)
static int btree_insert_internal ( THREAD_ENTRY thread_p,
BTID btid,
DB_VALUE key,
OID class_oid,
OID oid,
int  op_type,
btree_unique_stats unique_stat_info,
int *  unique,
BTREE_MVCC_INFO mvcc_info,
LOG_LSA undo_nxlsa,
BTREE_OP_PURPOSE  purpose 
)
static

Definition at line 26069 of file btree.c.

References btree_unique_stats::add_row(), assert, ASSERT_ERROR, assert_release, BTID_AS_ARGS, btree_fix_root_for_insert(), BTREE_ID_MSG, BTREE_INSERT_CLASS_OID, BTREE_INSERT_HELPER_AS_ARGS, BTREE_INSERT_HELPER_MSG, btree_insert_log, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, btree_is_insert_object_purpose(), BTREE_IS_UNIQUE, btree_key_find_and_insert_delete_mvccid(), btree_key_insert_new_object(), btree_multicol_key_is_null(), BTREE_OP_INSERT_MARK_DELETED, BTREE_OP_INSERT_MVCC_DELID, BTREE_OP_INSERT_NEW_OBJECT, BTREE_OP_INSERT_UNDO_PHYSICAL_DELETE, btree_search_key_and_apply_functions(), BTREE_SEARCH_KEY_HELPER_INITIALIZER, btree_split_node_and_advance(), btree_insert_helper::compensate_undo_nxlsa, COPY_OID, DB_IS_NULL, db_private_free, btree_unique_stats::delete_key_and_row(), btree_unique_stats::delete_row(), ER_FAILED, btree_unique_stats::get_key_count(), btree_unique_stats::get_null_count(), btree_unique_stats::get_row_count(), HA_DISABLED, btree_unique_stats::insert_key_and_row(), btree_insert_helper::is_ha_enabled, btree_insert_helper::is_null, btree_insert_helper::is_unique_key_added_or_deleted, btree_insert_helper::is_unique_multi_update, lock_unlock_object_donot_move_to_non2pl(), btree_insert_helper::log_operations, LSA_COPY(), MULTI_ROW_UPDATE, NO_ERROR, NULL, OID_ISNULL, OID_SET_NULL, btree_insert_helper::op_type, btree_delete_helper::op_type, perfmon_inc_stat(), btree_insert_helper::printed_key, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, PSTAT_BT_NUM_INSERTS, btree_insert_helper::purpose, btree_delete_helper::purpose, btid_int::sys_btid, btree_insert_helper::time_track, btid_int::unique_pk, btree_insert_helper::unique_stats_info, and X_LOCK.

Referenced by btree_insert(), btree_mvcc_delete(), btree_physical_delete(), and btree_undo_delete_physical().

Here is the caller graph for this function:

static int btree_insert_mvcc_delid_into_page ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  page_ptr,
BTREE_NODE_TYPE  node_type,
DB_VALUE key,
BTREE_INSERT_HELPER insert_helper,
PGSLOTID  slot_id,
RECDES rec,
int  oid_offset 
)
static
static void btree_insert_object_ordered_by_oid ( THREAD_ENTRY thread_p,
RECDES record,
BTID_INT btid_int,
BTREE_OBJECT_INFO object_info,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr,
int *  offset_to_objptr 
)
static
bool btree_is_btid_online_index ( THREAD_ENTRY thread_p,
OID class_oid,
BTID btid 
)
static bool btree_is_class_oid_packed ( BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
bool  is_first 
)
static
static bool btree_is_fixed_size ( BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
bool  is_first 
)
inlinestatic

Definition at line 34797 of file btree.c.

References BTREE_IS_UNIQUE, btree_leaf_is_flaged(), BTREE_LEAF_RECORD_OVERFLOW_OIDS, BTREE_OVERFLOW_NODE, and btid_int::unique_pk.

Referenced by btree_online_index_change_state().

Here is the caller graph for this function:

static bool btree_is_insert_delid_purpose ( BTREE_OP_PURPOSE  purpose)
static

Definition at line 34840 of file btree.c.

References BTREE_OP_INSERT_MARK_DELETED, and BTREE_OP_INSERT_MVCC_DELID.

static bool btree_is_single_object_key ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
BTREE_NODE_TYPE  node_type,
RECDES record,
int  offset_after_key 
)
static

Definition at line 35373 of file btree.c.

References assert, BTREE_LEAF_NODE, BTREE_OVERFLOW_NODE, and recdes::length.

Referenced by btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), and btree_key_online_index_tran_insert_DF().

Here is the caller graph for this function:

static int btree_key_append_object_as_new_overflow ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
PAGE_PTR  leaf_page,
BTREE_OBJECT_INFO object_info,
BTREE_INSERT_HELPER insert_helper,
BTREE_SEARCH_KEY_HELPER search_key,
RECDES leaf_rec,
VPID first_ovfl_vpid 
)
static
static int btree_key_append_object_non_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR  leaf,
BTREE_SEARCH_KEY_HELPER search_key,
RECDES leaf_record,
int  offset_after_key,
LEAF_REC leaf_info,
BTREE_OBJECT_INFO btree_obj,
BTREE_INSERT_HELPER insert_helper 
)
static
static int btree_key_append_object_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR  leaf,
BTREE_SEARCH_KEY_HELPER search_key,
RECDES leaf_record,
LEAF_REC leaf_record_info,
int  offset_after_key,
BTREE_INSERT_HELPER insert_helper,
BTREE_OBJECT_INFO first_object 
)
static

Definition at line 28135 of file btree.c.

References assert, ASSERT_ERROR, assert_release, BTREE_INSERT_CLASS_OID, btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, btree_is_insert_object_purpose(), BTREE_IS_UNIQUE, BTREE_KEY_FOUND, btree_key_relocate_last_into_ovf(), btree_leaf_change_first_object(), BTREE_LEAF_NODE, BTREE_MAX_OIDCOUNT_IN_LEAF_RECORD, BTREE_MVCC_INFO_SET_FIXED_SIZE, BTREE_OBJINFO_AS_ARGS, BTREE_OBJINFO_MSG, btree_record_append_object(), btree_record_get_num_oids(), BTREE_RV_DEBUG_ID_UNIQUE, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_REDO_SET_DEBUG_INFO, DONT_FREE, ER_FAILED, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, btree_insert_helper::leaf_addr, recdes::length, log_append_undoredo_data(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, LSA_COPY(), btree_object_info::mvcc_info, NO_ERROR, NULL, log_data_addr::offset, btree_object_info::oid, OID_ISNULL, pgbuf_get_lsa(), pgbuf_set_dirty(), log_data_addr::pgptr, btree_insert_helper::purpose, btree_insert_helper::rcvindex, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_insert_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, RVBT_MVCC_INSERT_OBJECT, RVBT_MVCC_INSERT_OBJECT_UNQ, RVBT_NON_MVCC_INSERT_OBJECT, btree_search_key_helper::slotid, SP_SUCCESS, spage_update(), btid_int::sys_btid, and btid_int::unique_pk.

Referenced by btree_key_lock_and_append_object_unique().

Here is the caller graph for this function:

static int btree_key_delete_remove_object ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 30584 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_check_locking_for_delete_unique(), BTREE_DELETE_CLASS_OID, BTREE_DELETE_HELPER_AS_ARGS, BTREE_DELETE_HELPER_MSG, btree_delete_log, BTREE_DELETE_MVCC_INFO, BTREE_DELETE_OID, btree_find_oid_and_its_page(), btree_get_num_visible_from_leaf_and_ovf(), btree_is_delete_object_purpose(), BTREE_IS_UNIQUE, BTREE_KEY_FOUND, btree_key_remove_object(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, btree_multicol_key_is_null(), BTREE_MVCC_INFO_INSID, BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_DELETE_UNDO_INSERT, BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OP_DELETE_VACUUM_OBJECT, BTREE_OVERFLOW_NODE, btree_perf_track_time(), btree_perf_track_traverse_time(), btree_read_record(), BTREE_RV_BUFFER_SIZE, btree_rv_save_keyval_for_undo(), btree_set_unknown_key_error(), btree_delete_helper::check_key_deleted, COPY, recdes::data, DB_IS_NULL, DB_PAGESIZE, db_private_free_and_init, ER_BTREE_UNKNOWN_KEY, ER_FAILED, IO_MAX_PAGE_SIZE, btree_delete_helper::is_key_deleted, btree_delete_helper::leaf_addr, log_is_in_crash_recovery(), logtb_find_current_mvccid(), btree_delete_helper::match_mvccinfo, MULTI_ROW_UPDATE, mvcc_satisfies_dirty(), NO_ERROR, NOT_FOUND, NULL, btree_delete_helper::object_info, log_data_addr::offset, btree_object_info::oid, OID_ISNULL, btree_delete_helper::op_type, db_identifier::pageid, PEEK, PEEK_KEY_VALUE, pgbuf_get_latch_mode(), PGBUF_LATCH_WRITE, pgbuf_unfix_and_init, log_data_addr::pgptr, btree_delete_helper::printed_key, PTR_ALIGN, btree_delete_helper::purpose, btree_search_key_helper::result, btree_delete_helper::rv_keyval_data, btree_delete_helper::rv_keyval_data_length, btree_delete_helper::rv_redo_data, btree_delete_helper::rv_redo_data_ptr, S_SUCCESS, btree_search_key_helper::slotid, db_identifier::slotid, mvcc_snapshot::snapshot_fnc, spage_get_record(), btid_int::sys_btid, btid_int::unique_pk, VACUUM_ER_LOG_BTREE, vacuum_er_log_warning, VACUUM_ER_LOG_WORKER, log_data_addr::vfid, btid::vfid, and db_identifier::volid.

Referenced by btree_delete_internal().

Here is the caller graph for this function:

static int btree_key_find_and_insert_delete_mvccid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static
static int btree_key_find_and_lock_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 22955 of file btree.c.

References BTREE_IS_UNIQUE, btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_and_lock_unique_of_unique(), and btid_int::unique_pk.

Referenced by xbtree_find_unique().

Here is the caller graph for this function:

static int btree_key_find_and_lock_unique_of_non_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 23213 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_get_next_overflow_vpid(), BTREE_IS_PAGE_VALID_LEAF, BTREE_IS_UNIQUE, BTREE_KEY_BETWEEN, BTREE_KEY_BIGGER, BTREE_KEY_FOUND, BTREE_KEY_NOTFOUND, BTREE_KEY_SMALLER, btree_leaf_is_key_between_min_max(), BTREE_LEAF_NODE, btree_multicol_key_is_null(), BTREE_MVCC_INFO_INITIALIZER, btree_mvcc_info_to_heap_mvcc_header(), btree_or_get_object(), BTREE_OVERFLOW_NODE, btree_perf_ovf_oids_fix_time(), btree_perf_unique_lock_time(), btree_read_record(), BTREE_RECORD_OR_BUF_INIT, btree_search_leaf_page(), COPY_OID, DB_IS_NULL, DELETE_RECORD_CAN_DELETE, DELETE_RECORD_DELETE_IN_PROGRESS, DELETE_RECORD_DELETED, DELETE_RECORD_INSERT_IN_PROGRESS, DELETE_RECORD_SELF_DELETED, or_buf::endptr, ER_FAILED, error(), btree_find_unique_helper::found_object, LK_COND_LOCK, LK_GRANTED, LK_UNCOND_LOCK, lock_has_lock_on_object(), btree_find_unique_helper::lock_mode, lock_object(), lock_unlock_object_donot_move_to_non2pl(), LSA_COPY(), LSA_EQ(), btree_find_unique_helper::match_class_oid, MVCC_REC_HEADER_INITIALIZER, mvcc_satisfies_delete(), NO_ERROR, NULL, btree_find_unique_helper::oid, OID_EQ, OID_ISNULL, OID_SET_NULL, OLD_PAGE, leaf_rec::ovfl, PEEK, PEEK_KEY_VALUE, pgbuf_fix, pgbuf_fix_if_not_deallocated, pgbuf_get_latch_mode(), pgbuf_get_lsa(), pgbuf_get_vpid(), PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, PSTAT_BT_FIND_UNIQUE, PSTAT_BT_FIND_UNIQUE_TRAVERSE, PSTAT_BT_LEAF, PSTAT_BT_TRAVERSE, or_buf::ptr, btree_search_key_helper::result, S_LOCK, S_SUCCESS, btree_search_key_helper::slotid, spage_get_record(), btree_find_unique_helper::time_track, btid_int::unique_pk, VPID_COPY, VPID_INITIALIZER, and VPID_ISNULL.

Referenced by btree_key_find_and_lock_unique().

Here is the caller graph for this function:

static int btree_key_insert_delete_mvccid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR  leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
BTREE_INSERT_HELPER insert_helper,
RECDES leaf_record,
PAGE_PTR  object_page,
int  offset_to_found_object 
)
static
static bool btree_key_insert_does_leaf_need_split ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
PAGE_PTR  leaf_page,
BTREE_INSERT_HELPER insert_helper,
BTREE_SEARCH_KEY_HELPER search_key 
)
static
static int btree_key_insert_new_key ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR  leaf_page,
BTREE_INSERT_HELPER insert_helper,
BTREE_SEARCH_KEY_HELPER search_key 
)
static

Definition at line 27395 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_check_locking_for_insert_unique(), btree_check_valid_record(), BTREE_DEBUG_DUMP_SIMPLE, btree_get_disk_size_of_key(), BTREE_GET_KEY_LEN_IN_PAGE, btree_get_node_header(), btree_get_node_level(), BTREE_INSERT_CLASS_OID, btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, btree_insert_sysop_end(), btree_is_online_index_loading(), BTREE_IS_UNIQUE, BTREE_KEY_FOUND, BTREE_LEAF_NODE, BTREE_MAX_ALIGN, BTREE_MAX_KEYLEN_INPAGE, btree_multicol_key_is_null(), btree_node_common_prefix(), btree_node_number_of_keys(), BTREE_NORMAL_KEY, BTREE_OVERFLOW_KEY, BTREE_RV_DEBUG_ID_INS_KEY, btree_rv_log_insert_object(), BTREE_RV_REDO_SET_DEBUG_INFO, BTREE_RV_SET_UPDATE_MAX_KEY_LEN, btree_split_next_pivot(), btree_verify_node(), btree_write_record(), CAST_BUFLEN, recdes::data, DB_IS_NULL, db_make_null(), DB_PAGESIZE, db_value_print(), DISK_VPID_ALIGNED_SIZE, DONT_FREE, ER_FAILED, error(), FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, IO_MAX_PAGE_SIZE, btree_insert_helper::is_system_op_started, btree_insert_helper::is_unique_key_added_or_deleted, btree_insert_helper::leaf_addr, recdes::length, log_is_in_crash_recovery(), btree_insert_helper::log_operations, LOG_RV_RECORD_INSERT, LOG_RV_RECORD_SET_MODIFY_MODE(), log_sysop_abort(), log_sysop_start(), LSA_COPY(), MAX_ALIGNMENT, btree_node_header::max_key_len, NO_ERROR, NULL, log_data_addr::offset, OR_BUF_INIT, or_get_int(), or_get_short(), or_pack_int(), vpid::pageid, pgbuf_get_latch_mode(), pgbuf_get_lsa(), pgbuf_get_vpid_ptr(), PGBUF_LATCH_WRITE, pgbuf_set_dirty(), btree_node_split_info::pivot, pr_clear_value(), pr_clone_value(), pr_midxkey_remove_prefix(), prm_get_integer_value(), PRM_ID_ER_BTREE_DEBUG, PTR_ALIGN, btree_insert_helper::purpose, rc, REC_HOME, btree_search_key_helper::result, btree_insert_helper::rv_redo_data, btree_delete_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, btree_delete_helper::rv_redo_data_ptr, btree_search_key_helper::slotid, SP_SUCCESS, spage_insert_at(), btree_node_header::split_info, btid_int::sys_btid, recdes::type, btid_int::unique_pk, vpid::volid, VPID_AS_ARGS, VPID_INITIALIZER, and VPID_ISNULL.

Referenced by btree_key_insert_new_object(), btree_key_lock_and_append_object_unique(), btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), and btree_key_online_index_tran_insert_DF().

Here is the caller graph for this function:

static int btree_key_insert_new_object ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 27213 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_check_valid_record(), BTREE_INSERT_CLASS_OID, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, btree_is_insert_object_purpose(), BTREE_IS_UNIQUE, btree_key_append_object_non_unique(), BTREE_KEY_FOUND, btree_key_insert_new_key(), btree_key_lock_and_append_object_unique(), btree_key_record_check_no_visible(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, btree_multicol_key_is_null(), BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE, btree_node_number_of_keys(), BTREE_OP_INSERT_NEW_OBJECT, BTREE_OP_ONLINE_INDEX_TRAN_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, btree_perf_track_time(), btree_perf_track_traverse_time(), btree_read_record(), BTREE_RV_BUFFER_SIZE, btree_rv_save_keyval_for_undo(), btree_verify_node(), COPY, recdes::data, DB_IS_NULL, DB_PAGESIZE, db_private_free_and_init, ER_FAILED, error(), IO_MAX_PAGE_SIZE, btree_insert_helper::leaf_addr, NO_ERROR, NULL, btree_insert_helper::obj_info, log_data_addr::offset, oid_is_db_class(), PEEK_KEY_VALUE, pgbuf_get_latch_mode(), PGBUF_LATCH_WRITE, log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_insert_helper::rcvindex, REC_HOME, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_insert_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, RVBT_MVCC_INSERT_OBJECT, RVBT_NON_MVCC_INSERT_OBJECT, RVBT_RECORD_MODIFY_COMPENSATE, S_SUCCESS, btree_search_key_helper::slotid, spage_get_record(), btid_int::sys_btid, recdes::type, btid_int::unique_pk, log_data_addr::vfid, and btid::vfid.

Referenced by btree_insert_internal().

Here is the caller graph for this function:

static int btree_key_lock_and_append_object_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf,
bool restart,
BTREE_SEARCH_KEY_HELPER search_key,
BTREE_INSERT_HELPER insert_helper,
RECDES leaf_record 
)
static

Definition at line 27665 of file btree.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, assert_release, btree_check_locking_for_insert_unique(), btree_check_valid_record(), BTREE_FIND_UNIQUE_HELPER_INITIALIZER, btree_get_num_visible_from_leaf_and_ovf(), BTREE_INSERT_CLASS_OID, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, BTREE_IS_UNIQUE, btree_key_append_object_unique(), btree_key_find_and_lock_unique_of_unique(), BTREE_KEY_FOUND, btree_key_insert_does_leaf_need_split(), btree_key_insert_new_key(), btree_leaf_get_first_object(), BTREE_LEAF_NODE, BTREE_MVCC_INFO_DELID, BTREE_MVCC_INFO_INSID, btree_node_number_of_keys(), BTREE_OP_INSERT_NEW_OBJECT, btree_read_record(), btree_rv_save_keyval_for_undo_two_objects(), BTREE_SET_UNIQUE_VIOLATION_ERROR, btree_object_info::class_oid, COPY, COPY_OID, db_private_free, ER_BTREE_UNIQUE_FAILED, ER_ERROR_SEVERITY, ER_FAILED, ER_REPL_MULTI_UPDATE_UNIQUE_VIOLATION, er_set(), ER_UNIQUE_VIOLATION_WITHKEY, btree_find_unique_helper::found_object, IO_MAX_PAGE_SIZE, btree_insert_helper::is_ha_enabled, btree_insert_helper::is_unique_key_added_or_deleted, btree_insert_helper::is_unique_multi_update, btree_insert_helper::leaf_addr, btree_find_unique_helper::lock_mode, log_is_in_crash_recovery(), logtb_find_current_isolation(), logtb_get_mvcc_snapshot(), LSA_COPY(), LSA_EQ(), btree_object_info::mvcc_info, mvcc_satisfies_dirty(), NO_ERROR, NULL, btree_insert_helper::obj_info, log_data_addr::offset, btree_object_info::oid, OID_SET_NULL, PEEK_KEY_VALUE, pgbuf_get_lsa(), log_data_addr::pgptr, pr_valstring(), prm_get_bool_value(), PRM_ID_UNIQUE_ERROR_KEY_VALUE, btree_insert_helper::purpose, btree_insert_helper::rcvindex, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_insert_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, RVBT_MVCC_INSERT_OBJECT, RVBT_MVCC_INSERT_OBJECT_UNQ, S_SUCCESS, btree_search_key_helper::slotid, mvcc_snapshot::snapshot_fnc, spage_get_record(), btid_int::sys_btid, TRAN_REPEATABLE_READ, btid_int::unique_pk, and X_LOCK.

Referenced by btree_key_insert_new_object().

Here is the caller graph for this function:

int btree_key_online_index_IB_insert ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 33648 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_find_oid_with_page_and_record(), btree_insert_helper_to_delete_helper(), btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, btree_is_single_object_key(), BTREE_IS_UNIQUE, btree_key_append_object_non_unique(), BTREE_KEY_FOUND, btree_key_insert_new_key(), btree_key_remove_object(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, BTREE_MVCC_INFO_INITIALIZER, btree_online_index_change_state(), btree_online_index_check_state(), btree_online_index_is_delete_flag_state(), btree_online_index_is_insert_flag_state(), btree_online_index_set_normal_state(), BTREE_OP_ONLINE_INDEX_IB_DELETE, BTREE_OVERFLOW_NODE, btree_read_record(), BTREE_RV_BUFFER_SIZE, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_SET_OVERFLOW_NODE, COPY, recdes::data, btree_helper::delete_helper, DONT_FREE, ER_FAILED, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, btree_helper::insert_helper, btree_mvcc_info::insert_mvccid, IO_MAX_PAGE_SIZE, btree_insert_helper::leaf_addr, recdes::length, log_append_redo_data(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, logtb_tran_update_unique_stats(), LSA_COPY(), NO_ERROR, NOT_FOUND, NULL, btree_insert_helper::obj_info, log_data_addr::offset, btree_object_info::oid, btree_delete_helper::op_type, PEEK_KEY_VALUE, pgbuf_get_lsa(), pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_delete_helper::purpose, btree_search_key_helper::result, btree_delete_helper::rv_keyval_data, btree_insert_helper::rv_redo_data, btree_delete_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, btree_delete_helper::rv_redo_data_ptr, RVBT_RECORD_MODIFY_NO_UNDO, S_SUCCESS, SINGLE_ROW_DELETE, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, btid_int::unique_pk, log_data_addr::vfid, and btid::vfid.

Referenced by btree_key_online_index_IB_insert_list().

Here is the caller graph for this function:

int btree_key_online_index_IB_insert_list ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 33460 of file btree.c.

References assert, ASSERT_ERROR, btree_compare_key(), BTREE_ERROR_OCCURRED, btree_get_disk_size_of_key(), btree_get_max_new_data_size(), btree_get_node_header(), BTREE_INSERT_OID, BTREE_KEY_BETWEEN, BTREE_KEY_BIGGER, BTREE_KEY_FOUND, btree_key_online_index_IB_insert(), BTREE_KEY_SMALLER, btree_leaf_is_key_between_min_max(), BTREE_LEAF_NODE, BTREE_OP_ONLINE_INDEX_IB_INSERT, btree_search_leaf_page(), btree_insert_list::check_release_latch(), COPY_OID, DB_EQ, DB_LT, DB_TYPE_MIDXKEY, DB_VALUE_DOMAIN_TYPE, btree_insert_list::get_key(), btree_insert_list::get_oid(), btree_search_key_helper::HAS_FENCE_KEY, btree_search_key_helper::has_fence_key, btree_helper::insert_helper, btree_insert_helper::insert_list, btree_insert_list::KEY_AVAILABLE, btid_int::key_type, btree_insert_list::m_boundaries, page_key_boundary::m_is_inf_left_key, page_key_boundary::m_is_inf_right_key, btree_insert_list::m_keep_page_iterations, btree_insert_list::m_key_type, btree_insert_list::m_keys_oids, page_key_boundary::m_left_key, btree_insert_list::m_ovf_appends, btree_insert_list::m_ovf_appends_new_page, page_key_boundary::m_right_key, btree_node_header::max_key_len, btree_insert_list::next_key(), btree_node_header::next_vpid, NO_ERROR, NULL, perfmon_inc_stat(), btree_node_header::prev_vpid, PSTAT_BT_ONLINE_INSERT_LEAF, PSTAT_BT_ONLINE_NUM_INSERTS, PSTAT_BT_ONLINE_NUM_INSERTS_SAME_PAGE_HOLD, PSTAT_BT_ONLINE_NUM_RETRY, PSTAT_BT_ONLINE_NUM_RETRY_NICE, btree_insert_helper::purpose, btree_insert_list::reset_boundary_keys(), btree_search_key_helper::result, spage_get_free_space_without_saving(), and VPID_ISNULL.

Referenced by btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_key_online_index_tran_delete ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 34102 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, BTREE_DELETE_CLASS_OID, btree_delete_helper_to_insert_helper(), btree_delete_log, BTREE_DELETE_MODIFY_ARGS, BTREE_DELETE_MODIFY_MSG, BTREE_DELETE_MVCC_INFO, BTREE_DELETE_OID, btree_find_oid_with_page_and_record(), btree_get_disk_size_of_key(), BTREE_GET_KEY_LEN_IN_PAGE, btree_is_single_object_key(), BTREE_IS_UNIQUE, btree_key_append_object_non_unique(), BTREE_KEY_FOUND, btree_key_insert_does_leaf_need_split(), btree_key_insert_new_key(), BTREE_KEY_NOTFOUND, btree_key_remove_object(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, BTREE_MAX_KEYLEN_INPAGE, BTREE_MVCC_INFO_INITIALIZER, BTREE_OID_HAS_MVCC_INSID, btree_online_index_change_state(), btree_online_index_check_state(), btree_online_index_is_insert_flag_state(), btree_online_index_is_normal_state(), btree_online_index_set_delete_flag_state(), BTREE_OP_ONLINE_INDEX_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_TRAN_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, BTREE_OVERFLOW_NODE, btree_read_record(), BTREE_RV_BUFFER_SIZE, BTREE_RV_GET_DATA_LENGTH(), btree_rv_log_delete_object(), btree_rv_save_keyval_for_undo(), BTREE_RV_SET_OVERFLOW_NODE, COPY, recdes::data, db_private_free_and_init, btree_helper::delete_helper, DONT_FREE, ER_FAILED, btree_mvcc_info::flags, btree_helper::insert_helper, btree_mvcc_info::insert_mvccid, IO_MAX_PAGE_SIZE, btree_insert_helper::key_len_in_page, btree_delete_helper::leaf_addr, recdes::length, LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, logtb_tran_update_unique_stats(), LSA_COPY(), btree_object_info::mvcc_info, NO_ERROR, NOT_FOUND, NULL, btree_insert_helper::obj_info, btree_delete_helper::object_info, log_data_addr::offset, btree_object_info::oid, btree_insert_helper::op_type, btid_int::ovfid, PEEK_KEY_VALUE, pgbuf_get_lsa(), pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_delete_helper::purpose, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_delete_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_delete_helper::rv_keyval_data_length, btree_delete_helper::rv_redo_data, btree_delete_helper::rv_redo_data_ptr, S_SUCCESS, SINGLE_ROW_INSERT, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, btid_int::unique_pk, log_data_addr::vfid, btid::vfid, and VFID_ISNULL.

Referenced by btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_key_online_index_tran_insert ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 33875 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_find_oid_with_page_and_record(), BTREE_INSERT_CLASS_OID, btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, BTREE_IS_UNIQUE, btree_key_append_object_non_unique(), BTREE_KEY_FOUND, btree_key_insert_new_key(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, BTREE_MVCC_INFO_INITIALIZER, btree_online_index_change_state(), btree_online_index_check_state(), btree_online_index_is_delete_flag_state(), btree_online_index_set_insert_flag_state(), BTREE_OP_ONLINE_INDEX_TRAN_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, BTREE_OVERFLOW_NODE, btree_read_record(), BTREE_RV_BUFFER_SIZE, BTREE_RV_GET_DATA_LENGTH(), btree_rv_log_insert_object(), btree_rv_save_keyval_for_undo(), BTREE_RV_SET_OVERFLOW_NODE, COPY, recdes::data, db_private_free_and_init, DONT_FREE, ER_FAILED, btree_helper::insert_helper, btree_mvcc_info::insert_mvccid, IO_MAX_PAGE_SIZE, btree_insert_helper::leaf_addr, recdes::length, LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, logtb_tran_update_unique_stats(), LSA_COPY(), NO_ERROR, NOT_FOUND, NULL, btree_insert_helper::obj_info, log_data_addr::offset, btree_object_info::oid, PEEK_KEY_VALUE, pgbuf_get_lsa(), pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_insert_helper::rv_redo_data, btree_delete_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, btree_delete_helper::rv_redo_data_ptr, S_SUCCESS, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, btid_int::unique_pk, log_data_addr::vfid, and btid::vfid.

Referenced by btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_key_online_index_tran_insert_DF ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 34412 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_find_oid_with_page_and_record(), BTREE_INSERT_CLASS_OID, btree_insert_helper_to_delete_helper(), btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, BTREE_INSERT_MVCC_INFO, BTREE_INSERT_OID, btree_is_single_object_key(), BTREE_IS_UNIQUE, btree_key_append_object_non_unique(), BTREE_KEY_FOUND, btree_key_insert_new_key(), btree_key_remove_object(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, BTREE_MVCC_INFO_INITIALIZER, BTREE_OID_HAS_MVCC_INSID, btree_online_index_change_state(), btree_online_index_is_delete_flag_state(), btree_online_index_is_insert_flag_state(), btree_online_index_is_normal_state(), btree_online_index_set_delete_flag_state(), BTREE_OP_ONLINE_INDEX_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, BTREE_OVERFLOW_NODE, btree_read_record(), BTREE_RV_BUFFER_SIZE, BTREE_RV_GET_DATA_LENGTH(), btree_rv_log_insert_object(), btree_rv_save_keyval_for_undo(), BTREE_RV_SET_OVERFLOW_NODE, COPY, recdes::data, db_private_free_and_init, btree_helper::delete_helper, DONT_FREE, ER_FAILED, btree_mvcc_info::flags, btree_helper::insert_helper, btree_mvcc_info::insert_mvccid, IO_MAX_PAGE_SIZE, btree_insert_helper::leaf_addr, recdes::length, LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, logtb_tran_update_unique_stats(), LSA_COPY(), btree_object_info::mvcc_info, NO_ERROR, NOT_FOUND, NULL, btree_insert_helper::obj_info, log_data_addr::offset, btree_object_info::oid, btree_delete_helper::op_type, PEEK_KEY_VALUE, pgbuf_get_lsa(), pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_delete_helper::purpose, btree_search_key_helper::result, btree_insert_helper::rv_keyval_data, btree_delete_helper::rv_keyval_data, btree_insert_helper::rv_keyval_data_length, btree_delete_helper::rv_keyval_data_length, btree_insert_helper::rv_redo_data, btree_delete_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, btree_delete_helper::rv_redo_data_ptr, S_SUCCESS, SINGLE_ROW_DELETE, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, btid_int::unique_pk, log_data_addr::vfid, and btid::vfid.

Referenced by btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_key_process_objects ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES leaf_record,
int  after_key_offset,
LEAF_REC leaf_info,
BTREE_PROCESS_OBJECT_FUNCTION func,
void *  args 
)
static
static void btree_key_record_check_no_visible ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
PAGE_PTR  leaf_page,
PGSLOTID  slotid 
)
static
static int btree_key_relocate_last_into_ovf ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR  leaf,
BTREE_SEARCH_KEY_HELPER search_key,
RECDES leaf_record,
LEAF_REC leaf_record_info,
int  offset_after_key,
BTREE_INSERT_HELPER insert_helper 
)
static

Definition at line 28249 of file btree.c.

References assert, ASSERT_ERROR, assert_release, btree_insert_log, BTREE_INSERT_MODIFY_ARGS, BTREE_INSERT_MODIFY_MSG, btree_is_insert_object_purpose(), BTREE_IS_UNIQUE, btree_key_append_object_into_ovf(), BTREE_KEY_FOUND, btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_OVERFLOW_OIDS, BTREE_MAX_ALIGN, BTREE_MAX_OIDCOUNT_IN_LEAF_RECORD, BTREE_OBJINFO_AS_ARGS, BTREE_OBJINFO_MSG, btree_read_record(), btree_record_get_last_object(), btree_record_get_num_oids(), btree_record_remove_last_object(), BTREE_RV_BUFFER_SIZE, BTREE_RV_DEBUG_ID_INS_REM_LEAF_LAST, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_UNDOREDO_SET_DEBUG_INFO, btree_object_info::class_oid, DONT_FREE, ER_FAILED, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, btree_insert_helper::is_system_op_started, btree_insert_helper::leaf_addr, recdes::length, log_append_undoredo_data(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), LSA_COPY(), LSA_INITIALIZER, btree_object_info::mvcc_info, NO_ERROR, NULL, log_data_addr::offset, btree_object_info::oid, leaf_rec::ovfl, PEEK_KEY_VALUE, pgbuf_get_lsa(), pgbuf_set_dirty(), log_data_addr::pgptr, PTR_ALIGN, btree_insert_helper::purpose, btree_search_key_helper::result, btree_insert_helper::rv_redo_data, btree_insert_helper::rv_redo_data_ptr, RVBT_RECORD_MODIFY_UNDOREDO, btree_search_key_helper::slotid, SP_SUCCESS, spage_update(), btid_int::sys_btid, btid_int::unique_pk, and VPID_ISNULL.

Referenced by btree_key_append_object_unique().

Here is the caller graph for this function:

static int btree_key_remove_delete_mvccid_unique ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
BTREE_DELETE_HELPER delete_helper,
BTREE_SEARCH_KEY_HELPER search_key,
PAGE_PTR  leaf_page,
RECDES leaf_record,
PAGE_PTR  overflow_page,
RECDES overflow_record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object 
)
static
static int btree_key_remove_insert_mvccid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 31728 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_check_valid_record(), BTREE_DELETE_HELPER_AS_ARGS, BTREE_DELETE_HELPER_MSG, btree_delete_log, BTREE_DELETE_MODIFY_ARGS, BTREE_DELETE_MODIFY_MSG, BTREE_DELETE_MVCC_INFO, BTREE_DELETE_OID, btree_find_oid_and_its_page(), BTREE_KEY_FOUND, BTREE_LEAF_NODE, BTREE_MAX_ALIGN, btree_multicol_key_is_null(), BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE, BTREE_OP_DELETE_VACUUM_INSID, BTREE_OVERFLOW_NODE, btree_perf_track_time(), btree_perf_track_traverse_time(), btree_read_record(), btree_record_remove_insid(), BTREE_RV_BUFFER_SIZE, BTREE_RV_DEBUG_ID_REM_INSID, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_REDO_SET_DEBUG_INFO, BTREE_RV_SET_OVERFLOW_NODE, COPY, recdes::data, DB_IS_NULL, DB_PAGESIZE, DONT_FREE, ER_FAILED, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, IO_MAX_PAGE_SIZE, recdes::length, log_append_redo_data(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, LSA_COPY(), btree_delete_helper::match_mvccinfo, NO_ERROR, NOT_FOUND, NULL, btree_delete_helper::object_info, log_data_addr::offset, btree_object_info::oid, db_identifier::pageid, PEEK_KEY_VALUE, pgbuf_get_latch_mode(), pgbuf_get_lsa(), PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, btree_delete_helper::printed_key, PTR_ALIGN, btree_delete_helper::purpose, btree_search_key_helper::result, btree_delete_helper::rv_redo_data, btree_delete_helper::rv_redo_data_ptr, RVBT_RECORD_MODIFY_NO_UNDO, S_SUCCESS, btree_search_key_helper::slotid, db_identifier::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, VACUUM_ER_LOG_BTREE, vacuum_er_log_warning, VACUUM_ER_LOG_WORKER, VACUUM_IS_THREAD_VACUUM_WORKER, log_data_addr::vfid, btid::vfid, and db_identifier::volid.

Referenced by btree_delete_internal().

Here is the caller graph for this function:

static int btree_key_remove_object ( THREAD_ENTRY thread_p,
DB_VALUE key,
BTID_INT btid_int,
BTREE_DELETE_HELPER delete_helper,
PAGE_PTR  leaf_page,
RECDES leaf_record,
LEAF_REC leaf_info,
int  offset_after_key,
BTREE_SEARCH_KEY_HELPER search_key,
PAGE_PTR overflow_page,
PAGE_PTR  prev_page,
BTREE_NODE_TYPE  node_type,
int  offset_to_object 
)
static
static int btree_key_remove_object_and_keep_visible_first ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
bool restart,
void *  other_args 
)
static

Definition at line 30844 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_delete_log, BTREE_DELETE_MODIFY_ARGS, BTREE_DELETE_MODIFY_MSG, BTREE_DELETE_MVCC_INFO, BTREE_DELETE_OID, btree_delete_sysop_end(), btree_find_oid_and_its_page(), BTREE_IS_UNIQUE, BTREE_KEY_FOUND, btree_key_remove_object(), btree_leaf_change_first_object(), btree_leaf_get_first_object(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, btree_multicol_key_is_null(), BTREE_MVCC_INFO_DELID, BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE, BTREE_OBJINFO_AS_ARGS, BTREE_OBJINFO_MSG, BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_DELETE_UNDO_INSERT_DELID, BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OVERFLOW_NODE, btree_overflow_remove_object(), btree_read_record(), btree_record_remove_object_internal(), BTREE_RV_BUFFER_SIZE, BTREE_RV_DEBUG_ID_UNDO_INS_UNQ_MUPD, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_REDO_SET_DEBUG_INFO, BTREE_RV_UNDOREDO_SET_DEBUG_INFO, btree_set_unknown_key_error(), btree_object_info::class_oid, COPY, recdes::data, DB_IS_NULL, DB_PAGESIZE, ER_BTREE_UNKNOWN_KEY, ER_FAILED, btree_mvcc_info::insert_mvccid, IO_MAX_PAGE_SIZE, btree_delete_helper::is_system_op_started, btree_delete_helper::leaf_addr, recdes::length, log_append_compensate_with_undo_nxlsa(), log_append_undoredo_data(), LOG_FIND_CURRENT_TDES(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, log_sysop_start(), LSA_COPY(), btree_delete_helper::match_mvccinfo, btree_object_info::mvcc_info, NO_ERROR, NOT_FOUND, NULL, log_data_addr::offset, btree_object_info::oid, OID_EQ, PEEK_KEY_VALUE, pgbuf_get_latch_mode(), pgbuf_get_lsa(), pgbuf_get_vpid_ptr(), PGBUF_LATCH_WRITE, pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_delete_helper::purpose, btree_delete_helper::reference_lsa, btree_search_key_helper::result, btree_delete_helper::rv_redo_data, btree_delete_helper::rv_redo_data_ptr, RVBT_RECORD_MODIFY_COMPENSATE, RVBT_RECORD_MODIFY_UNDOREDO, S_SUCCESS, btree_delete_helper::second_object_info, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), btid_int::sys_btid, btid_int::unique_pk, log_data_addr::vfid, and btid::vfid.

Referenced by btree_delete_internal().

Here is the caller graph for this function:

int btree_keyval_search ( THREAD_ENTRY thread_p,
BTID btid,
SCAN_OPERATION_TYPE  scan_op_type,
BTREE_SCAN bts,
key_val_range kv_range,
OID class_oid,
FILTER_INFO filter,
INDX_SCAN_ID isidp,
bool  is_all_class_srch 
)
void btree_leaf_change_first_object ( THREAD_ENTRY thread_p,
RECDES recp,
BTID_INT btid,
OID oidp,
OID class_oidp,
BTREE_MVCC_INFO mvcc_info,
int *  key_offset,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
static void btree_leaf_clear_flag ( RECDES recp,
short  record_flag 
)
static

Definition at line 3474 of file btree.c.

References assert, BTREE_LEAF_RECORD_MASK, recdes::data, OR_GET_SHORT, OR_OID_SLOTID, and OR_PUT_SHORT.

Referenced by btree_leaf_record_change_overflow_link().

Here is the caller graph for this function:

static short btree_leaf_get_flag ( RECDES recp)
static

Definition at line 3376 of file btree.c.

References BTREE_LEAF_RECORD_MASK, recdes::data, OR_GET_SHORT, OR_OID_SLOTID, and STATIC_INLINE.

Referenced by btree_leaf_change_first_object().

Here is the caller graph for this function:

static int btree_leaf_get_vpid_for_overflow_oids ( RECDES rec,
VPID vpid 
)
static
static bool btree_leaf_lsa_eq ( THREAD_ENTRY thread_p,
LOG_LSA a,
LOG_LSA b 
)
static

Definition at line 22263 of file btree.c.

References assert, assert_release, LSA_EQ(), and NULL.

static int btree_leaf_record_replace_first_with_last ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
BTREE_DELETE_HELPER delete_helper,
PAGE_PTR  leaf_page,
RECDES leaf_record,
BTREE_SEARCH_KEY_HELPER search_key,
OID last_oid,
OID last_class_oid,
BTREE_MVCC_INFO last_mvcc_info,
int  offset_to_last_object 
)
static
static void btree_leaf_set_flag ( RECDES recp,
short  record_flag 
)
static
static int btree_merge_node ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  P,
PAGE_PTR  Q,
PAGE_PTR  R,
INT16  p_slot_id,
VPID child_vpid,
BTREE_MERGE_STATUS  status 
)
static

Definition at line 10026 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, assert_release, btree_clear_key_value(), BTREE_DEBUG_DUMP_SIMPLE, btree_delete_overflow_key(), btree_get_next_page(), btree_get_node_header(), btree_init_temp_key_value(), btree_is_fence_key(), BTREE_LEAF_NODE, BTREE_MAX_ALIGN, btree_node_common_prefix(), btree_node_number_of_keys(), btree_node_size_uncompressed(), BTREE_NON_LEAF_NODE, btree_read_fixed_portion_of_non_leaf_record(), btree_read_record_without_decompression(), btree_recompress_record(), btree_rv_write_log_record(), btree_set_vpid_previous_vpid(), btree_verify_node(), btree_write_default_split_info(), COPY, recdes::data, DB_IS_NULL, DB_PAGESIZE, db_private_alloc, db_private_free_and_init, DB_TYPE_MIDXKEY, DONT_FREE, ER_FAILED, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, i, IO_MAX_PAGE_SIZE, non_leaf_rec::key_len, btid_int::key_type, log_append_redo_data2(), log_append_undo_data(), log_append_undo_data2(), log_append_undoredo_data2(), MAX_ALIGNMENT, btree_node_header::max_key_len, MAX_LEAF_REC_NUM, MAX_MERGE_ALIGN_WASTE, NEXT_MERGE_RECORD, btree_node_header::next_vpid, NO_ERROR, btree_node_header::node_level, NULL, NULL_SLOTID, log_data_addr::offset, PAGE_BTREE, vpid::pageid, PEEK, PEEK_KEY_VALUE, perfmon_inc_stat(), pgbuf_check_page_ptype(), pgbuf_get_vpid_ptr(), pgbuf_set_dirty(), pgbuf_unfix_and_init, log_data_addr::pgptr, pr_midxkey_common_prefix(), btree_node_header::prev_vpid, prm_get_integer_value(), PRM_ID_ER_BTREE_DEBUG, PSTAT_BT_NUM_MERGES, PTR_ALIGN, RVBT_COPYPAGE, RVBT_MARK_DEALLOC_PAGE, RVBT_NDRECORD_DEL, S_SUCCESS, SP_SUCCESS, spage_delete(), spage_get_record(), spage_insert(), btree_node_header::split_info, btid_int::sys_btid, TP_DOMAIN_TYPE, log_data_addr::vfid, btid::vfid, vpid::volid, VPID_COPY, VPID_ISNULL, and VPID_SET_NULL.

Referenced by btree_merge_node_and_advance().

Here is the caller graph for this function:

static int btree_merge_node_and_advance ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR crt_page,
PAGE_PTR advance_to_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static

Definition at line 29986 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_delete_log, btree_get_node_header(), BTREE_MERGE_NO, btree_merge_node(), btree_merge_root(), BTREE_MERGE_TRY, btree_multicol_key_is_null(), btree_node_mergeable(), btree_node_number_of_keys(), btree_read_fixed_portion_of_non_leaf_record(), btree_search_leaf_page(), btree_search_nonleaf_page(), CAN_MERGE_WHEN_EMPTY, DB_IS_NULL, DB_PAGESIZE, er_clear(), er_errid(), ER_FAILED, ER_PAGE_LATCH_PROMOTE_FAIL, error(), FILE_BTREE, file_dealloc(), FORCE_MERGE_WHEN_EMPTY, btree_delete_helper::is_root, btree_delete_helper::is_system_op_started, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), LSA_INITIALIZER, btree_node_header::max_key_len, NO_ERROR, btree_node_header::node_level, btree_delete_helper::nonleaf_latch_mode, NULL, OLD_PAGE, OLD_PAGE_IF_IN_BUFFER, PAGE_BTREE, PEEK, pgbuf_check_page_ptype(), pgbuf_fix, pgbuf_get_latch_mode(), pgbuf_get_lsa(), pgbuf_is_io_stressful(), PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, PGBUF_PAGE_MODIFY_ARGS, PGBUF_PAGE_MODIFY_MSG, PGBUF_PROMOTE_ONLY_READER, pgbuf_promote_read_latch, PGBUF_PROMOTE_SHARED_READER, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, non_leaf_rec::pnt, S_SUCCESS, btree_search_key_helper::slotid, spage_check_num_slots(), spage_get_free_space(), spage_get_record(), spage_number_of_slots(), btid_int::sys_btid, btid::vfid, VPID_AS_ARGS, VPID_COPY, VPID_EQ, VPID_INITIALIZER, and VPID_ISNULL.

Referenced by btree_delete_internal(), and btree_online_index_list_dispatcher().

Here is the caller graph for this function:

int btree_multicol_key_has_null ( DB_VALUE key)
static bool btree_node_is_compressed ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  page_ptr 
)
static
void btree_online_index_change_state ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object,
MVCCID  new_state,
char **  rv_undo_data,
char **  rv_redo_data 
)
static
static void btree_online_index_check_state ( MVCCID  state)
inlinestatic
int btree_online_index_check_unique_constraint ( THREAD_ENTRY thread_p,
BTID btid,
const char *  index_name,
OID class_oid 
)
int btree_online_index_dispatcher ( THREAD_ENTRY thread_p,
BTID btid,
DB_VALUE key,
OID cls_oid,
OID oid,
int  unique,
BTREE_OP_PURPOSE  purpose,
LOG_LSA undo_nxlsa 
)
static bool btree_online_index_is_delete_flag_state ( MVCCID  state)
inlinestatic
static bool btree_online_index_is_insert_flag_state ( MVCCID  state)
inlinestatic

Definition at line 33223 of file btree.c.

References BTREE_ONLINE_INDEX_INSERT_FLAG_STATE.

Referenced by btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), and btree_key_online_index_tran_insert_DF().

Here is the caller graph for this function:

static bool btree_online_index_is_normal_state ( MVCCID  state)
inlinestatic
int btree_online_index_list_dispatcher ( THREAD_ENTRY thread_p,
BTID btid,
OID class_oid,
btree_insert_list insert_list,
int  unique,
BTREE_OP_PURPOSE  purpose,
LOG_LSA undo_nxlsa 
)

Definition at line 33293 of file btree.c.

References assert, BTREE_DELETE_CLASS_OID, BTREE_DELETE_OID, btree_fix_root_for_delete(), btree_fix_root_for_insert(), BTREE_INSERT_CLASS_OID, BTREE_INSERT_OID, BTREE_IS_UNIQUE, BTREE_KEY_NOTFOUND, btree_key_online_index_IB_insert_list(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), btree_key_online_index_tran_insert_DF(), btree_merge_node_and_advance(), btree_multicol_key_is_null(), BTREE_OP_ONLINE_INDEX_IB_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_TRAN_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_INSERT, btree_search_key_and_apply_functions(), BTREE_SEARCH_KEY_HELPER_INITIALIZER, btree_split_node_and_advance(), btree_insert_helper::compensate_undo_nxlsa, COPY_OID, DB_IS_NULL, db_private_free, btree_helper::delete_helper, ER_FAILED, btree_insert_list::get_key(), btree_insert_list::get_oid(), btree_helper::insert_helper, btree_insert_helper::insert_list, btree_insert_helper::log_operations, btree_delete_helper::log_operations, logtb_tran_update_unique_stats(), LSA_COPY(), NO_ERROR, NULL, OID_SET_NULL, btree_insert_helper::op_type, btree_delete_helper::op_type, btree_insert_helper::printed_key, btree_delete_helper::printed_key, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btree_insert_helper::purpose, btree_delete_helper::purpose, btree_delete_helper::reference_lsa, btree_search_key_helper::result, SINGLE_ROW_DELETE, and SINGLE_ROW_INSERT.

Referenced by btree_online_index_dispatcher(), and index_builder_loader_task::execute().

Here is the caller graph for this function:

static void btree_online_index_set_delete_flag_state ( MVCCID state)
inlinestatic

Definition at line 33247 of file btree.c.

References BTREE_ONLINE_INDEX_DELETE_FLAG_STATE.

Referenced by btree_key_online_index_tran_delete(), and btree_key_online_index_tran_insert_DF().

Here is the caller graph for this function:

static void btree_online_index_set_insert_flag_state ( MVCCID state)
inlinestatic

Definition at line 33241 of file btree.c.

References BTREE_ONLINE_INDEX_INSERT_FLAG_STATE.

Referenced by btree_key_online_index_tran_insert().

Here is the caller graph for this function:

static void btree_online_index_set_normal_state ( MVCCID state)
inlinestatic

Definition at line 33253 of file btree.c.

References BTREE_ONLINE_INDEX_NORMAL_FLAG_STATE.

Referenced by btree_key_online_index_IB_insert().

Here is the caller graph for this function:

STATIC_INLINE const char * btree_op_type_to_string ( int  op_type)
static int btree_or_get_mvccinfo ( OR_BUF buf,
BTREE_MVCC_INFO mvcc_info,
short  btree_mvcc_flags 
)
static
static int btree_or_put_mvccinfo ( OR_BUF buf,
BTREE_MVCC_INFO mvcc_info 
)
static

Definition at line 21451 of file btree.c.

References BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, btree_mvcc_info::delete_mvccid, btree_mvcc_info::insert_mvccid, NO_ERROR, and or_put_mvccid().

Referenced by btree_or_put_object().

Here is the caller graph for this function:

static int btree_overflow_remove_object ( THREAD_ENTRY thread_p,
DB_VALUE key,
BTID_INT btid_int,
BTREE_DELETE_HELPER delete_helper,
PAGE_PTR overflow_page,
PAGE_PTR  prev_page,
PAGE_PTR  leaf_page,
RECDES leaf_record,
BTREE_SEARCH_KEY_HELPER search_key,
int  offset_to_object 
)
static
char* btree_pack_mvccinfo ( char *  ptr,
BTREE_MVCC_INFO mvcc_info 
)

Definition at line 21369 of file btree.c.

References BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, btree_mvcc_info::delete_mvccid, btree_mvcc_info::insert_mvccid, NULL, and or_pack_mvccid().

Referenced by btree_construct_leafs().

Here is the caller graph for this function:

static char * btree_pack_object ( char *  ptr,
BTID_INT btid_int,
BTREE_NODE_TYPE  node_type,
RECDES record,
BTREE_OBJECT_INFO object_info 
)
static
int btree_packed_mvccinfo_size ( BTREE_MVCC_INFO mvcc_info)

Definition at line 21394 of file btree.c.

References BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, NULL, and OR_MVCCID_SIZE.

Referenced by btree_construct_leafs().

Here is the caller graph for this function:

static void btree_perf_ovf_oids_fix_time ( THREAD_ENTRY thread_p,
PERF_UTIME_TRACKER *  track 
)
inlinestatic
static void btree_perf_unique_lock_time ( THREAD_ENTRY thread_p,
PERF_UTIME_TRACKER *  track,
LOCK  lock 
)
inlinestatic

Definition at line 985 of file btree.c.

References PSTAT_BT_UNIQUE_RLOCKS, PSTAT_BT_UNIQUE_WLOCKS, and S_LOCK.

Referenced by btree_key_find_and_lock_unique_of_non_unique().

Here is the caller graph for this function:

int btree_prepare_bts ( THREAD_ENTRY thread_p,
BTREE_SCAN bts,
BTID btid,
INDX_SCAN_ID index_scan_id_p,
key_val_range kv_range,
FILTER_INFO filter,
const OID match_class_oid,
DB_BIGINT key_limit_upper,
DB_BIGINT key_limit_lower,
bool  need_to_check_null,
void *  bts_other 
)

Definition at line 15049 of file btree.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, assert_release, scan_attrs::attr_ids, btree_scan::btid_int, filter_info::btree_attr_ids, btree_fix_root_with_info(), btree_get_creator_mvccid(), BTREE_IS_PART_KEY_DESC, btree_multicol_key_is_null(), btree_scan::bts_other, btree_scan::C_vpid, indx_scan_id::check_not_vacuumed, btid_int::copy_buf, indx_scan_id::copy_buf, btid_int::copy_buf_len, indx_scan_id::copy_buf_len, COPY_OID, db_get_midxkey(), DB_IS_NULL, db_make_null(), DB_TYPE_MIDXKEY, DB_VALUE_TYPE, db_midxkey::domain, EQ_NA, ER_BTREE_INVALID_RANGE, ER_ERROR_SEVERITY, ER_FAILED, er_set(), GE_INF, GE_LE, GE_LT, GT_INF, GT_LE, GT_LT, i, btree_scan::index_scan_idp, indx_scan_id::indx_info, INF_INF, INF_LE, INF_LT, btree_scan::is_btid_int_valid, btree_scan::is_scan_started, key_val_range::is_truncated, key_val_range::key1, key_val_range::key2, btree_scan::key_filter, btree_scan::key_filter_storage, btree_scan::key_limit_lower, btree_scan::key_limit_upper, btree_scan::key_range, btree_scan::key_range_max_value_equal, btid_int::key_type, LOG_CHECK_LOG_APPLIER, btree_keyrange::lower_key, btree_scan::match_class_oid, MVCCID_IS_VALID, btree_scan::n_oids_read, btree_scan::n_oids_read_last_iteration, db_midxkey::ncolumns, btree_scan::need_to_check_null, tp_domain::next, NO_ERROR, NULL, scan_attrs::num_attrs, key_val_range::num_index_term, btree_keyrange::num_index_term, filter_info::num_vstr_ptr, OID_ISNULL, indx_scan_id::oid_list, btree_scan::oid_ptr, btree_iscan_oid_list::oidp, vpid::pageid, btid_int::part_key_desc, PGBUF_LATCH_READ, pgbuf_unfix_and_init, tp_domain::precision, prm_get_bool_value(), PRM_ID_ORACLE_STYLE_EMPTY_STRING, btree_scan::qualified_keys, key_val_range::range, btree_keyrange::range, range_reverse(), btree_scan::read_keys, btid::root_pageid, filter_info::scan_attrs, tp_domain::setdomain, btid_int::topclass_oid, tp_domain_free(), TP_DOMAIN_TYPE, btree_keyrange::upper_key, indx_info::use_desc_index, btree_scan::use_desc_index, vacuum_is_mvccid_vacuumed(), btid::vfid, vpid::volid, vfid::volid, VPID_ISNULL, and filter_info::vstr_ids.

Referenced by btree_find_foreign_key(), btree_get_next_key_info(), btree_keyval_search(), btree_load_check_fk(), locator_check_btree_entries(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), and scan_get_index_oidset().

Here is the caller graph for this function:

static void btree_print_space ( FILE *  fp,
int  n 
)
static

Definition at line 8820 of file btree.c.

Referenced by btree_dump_leaf_record(), btree_dump_non_leaf_record(), and btree_dump_page().

Here is the caller graph for this function:

static int btree_range_scan_count_oids_leaf_and_one_ovf ( THREAD_ENTRY thread_p,
BTREE_SCAN bts 
)
static
static int btree_range_scan_read_record ( THREAD_ENTRY thread_p,
BTREE_SCAN bts 
)
static
int btree_range_scan_select_visible_oids ( THREAD_ENTRY thread_p,
BTREE_SCAN bts 
)

Definition at line 25122 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_scan::btid_int, btree_get_next_overflow_vpid(), BTREE_IS_UNIQUE, btree_iss_set_key(), BTREE_LEAF_NODE, BTREE_OVERFLOW_NODE, btree_perf_ovf_oids_fix_time(), btree_range_scan_count_oids_leaf_and_one_ovf(), btree_record_get_num_oids(), btree_record_process_objects(), btree_select_visible_object_for_range_scan(), BTS_IS_HARD_CAPACITY_ENOUGH, BTS_IS_INDEX_COVERED, BTS_IS_INDEX_ISS, BTS_IS_INDEX_MRO, BTS_IS_SOFT_CAPACITY_ENOUGH, BTS_KEY_IS_CONSUMED, BTS_NEED_COUNT_ONLY, btree_scan::C_page, btree_scan::C_vpid, index_skip_scan::current_op, btree_scan::end_one_iteration, btree_scan::end_scan, ER_FAILED, btree_scan::index_scan_idp, btree_scan::is_interrupted, btree_scan::is_key_partially_processed, indx_scan_id::iss, ISS_OP_DO_RANGE_SEARCH, ISS_OP_GET_FIRST_KEY, ISS_OP_SEARCH_NEXT_DISTINCT_KEY, btree_scan::key_record, btree_scan::key_status, btree_scan::leaf_rec_info, btree_scan::n_oids_read_last_iteration, NO_ERROR, NULL, btree_scan::O_vpid, btree_scan::offset, OLD_PAGE, OR_OID_SIZE, leaf_rec::ovfl, PEEK, pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, S_SUCCESS, spage_get_record(), btid_int::unique_pk, VPID_COPY, VPID_INITIALIZER, VPID_ISNULL, and VPID_SET_NULL.

Referenced by btree_keyval_search(), locator_check_btree_entries(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), and scan_get_index_oidset().

Here is the caller graph for this function:

static int btree_read_fixed_portion_of_non_leaf_record_from_orbuf ( OR_BUF buf,
NON_LEAF_REC nlf_rec 
)
static

Definition at line 3581 of file btree.c.

References assert, non_leaf_rec::key_len, NO_ERROR, or_get_int(), or_get_short(), vpid::pageid, non_leaf_rec::pnt, rc, vpid::volid, and VPID_ISNULL.

Referenced by btree_read_record_without_decompression().

Here is the caller graph for this function:

int btree_read_record ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  pgptr,
RECDES rec,
DB_VALUE key,
void *  rec_header,
BTREE_NODE_TYPE  node_type,
bool clear_key,
int *  offset,
int  copy_key,
BTREE_SCAN bts 
)

Definition at line 4233 of file btree.c.

References assert, btree_clear_key_value(), btree_init_temp_key_value(), btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_FENCE, BTREE_LEAF_RECORD_OVERFLOW_KEY, btree_node_common_prefix(), btree_read_record_without_decompression(), btree_scan::common_prefix, COMMON_PREFIX_UNKNOWN, DB_TYPE_MIDXKEY, DB_VALUE_TYPE, error(), NO_ERROR, NULL, PEEK, PEEK_KEY_VALUE, pr_midxkey_add_prefix(), REC_HOME, spage_get_record(), and recdes::type.

Referenced by btree_build_nleafs(), btree_check_page_key(), btree_delete_meta_record(), btree_find_key_from_leaf(), btree_find_min_or_max_key(), btree_find_split_point(), btree_fix_ovfl_oid_page(), btree_get_next_node_info(), btree_get_stats_key(), btree_get_subtree_capacity(), btree_get_unique_statistics(), btree_get_value_from_leaf_slot(), btree_is_slot_visible(), btree_key_delete_remove_object(), btree_key_find_and_insert_delete_mvccid(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_unique_version_oid(), btree_key_insert_new_object(), btree_key_lock_and_append_object_unique(), btree_key_online_index_IB_insert(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), btree_key_online_index_tran_insert_DF(), btree_key_record_check_no_visible(), btree_key_relocate_last_into_ovf(), btree_key_remove_delete_mvccid(), btree_key_remove_insert_mvccid(), btree_key_remove_object_and_keep_visible_first(), btree_leaf_is_key_between_min_max(), btree_range_scan_read_record(), btree_rv_record_modify_internal(), btree_set_split_point(), and btree_verify_subtree().

static int btree_read_record_without_decompression ( THREAD_ENTRY thread_p,
BTID_INT btid,
RECDES Rec,
DB_VALUE key,
void *  rec_header,
BTREE_NODE_TYPE  node_type,
bool clear_key,
int *  offset,
int  copy 
)
static

Definition at line 4323 of file btree.c.

References assert, btree_clear_key_value(), BTREE_IS_UNIQUE, btree_leaf_get_vpid_for_overflow_oids(), btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_CLASS_OID, BTREE_LEAF_RECORD_OVERFLOW_KEY, BTREE_LEAF_RECORD_OVERFLOW_OIDS, btree_load_overflow_key(), btree_log_if_enabled, BTREE_NORMAL_KEY, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OVERFLOW_KEY, btree_read_fixed_portion_of_non_leaf_record_from_orbuf(), btree_record_object_is_flagged(), or_buf::buffer, CAST_BUFLEN, btid_int::copy_buf, btid_int::copy_buf_len, COPY_KEY_VALUE, recdes::data, DB_IS_NULL, db_make_null(), DB_TYPE_MIDXKEY, pr_type::id, pr_type::index_readval(), non_leaf_rec::key_len, leaf_rec::key_len, btid_int::key_type, recdes::length, db_value::need_clear, NO_ERROR, btid_int::nonleaf_key_type, NULL, or_advance(), or_get_int(), or_get_short(), or_init(), OR_INT_SIZE, OR_MVCCID_SIZE, OR_OID_SIZE, leaf_rec::ovfl, vpid::pageid, or_buf::ptr, PTR_ALIGN, QSTR_IS_ANY_CHAR_OR_BIT, rc, REC_HOME, tp_domain::type, recdes::type, btid_int::unique_pk, vpid::volid, and VPID_SET_NULL.

Referenced by btree_compress_node(), btree_dump_leaf_record(), btree_dump_non_leaf_record(), btree_merge_node(), btree_node_common_prefix(), btree_node_size_uncompressed(), btree_read_record(), btree_recompress_record(), btree_search_leaf_page(), btree_search_nonleaf_page(), btree_verify_leaf_node(), btree_verify_nonleaf_node(), and page_key_boundary::set_value().

Here is the caller graph for this function:

static void btree_record_add_delid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object,
MVCCID  delete_mvccid,
char **  rv_undo_data,
char **  rv_redo_data 
)
static
static void btree_record_append_object ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
BTREE_OBJECT_INFO object_info,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
static
static int btree_record_get_last_object ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES recp,
BTREE_NODE_TYPE  node_type,
int  after_key_offset,
OID oidp,
OID class_oid,
BTREE_MVCC_INFO mvcc_info,
int *  last_oid_mvcc_offset 
)
static
static void btree_record_object_clear_mvcc_flags ( char *  rec_data,
short  mvcc_flags 
)
static

Definition at line 3493 of file btree.c.

References assert, BTREE_OID_MVCC_FLAGS_MASK, OR_GET_SHORT, OR_OID_VOLID, and OR_PUT_SHORT.

Referenced by btree_remove_mvccid().

Here is the caller graph for this function:

static void btree_record_object_set_mvcc_flags ( char *  data,
short  mvcc_flags 
)
static

Definition at line 3456 of file btree.c.

References assert, BTREE_OID_MVCC_FLAGS_MASK, OR_GET_SHORT, OR_OID_VOLID, and OR_PUT_SHORT.

Referenced by btree_add_mvccid(), btree_leaf_change_first_object(), btree_leaf_record_handle_first_overflow(), and btree_write_record().

Here is the caller graph for this function:

static int btree_record_process_objects ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
BTREE_NODE_TYPE  node_type,
RECDES record,
int  after_key_offset,
bool stop,
BTREE_PROCESS_OBJECT_FUNCTION func,
void *  args 
)
static
static void btree_record_remove_delid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object,
char **  rv_undo_data,
char **  rv_redo_data 
)
static
static void btree_record_remove_insid ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object,
char **  rv_undo_data,
char **  rv_redo_data,
int *  displacement 
)
static
static void btree_record_remove_last_object ( THREAD_ENTRY thread_p,
BTID_INT btid,
RECDES recp,
BTREE_NODE_TYPE  node_type,
int  last_oid_mvcc_offset,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
static
static void btree_record_remove_object_internal ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
BTREE_NODE_TYPE  node_type,
int  offset_to_object,
char **  rv_undo_data,
char **  rv_redo_data,
int *  displacement 
)
static
static int btree_remove_delete_mvccid_unique_internal ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
BTREE_DELETE_HELPER helper,
PAGE_PTR  leaf_page,
RECDES leaf_record,
BTREE_NODE_TYPE  node_type,
PAGE_PTR  overflow_page,
RECDES overflow_record,
int  offset_to_object,
char **  rv_undo_data,
char **  rv_redo_data 
)
static
static void btree_remove_mvccid ( RECDES record,
int  oid_offset,
int  mvccid_offset,
short  flag,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
inlinestatic
static DISK_ISVALID btree_repair_prev_link_by_class_oid ( THREAD_ENTRY thread_p,
OID oid,
BTID idx_btid,
bool  repair 
)
static
static int btree_replace_first_oid_with_ovfl_oid ( THREAD_ENTRY thread_p,
BTID_INT btid,
DB_VALUE key,
BTREE_DELETE_HELPER delete_helper,
PAGE_PTR  leaf_page,
BTREE_SEARCH_KEY_HELPER search_key,
RECDES leaf_rec,
VPID ovfl_vpid 
)
static

Definition at line 9250 of file btree.c.

References recdes::area_size, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_check_valid_record(), btree_delete_log, BTREE_DELETE_MODIFY_ARGS, BTREE_DELETE_MODIFY_MSG, btree_is_delete_object_purpose(), BTREE_KEY_FOUND, btree_leaf_change_first_object(), btree_leaf_get_first_object(), BTREE_MAX_ALIGN, BTREE_OBJINFO_AS_ARGS, BTREE_OBJINFO_MSG, BTREE_OP_DELETE_UNDO_INSERT, BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OVERFLOW_NODE, btree_overflow_record_replace_object(), btree_overflow_remove_object(), btree_record_get_last_object(), BTREE_RV_BUFFER_SIZE, BTREE_RV_DEBUG_ID_SWAP_LEAF, BTREE_RV_GET_DATA_LENGTH(), BTREE_RV_UNDOREDO_SET_DEBUG_INFO, btree_object_info::class_oid, COPY, COPY_OID, recdes::data, DB_PAGESIZE, DONT_FREE, ER_FAILED, IO_MAX_PAGE_SIZE, btree_delete_helper::is_system_op_started, btree_delete_helper::leaf_addr, recdes::length, log_append_undoredo_data(), LOG_RV_RECORD_SET_MODIFY_MODE(), LOG_RV_RECORD_UPDATE_PARTIAL, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), LSA_COPY(), btree_object_info::mvcc_info, NO_ERROR, NULL, btree_delete_helper::object_info, log_data_addr::offset, btree_object_info::oid, OID_EQ, OLD_PAGE, PAGE_BTREE, pgbuf_check_page_ptype(), pgbuf_fix, pgbuf_get_lsa(), PGBUF_LATCH_WRITE, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, log_data_addr::pgptr, PTR_ALIGN, btree_delete_helper::purpose, btree_search_key_helper::result, btree_delete_helper::rv_redo_data, btree_delete_helper::rv_redo_data_ptr, RVBT_RECORD_MODIFY_UNDOREDO, S_SUCCESS, btree_search_key_helper::slotid, SP_SUCCESS, spage_get_record(), spage_update(), and btid_int::sys_btid.

Referenced by btree_leaf_remove_object().

Here is the caller graph for this function:

static void btree_rv_log_insert_object ( THREAD_ENTRY thread_p,
const BTREE_INSERT_HELPER insert_helper,
LOG_DATA_ADDR addr,
int  undo_length,
int  redo_length,
const char *  undo_data,
const char *  redo_data 
)
static
int btree_rv_newpage_redo_init ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
int btree_rv_nodehdr_undo_insert ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
void btree_rv_noderec_dump ( FILE *  fp,
int  length,
void *  data 
)
void btree_rv_noderec_dump_slot_id ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 17334 of file btree.c.

int btree_rv_noderec_undo_insert ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
int btree_rv_nop ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)

Definition at line 18017 of file btree.c.

References assert, DONT_FREE, NO_ERROR, NULL, pgbuf_set_dirty(), and log_rcv::pgptr.

void btree_rv_ovfid_dump ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 17079 of file btree.c.

References vfid::fileid, and vfid::volid.

int btree_rv_pagerec_delete ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
static int btree_rv_record_modify_internal ( THREAD_ENTRY thread_p,
LOG_RCV rcv,
bool  is_undo 
)
static

Definition at line 28849 of file btree.c.

References _er_log_debug(), recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ALIGN, ASSERT_ERROR, assert_release, btree_check_valid_record(), btree_clear_key_value(), btree_get_node_header(), btree_init_temp_key_value(), BTREE_IS_UNIQUE, btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_OVERFLOW_KEY, BTREE_MAX_ALIGN, BTREE_MVCC_INFO_INITIALIZER, btree_node_number_of_keys(), BTREE_OBJECT_FIXED_SIZE, BTREE_OVERFLOW_NODE, btree_read_record(), BTREE_RV_FLAGS_MASK, BTREE_RV_HAS_DEBUG_INFO, BTREE_RV_IS_UPDATE_MAX_KEY_LEN, BTREE_RV_OVERFLOW_FLAG, BTREE_RV_REDO_NO_ID, btree_split_next_pivot(), btree_unpack_object(), CAST_BUFLEN, COPY, log_rcv::data, recdes::data, DB_PAGESIZE, db_private_free, btree_mvcc_info::delete_mvccid, DISK_VPID_ALIGNED_SIZE, DONT_FREE, ER_FAILED, HEADER, if(), btree_mvcc_info::insert_mvccid, INT_ALIGNMENT, IO_MAX_PAGE_SIZE, btid_int::key_type, log_rcv::length, recdes::length, LOG_RV_RECORD_IS_DELETE(), LOG_RV_RECORD_IS_INSERT(), LOG_RV_RECORD_IS_UPDATE_ALL(), LOG_RV_RECORD_IS_UPDATE_PARTIAL(), log_rv_undoredo_record_partial_changes(), btree_node_header::max_key_len, btree_overflow_header::next_vpid, NO_ERROR, NULL, log_rcv::offset, OID_INITIALIZER, OID_SET_NULL, OR_GET_INT, OR_GET_OID, OR_GET_VPID, OR_INT_SIZE, OR_OID_SIZE, or_unpack_domain(), or_unpack_int(), db_identifier::pageid, PEEK_KEY_VALUE, PGBUF_PAGE_STATE_ARGS, pgbuf_set_dirty(), log_rcv::pgptr, btree_node_split_info::pivot, pr_valstring(), btree_delete_helper::printed_key, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, PTR_ALIGN, REC_HOME, db_identifier::slotid, SP_SUCCESS, spage_delete(), spage_get_record(), spage_insert_at(), spage_update(), btree_node_header::split_info, btid_int::topclass_oid, recdes::type, btid_int::unique_pk, and db_identifier::volid.

Referenced by btree_rv_redo_record_modify(), and btree_rv_undo_record_modify().

Here is the caller graph for this function:

int btree_rv_redo_record_modify ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 28822 of file btree.c.

References btree_rv_record_modify_internal().

void btree_rv_roothdr_dump ( FILE *  fp,
int  length,
void *  data 
)

Definition at line 17011 of file btree.c.

References OR_GET_INT, and OR_INT_SIZE.

int btree_rv_save_keyval_for_undo ( BTID_INT btid,
DB_VALUE key,
OID cls_oid,
OID oid,
BTREE_MVCC_INFO mvcc_info,
BTREE_OP_PURPOSE  purpose,
char *  preallocated_buffer,
char **  data,
int *  capacity,
int *  length 
)
int btree_rv_undo_mark_dealloc_page ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int btree_rv_undo_record_modify ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)

Definition at line 28835 of file btree.c.

References btree_rv_record_modify_internal().

int btree_rv_undoredo_copy_page ( THREAD_ENTRY thread_p,
LOG_RCV recv 
)
int btree_rv_util_save_page_records ( THREAD_ENTRY thread_p,
PAGE_PTR  page_ptr,
INT16  first_slotid,
int  rec_cnt,
INT16  ins_slotid,
char *  data,
int *  length 
)

Definition at line 16433 of file btree.c.

References assert, BTREE_MAX_ALIGN, recdes::data, DB_WASTED_ALIGN, er_errid(), ER_FAILED, i, recdes::length, NO_ERROR, PEEK, S_SUCCESS, spage_get_record(), and recdes::type.

Referenced by btree_merge_root(), and btree_split_root().

Here is the caller graph for this function:

static int btree_rv_write_log_record ( char *  log_rec,
int *  log_length,
RECDES recp,
BTREE_NODE_TYPE  node_type 
)
static
static int btree_rv_write_log_record_for_key_insert ( char *  log_rec,
int *  log_length,
INT16  key_len,
RECDES recp 
)
static
static int btree_search_key_and_apply_functions ( THREAD_ENTRY thread_p,
BTID btid,
BTID_INT btid_int,
DB_VALUE key,
BTREE_ROOT_WITH_KEY_FUNCTION root_fnct,
void *  root_args,
BTREE_ADVANCE_WITH_KEY_FUNCTION advance_fnct,
void *  advance_args,
BTREE_PROCESS_KEY_FUNCTION leaf_fnct,
void *  process_key_args,
BTREE_SEARCH_KEY_HELPER search_key,
PAGE_PTR leaf_page_ptr 
)
static
static int btree_search_leaf_page ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  page_ptr,
DB_VALUE key,
BTREE_SEARCH_KEY_HELPER search_key 
)
static
static int btree_select_visible_object_for_range_scan ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
RECDES record,
char *  object_ptr,
OID oid,
OID class_oid,
BTREE_MVCC_INFO mvcc_info,
bool stop,
void *  args 
)
static
static int btree_seq_find_oid_from_ovfl ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
OID oid,
RECDES ovf_record,
char *  initial_oid_ptr,
char *  oid_ptr_lower_bound,
char *  oid_ptr_upper_bound,
BTREE_OP_PURPOSE  purpose,
BTREE_MVCC_INFO match_mvccinfo,
int *  offset_to_object,
BTREE_MVCC_INFO mvcc_info 
)
static
void btree_set_mvcc_flags_into_oid ( MVCC_REC_HEADER p_mvcc_header,
OID oid 
)

Definition at line 21739 of file btree.c.

References BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, MVCC_IS_FLAG_SET, NULL, OR_MVCC_FLAG_VALID_DELID, OR_MVCC_FLAG_VALID_INSID, and db_identifier::volid.

Referenced by btree_construct_leafs().

Here is the caller graph for this function:

void btree_set_mvcc_header_ids_for_update ( THREAD_ENTRY thread_p,
bool  do_delete_only,
bool  do_insert_only,
MVCCID mvcc_id,
MVCC_REC_HEADER mvcc_rec_header 
)
STATIC_INLINE void btree_set_mvccid ( RECDES rec,
int  mvccid_offset,
MVCCID p_mvccid,
char **  rv_undo_data_ptr,
char **  rv_redo_data_ptr 
)
static int btree_set_vpid_previous_vpid ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  page_p,
VPID prev 
)
static
static int btree_split_find_pivot ( int  total,
BTREE_NODE_SPLIT_INFO split_info 
)
static

Definition at line 12271 of file btree.c.

References BTREE_SPLIT_LOWER_BOUND, BTREE_SPLIT_MAX_PIVOT, BTREE_SPLIT_MIN_PIVOT, BTREE_SPLIT_UPPER_BOUND, CEIL_PTVDIV, and btree_node_split_info::pivot.

Referenced by btree_find_split_point().

Here is the caller graph for this function:

static int btree_split_next_pivot ( BTREE_NODE_SPLIT_INFO split_info,
float  new_value,
int  max_index 
)
static

Definition at line 12296 of file btree.c.

References assert, btree_node_split_info::index, NO_ERROR, and btree_node_split_info::pivot.

Referenced by btree_key_insert_new_key(), btree_rv_record_modify_internal(), and btree_split_node().

Here is the caller graph for this function:

static int btree_split_node ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  P,
PAGE_PTR  Q,
PAGE_PTR  R,
VPID P_vpid,
VPID Q_vpid,
VPID R_vpid,
INT16  p_slot_id,
BTREE_NODE_TYPE  node_type,
DB_VALUE key,
BTREE_INSERT_HELPER helper,
VPID child_vpid 
)
static

Definition at line 12653 of file btree.c.

References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_clear_key_value(), btree_compare_key(), btree_compress_node(), BTREE_DEBUG_DUMP_SIMPLE, BTREE_DEBUG_TEST_SPLIT, btree_find_split_point(), btree_get_disk_size_of_key(), BTREE_GET_KEY_LEN_IN_PAGE, btree_get_next_page(), btree_get_node_header(), btree_init_node_header(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_FENCE, btree_leaf_set_flag(), BTREE_MAX_ALIGN, BTREE_MAX_KEYLEN_INPAGE, btree_node_header_redo_log(), btree_node_header_undo_log(), btree_node_number_of_keys(), BTREE_NON_LEAF_NODE, BTREE_NORMAL_KEY, BTREE_OVERFLOW_KEY, btree_rv_write_log_record(), btree_set_vpid_previous_vpid(), btree_split_next_pivot(), btree_split_test(), btree_verify_node(), btree_write_record(), recdes::data, DB_EQ, DB_GT, DB_IS_NULL, DB_LT, DB_PAGESIZE, db_private_free_and_init, DB_UNK, DONT_FREE, ER_FAILED, er_log_debug, FI_TEST, FI_TEST_BTREE_MANAGER_RANDOM_EXIT, pr_type::get_index_size_of_value(), i, IO_MAX_PAGE_SIZE, non_leaf_rec::key_len, btid_int::key_type, log_append_redo_data2(), log_append_undo_data2(), log_append_undoredo_data2(), btree_node_header::max_key_len, btree_node_header::next_vpid, NO_ERROR, btree_node_header::node_level, NULL, NULL_PAGEID, vpid::pageid, PEEK, perfmon_inc_stat(), pgbuf_get_latch_mode(), PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_unfix_and_init, btree_node_split_info::pivot, non_leaf_rec::pnt, btree_node_header::prev_vpid, prm_get_bool_value(), prm_get_integer_value(), PRM_ID_ER_BTREE_DEBUG, PRM_ID_USE_BTREE_FENCE_KEY, PSTAT_BT_NUM_SPLITS, PTR_ALIGN, RVBT_COPYPAGE, RVBT_NDRECORD_INS, S_SUCCESS, SP_SUCCESS, spage_delete(), spage_get_record(), spage_insert_at(), btree_node_header::split_info, btid_int::sys_btid, btid_int::topclass_oid, tp_domain::type, btid::vfid, vpid::volid, VPID_ISNULL, and VPID_SET_NULL.

Referenced by btree_split_node_and_advance().

Here is the caller graph for this function:

static int btree_split_node_and_advance ( THREAD_ENTRY thread_p,
BTID_INT btid_int,
DB_VALUE key,
PAGE_PTR crt_page,
PAGE_PTR advance_to_page,
bool is_leaf,
BTREE_SEARCH_KEY_HELPER search_key,
bool stop,
bool restart,
void *  other_args 
)
static

Definition at line 26588 of file btree.c.

References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, BTID_AS_ARGS, btree_change_root_header_delta(), btree_get_max_new_data_size(), btree_get_new_page(), btree_get_node_header(), BTREE_ID_MSG, btree_insert_log, btree_is_insert_object_purpose(), BTREE_LEAF_NODE, btree_multicol_key_is_null(), btree_node_header_redo_log(), btree_node_number_of_keys(), BTREE_NON_LEAF_NODE, BTREE_OP_INSERT_MVCC_DELID, BTREE_OP_INSERT_NEW_OBJECT, btree_search_leaf_page(), btree_search_nonleaf_page(), btree_split_node(), btree_split_root(), DB_IS_NULL, DONT_FREE, er_errid(), ER_FAILED, ER_PAGE_LATCH_PROMOTE_FAIL, error(), btree_insert_helper::insert_list, btree_insert_helper::is_crt_node_write_latched, btree_insert_helper::is_root, btree_delete_helper::is_system_op_started, btree_insert_helper::key_len_in_page, LOG_ISRESTARTED, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), LSA_INITIALIZER, btree_insert_list::m_boundaries, btree_insert_list::m_use_page_boundary_check, btree_node_header::max_key_len, btree_insert_helper::need_update_max_key_len, NO_ERROR, btree_node_header::node_level, btree_insert_helper::nonleaf_latch_mode, NULL, OLD_PAGE, pgbuf_fix, pgbuf_get_latch_mode(), pgbuf_get_lsa(), pgbuf_get_vpid_ptr(), PGBUF_LATCH_READ, PGBUF_LATCH_WRITE, pgbuf_notify_vacuum_follows(), PGBUF_PAGE_MODIFY_ARGS, PGBUF_PAGE_MODIFY_MSG, PGBUF_PAGE_STATE_ARGS, PGBUF_PAGE_STATE_MSG, PGBUF_PROMOTE_ONLY_READER, pgbuf_promote_read_latch, PGBUF_PROMOTE_SHARED_READER, pgbuf_set_dirty(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btree_insert_helper::purpose, SERVER_MODE, spage_check_num_slots(), spage_get_free_space_without_saving(), btid_int::sys_btid, btid::vfid, VPID_EQ, and VPID_INITIALIZER.

Referenced by btree_insert_internal(), and btree_online_index_list_dispatcher().

Here is the caller graph for this function:

static int btree_split_root ( THREAD_ENTRY thread_p,
BTID_INT btid,
PAGE_PTR  P,
PAGE_PTR  Q,
PAGE_PTR  R,
VPID P_vpid,
VPID Q_vpid,
VPID R_vpid,
BTREE_NODE_TYPE  node_type,
DB_VALUE key,
BTREE_INSERT_HELPER helper,
VPID child_vpid 
)
static

Definition at line 13484 of file btree.c.

References recdes::area_size, ARG_FILE_LINE, assert, btree_clear_key_value(), btree_compare_key(), BTREE_DEBUG_DUMP_SIMPLE, BTREE_DEBUG_TEST_SPLIT, btree_find_split_point(), btree_get_disk_size_of_key(), BTREE_GET_KEY_LEN_IN_PAGE, btree_get_node_level(), btree_get_root_header(), btree_init_node_header(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_FENCE, btree_leaf_set_flag(), BTREE_MAX_ALIGN, BTREE_MAX_KEYLEN_INPAGE, btree_node_header_redo_log(), btree_node_number_of_keys(), BTREE_NON_LEAF_NODE, BTREE_NORMAL_KEY, BTREE_OVERFLOW_KEY, btree_rv_util_save_page_records(), btree_rv_write_log_record(), btree_split_test(), btree_verify_node(), btree_write_default_split_info(), btree_write_record(), recdes::data, DB_EQ, DB_GT, DB_IS_NULL, DB_LT, DB_PAGESIZE, db_private_free_and_init, DB_UNK, DONT_FREE, er_errid(), ER_FAILED, er_log_debug, recset_header::first_slotid, pr_type::get_index_size_of_value(), i, btree_node_split_info::index, IO_MAX_PAGE_SIZE, non_leaf_rec::key_len, btid_int::key_type, log_append_redo_data2(), log_append_undo_data2(), btree_node_header::max_key_len, btree_node_header::next_vpid, NO_ERROR, btree_root_header::node, btree_node_header::node_level, NULL, NULL_PAGEID, vpid::pageid, PEEK, perfmon_inc_stat(), pgbuf_set_dirty(), non_leaf_rec::pnt, btree_node_header::prev_vpid, prm_get_bool_value(), prm_get_integer_value(), PRM_ID_ER_BTREE_DEBUG, PRM_ID_USE_BTREE_FENCE_KEY, PSTAT_BT_NUM_SPLITS, PTR_ALIGN, recset_header::rec_cnt, RVBT_COPYPAGE, RVBT_DEL_PGRECORDS, RVBT_INS_PGRECORDS, RVBT_NDRECORD_INS, S_SUCCESS, SP_SUCCESS, spage_delete(), spage_get_record(), spage_insert_at(), btree_node_header::split_info, btid_int::sys_btid, btid_int::topclass_oid, tp_domain::type, btid::vfid, vpid::volid, VPID_ISNULL, and VPID_SET_NULL.

Referenced by btree_split_node_and_advance().

Here is the caller graph for this function:

static int btree_top_n_items_binary_search ( RANGE_OPT_ITEM **  top_n_items,
int *  att_idxs,
TP_DOMAIN **  domains,
bool desc_order,
DB_VALUE new_key_values,
int  num_keys,
int  first,
int  last,
int *  new_pos 
)
static
static int btree_undo_delete_physical ( THREAD_ENTRY thread_p,
BTID btid,
DB_VALUE key,
OID class_oid,
OID oid,
BTREE_MVCC_INFO mvcc_info,
LOG_LSA undo_nxlsa 
)
static
static int btree_undo_insert_object ( THREAD_ENTRY thread_p,
BTID btid,
OR_BUF buffered_key,
OID oid,
OID class_oid,
MVCCID  insert_mvccid,
LOG_LSA undo_nxlsa 
)
static
static int btree_undo_mvcc_delete ( THREAD_ENTRY thread_p,
BTID btid,
OR_BUF buffered_key,
OID oid,
OID class_oid,
BTREE_MVCC_INFO match_mvccinfo,
LOG_LSA undo_nxlsa 
)
static
char* btree_unpack_mvccinfo ( char *  ptr,
BTREE_MVCC_INFO mvcc_info,
short  btree_mvcc_flags 
)
static char * btree_unpack_object ( char *  ptr,
BTID_INT btid_int,
BTREE_NODE_TYPE  node_type,
RECDES record,
int  after_key_offset,
OID oid,
OID class_oid,
BTREE_MVCC_INFO mvcc_info 
)
static

Definition at line 21490 of file btree.c.

References assert, btree_or_get_object(), BTREE_RECORD_OR_BUF_INIT, NO_ERROR, NULL, and or_buf::ptr.

Referenced by btree_record_get_last_object(), and btree_rv_record_modify_internal().

Here is the caller graph for this function:

int btree_update ( THREAD_ENTRY thread_p,
BTID btid,
DB_VALUE old_key,
DB_VALUE new_key,
OID cls_oid,
OID oid,
int  op_type,
btree_unique_stats unique_stat_info,
int *  unique,
MVCC_REC_HEADER p_mvcc_rec_header 
)
DISK_ISVALID btree_verify_tree ( THREAD_ENTRY thread_p,
const OID class_oid_p,
BTID_INT btid_int,
const char *  btname 
)
static void btree_write_default_split_info ( BTREE_NODE_SPLIT_INFO info)
static

Definition at line 9716 of file btree.c.

References assert, BTREE_SPLIT_DEFAULT_PIVOT, btree_node_split_info::index, NULL, and btree_node_split_info::pivot.

Referenced by btree_merge_node(), btree_merge_root(), and btree_split_root().

Here is the caller graph for this function:

static void btree_write_fixed_portion_of_non_leaf_record ( RECDES rec,
NON_LEAF_REC nlf_rec 
)
static
static void btree_write_fixed_portion_of_non_leaf_record_to_orbuf ( OR_BUF buf,
NON_LEAF_REC nlf_rec 
)
static

Definition at line 3563 of file btree.c.

References assert, non_leaf_rec::key_len, or_put_int(), or_put_short(), vpid::pageid, non_leaf_rec::pnt, vpid::volid, and VPID_ISNULL.

Referenced by btree_write_record().

Here is the caller graph for this function:

static void bts_reset_scan ( THREAD_ENTRY thread_p,
BTREE_SCAN bts 
)
static

Definition at line 671 of file btree.c.

References btree_scan::C_page, btree_scan::is_scan_started, NULL, pgbuf_unfix_and_init, and VPID_SET_NULL.

Referenced by btree_range_scan(), and btree_select_visible_object_for_range_scan().

Here is the caller graph for this function:

static int index_attrs_to_string ( char *  buf,
int  buf_size,
OR_INDEX index_p,
RECDES recdes 
)
static

Definition at line 20431 of file btree.c.

References or_index::asc_desc, assert_release, or_index::atts, db_private_free_and_init, ER_FAILED, error(), i, or_attribute::id, or_index::n_atts, NO_ERROR, NULL, and or_get_attrname().

Referenced by btree_scan_for_show_index_header().

Here is the caller graph for this function:

static const char * node_type_to_string ( short  node_type)
static

Definition at line 20320 of file btree.c.

References BTREE_LEAF_NODE.

Referenced by btree_dump_page().

Here is the caller graph for this function:

BTID* xbtree_add_index ( THREAD_ENTRY thread_p,
BTID btid,
TP_DOMAIN key_type,
OID class_oid,
int  attr_id,
int  unique_pk,
int  num_oids,
int  num_nulls,
int  num_keys 
)
int xbtree_class_test_unique ( THREAD_ENTRY thread_p,
char *  buf,
int  buf_size 
)

Definition at line 6065 of file btree.c.

References BTREE_SET_UNIQUE_VIOLATION_ERROR, ER_BTREE_UNIQUE_FAILED, NO_ERROR, NULL, or_unpack_btid(), and xbtree_test_unique().

Referenced by btree_class_test_unique(), and sbtree_class_test_unique().

Here is the caller graph for this function:

BTREE_SEARCH xbtree_find_unique ( THREAD_ENTRY thread_p,
BTID btid,
SCAN_OPERATION_TYPE  scan_op_type,
DB_VALUE key,
OID class_oid,
OID oid,
bool  is_all_class_srch 
)
int xbtree_get_key_type ( THREAD_ENTRY thread_p,
BTID  btid,
TP_DOMAIN **  key_type 
)
static int xbtree_test_unique ( THREAD_ENTRY thread_p,
BTID btid 
)
static

Definition at line 6099 of file btree.c.

References assert, logtb_get_global_unique_stats(), and NO_ERROR.

Referenced by xbtree_class_test_unique().

Here is the caller graph for this function:

Variable Documentation

const MVCCID BTREE_ONLINE_INDEX_DELETE_FLAG_STATE = 0x8000000000000000 | MVCCID_ALL_VISIBLE
const MVCCID BTREE_ONLINE_INDEX_FLAG_MASK = 0xC000000000000000

Definition at line 1240 of file btree.c.

const MVCCID BTREE_ONLINE_INDEX_INSERT_FLAG_STATE = 0x4000000000000000 | MVCCID_ALL_VISIBLE
const MVCCID BTREE_ONLINE_INDEX_MVCCID_MASK = ~0xC000000000000000

Definition at line 1241 of file btree.c.

Referenced by btree_check_valid_record().

const MVCCID BTREE_ONLINE_INDEX_NORMAL_FLAG_STATE = MVCCID_ALL_VISIBLE
int fixed_pages
static

Definition at line 19239 of file btree.c.