CUBRID Engine  latest
btree.h File Reference
#include "access_spec.hpp"
#include "config.h"
#include "disk_manager.h"
#include "object_domain.h"
#include "oid.h"
#include "lock_manager.h"
#include "log_lsa.hpp"
#include "mvcc.h"
#include "query_evaluator.h"
#include "recovery.h"
#include "statistics.h"
#include "storage_common.h"
#include "scan_manager.h"
Include dependency graph for btree.h:

Go to the source code of this file.

Classes

struct  non_leaf_rec
 
struct  leaf_rec
 
struct  btid_int
 
struct  btree_keyrange
 
struct  btree_scan
 
struct  btree_iscan_oid_list
 
struct  btree_checkscan
 
struct  btree_capacity
 
struct  btree_node_scan_queue_item
 
struct  btree_node_scan
 
struct  btree_mvcc_info
 
struct  btree_object_info
 
struct  key_oid
 
struct  page_key_boundary
 
struct  btree_insert_list
 

Macros

#define SINGLE_ROW_INSERT   1
 
#define SINGLE_ROW_DELETE   2
 
#define SINGLE_ROW_UPDATE   3
 
#define SINGLE_ROW_MODIFY   4 /* used in case of undo */
 
#define MULTI_ROW_INSERT   5
 
#define MULTI_ROW_DELETE   6
 
#define MULTI_ROW_UPDATE   7
 
#define BTREE_IS_MULTI_ROW_OP(op)   (op == MULTI_ROW_INSERT || op == MULTI_ROW_UPDATE || op == MULTI_ROW_DELETE)
 
#define BTREE_NEED_UNIQUE_CHECK(thread_p, op)
 
#define BTREE_CONTINUE   -1
 
#define BTREE_GETOID_AGAIN   -2
 
#define BTREE_GETOID_AGAIN_WITH_CHECK   -3
 
#define BTREE_SEARCH_AGAIN_WITH_CHECK   -4
 
#define BTREE_GOTO_END_OF_SCAN   -5
 
#define BTREE_GOTO_START_LOCKING   -6
 
#define BTREE_GOTO_LOCKING_DONE   -7
 
#define BTREE_RESTART_SCAN   -8
 
#define BTREE_IS_PRIMARY_KEY(unique_pk)   ((unique_pk) & BTREE_CONSTRAINT_PRIMARY_KEY)
 
#define BTREE_IS_UNIQUE(unique_pk)   ((unique_pk) & BTREE_CONSTRAINT_UNIQUE)
 
#define BTREE_IS_PART_KEY_DESC(btid_int)   ((btid_int)->part_key_desc != 0)
 
#define BTREE_NORMAL_KEY   0
 
#define BTREE_OVERFLOW_KEY   1
 
#define BTREE_SET_UNIQUE_VIOLATION_ERROR(THREAD, KEY, OID, C_OID, BTID, BTNM)
 
#define COMMON_PREFIX_UNKNOWN   (-1)
 
#define BTREE_INIT_SCAN(bts)
 
#define BTREE_RESET_SCAN(bts)
 
#define BTREE_END_OF_SCAN(bts)
 
#define BTREE_START_OF_SCAN(bts)   BTREE_END_OF_SCAN(bts)
 
#define BTS_IS_DESCENDING_SCAN(bts)   ((bts)->index_scan_idp->indx_info->use_desc_index)
 
#define BTS_SET_INDEX_SCANID(bts, index_scan_idp)   ((bts)->index_scan_idp = index_scan_idp)
 
#define BTS_SET_KEY_LIMIT(bts, lower, upper)
 
#define BTREE_NODE_SCAN_INIT(bns)
 
#define BTREE_NODE_SCAN_ADD_PAGE_TO_QUEUE(bns, node)
 
#define BTREE_NODE_SCAN_POP_PAGE_FROM_QUEUE(bns, node)
 
#define BTREE_NODE_SCAN_IS_QUEUE_EMPTY(bns)   ((bns)->queue_head == NULL)
 
#define DBVAL_BUFSIZE   4096
 
#define BTREE_INIT_MVCC_HEADER(p_mvcc_rec_header)
 
#define BTREE_MVCC_INFO_INITIALIZER   { 0, MVCCID_ALL_VISIBLE, MVCCID_NULL }
 
#define BTREE_OBJECT_INFO_INITIALIZER   { OID_INITIALIZER, OID_INITIALIZER, BTREE_MVCC_INFO_INITIALIZER }
 

Typedefs

typedef struct or_buf OR_BUF
 
typedef struct non_leaf_rec NON_LEAF_REC
 
typedef struct leaf_rec LEAF_REC
 
typedef struct btid_int BTID_INT
 
typedef struct btree_keyrange BTREE_KEYRANGE
 
typedef struct indx_scan_id INDX_SCAN_ID
 
typedef enum bts_key_status BTS_KEY_STATUS
 
typedef struct btree_scan BTREE_SCAN
 
typedef struct btree_iscan_oid_list BTREE_ISCAN_OID_LIST
 
typedef struct btree_checkscan BTREE_CHECKSCAN
 
typedef struct btree_capacity BTREE_CAPACITY
 
typedef struct btree_node_scan_queue_item BTREE_NODE_SCAN_QUEUE_ITEM
 
typedef struct btree_node_scan BTREE_NODE_SCAN
 
typedef enum btree_op_purpose BTREE_OP_PURPOSE
 
typedef struct btree_mvcc_info BTREE_MVCC_INFO
 
typedef struct btree_object_info BTREE_OBJECT_INFO
 
typedef int BTREE_RANGE_SCAN_PROCESS_KEY_FUNC(THREAD_ENTRY *thread_p, BTREE_SCAN *bts)
 

Enumerations

enum  { BTREE_COERCE_KEY_WITH_MIN_VALUE = 1, BTREE_COERCE_KEY_WITH_MAX_VALUE = 2 }
 
enum  BTREE_NODE_TYPE { BTREE_LEAF_NODE = 0, BTREE_NON_LEAF_NODE, BTREE_OVERFLOW_NODE }
 
enum  bts_key_status { BTS_KEY_IS_NOT_VERIFIED, BTS_KEY_IS_VERIFIED, BTS_KEY_IS_CONSUMED }
 
enum  btree_op_purpose {
  BTREE_OP_NO_OP, BTREE_OP_INSERT_NEW_OBJECT, BTREE_OP_INSERT_MVCC_DELID, BTREE_OP_INSERT_MARK_DELETED,
  BTREE_OP_INSERT_UNDO_PHYSICAL_DELETE, BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_DELETE_OBJECT_PHYSICAL_POSTPONED, BTREE_OP_DELETE_UNDO_INSERT,
  BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD, BTREE_OP_DELETE_UNDO_INSERT_DELID, BTREE_OP_DELETE_VACUUM_OBJECT, BTREE_OP_DELETE_VACUUM_INSID,
  BTREE_OP_NOTIFY_VACUUM, BTREE_OP_ONLINE_INDEX_IB_INSERT, BTREE_OP_ONLINE_INDEX_IB_DELETE, BTREE_OP_ONLINE_INDEX_TRAN_INSERT,
  BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_INSERT, BTREE_OP_ONLINE_INDEX_TRAN_DELETE, BTREE_OP_ONLINE_INDEX_UNDO_TRAN_DELETE
}
 

Functions

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_get_unique_pk (THREAD_ENTRY *thread_p, BTID *btid)
 
int btree_get_unique_statistics (THREAD_ENTRY *thread_p, BTID *btid, int *oid_cnt, int *null_cnt, int *key_cnt)
 
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_stats (THREAD_ENTRY *thread_p, BTREE_STATS *stat_info_p, bool with_fullscan)
 
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_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_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_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_find_min_or_max_key (THREAD_ENTRY *thread_p, BTID *btid, DB_VALUE *key, int flag_minkey)
 
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)
 
TP_DOMAINbtree_read_key_type (THREAD_ENTRY *thread_p, BTID *btid)
 
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)
 
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_roothdr_undo_update (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_update_tran_stats (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)
 
void btree_rv_noderec_dump (FILE *fp, int length, void *data)
 
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_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_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_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)
 
int btree_rv_redo_global_unique_stats_commit (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_undo_global_unique_stats_commit (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_keyval_search (THREAD_ENTRY *thread_p, BTID *btid, SCAN_OPERATION_TYPE scan_op_type, BTREE_SCAN *BTS, key_val_range *key_val_range, OID *class_oid, FILTER_INFO *filter, INDX_SCAN_ID *isidp, 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_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)
 
int btree_coerce_key (DB_VALUE *src_keyp, int keysize, TP_DOMAIN *btree_domainp, int key_minmax)
 
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)
 
DISK_ISVALID btree_repair_prev_link (THREAD_ENTRY *thread_p, OID *oid, BTID *btid, bool repair)
 
int btree_index_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ctx)
 
int btree_index_end_scan (THREAD_ENTRY *thread_p, void **ctx)
 
SCAN_CODE btree_index_next_scan (THREAD_ENTRY *thread_p, int cursor, DB_VALUE **out_values, int out_cnt, void *ctx)
 
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)
 
SCAN_CODE btree_get_next_node_info (THREAD_ENTRY *thread_p, BTID *btid, BTREE_NODE_SCAN *btns, DB_VALUE **node_info)
 
int xbtree_get_key_type (THREAD_ENTRY *thread_p, BTID btid, TP_DOMAIN **key_type)
 
int btree_leaf_get_first_object (BTID_INT *btid, RECDES *recp, OID *oidp, OID *class_oid, BTREE_MVCC_INFO *mvcc_info)
 
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_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)
 
void btree_set_mvcc_header_ids_for_update (THREAD_ENTRY *thread_p, bool do_delete_only, bool do_insert_only, MVCCID *mvccid, MVCC_REC_HEADER *mvcc_rec_header)
 
int btree_compare_btids (void *mem_btid1, void *mem_btid2)
 
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_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_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)
 
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_prepare_bts (THREAD_ENTRY *thread_p, BTREE_SCAN *bts, BTID *btid, INDX_SCAN_ID *index_scan_id_p, key_val_range *key_val_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)
 
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)
 
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_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)
 
int btree_initialize_new_page (THREAD_ENTRY *thread_p, PAGE_PTR page, void *args)
 
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_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)
 
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, BTREE_SCAN *bts)
 
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)
 
PERF_PAGE_TYPE btree_get_perf_btree_page_type (THREAD_ENTRY *thread_p, PAGE_PTR page_ptr)
 
void btree_dump_key (FILE *fp, const DB_VALUE *key)
 
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 *cls_oid, btree_insert_list *insert_list, int unique, BTREE_OP_PURPOSE purpose, LOG_LSA *undo_nxlsa)
 
int btree_rv_keyval_undo_online_index_tran_insert (THREAD_ENTRY *thread_p, LOG_RCV *recv)
 
int btree_rv_keyval_undo_online_index_tran_delete (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)
 

Macro Definition Documentation

#define BTREE_CONTINUE   -1

Definition at line 68 of file btree.h.

#define BTREE_GETOID_AGAIN   -2

Definition at line 69 of file btree.h.

#define BTREE_GETOID_AGAIN_WITH_CHECK   -3

Definition at line 70 of file btree.h.

#define BTREE_GOTO_END_OF_SCAN   -5

Definition at line 72 of file btree.h.

#define BTREE_GOTO_LOCKING_DONE   -7

Definition at line 74 of file btree.h.

#define BTREE_GOTO_START_LOCKING   -6

Definition at line 73 of file btree.h.

#define BTREE_INIT_MVCC_HEADER (   p_mvcc_rec_header)
Value:
do \
{ \
MVCC_SET_FLAG (p_mvcc_rec_header, 0); \
MVCC_SET_INSID (p_mvcc_rec_header, MVCCID_NULL); \
MVCC_SET_DELID (p_mvcc_rec_header, MVCCID_NULL); \
MVCC_SET_CHN (p_mvcc_rec_header, 0); \
MVCC_SET_REPID (p_mvcc_rec_header, 0); \
LSA_SET_NULL (p_mvcc_rec_header.prev_version_lsa); \
} \
while (0)
#define MVCCID_NULL
#define MVCC_SET_DELID(header, mvcc_id)
Definition: mvcc.h:60
#define MVCC_SET_INSID(header, mvcc_id)
Definition: mvcc.h:54
#define MVCC_SET_REPID(header, rep_id)
Definition: mvcc.h:66
#define MVCC_SET_CHN(header, chn_)
Definition: mvcc.h:72
void LSA_SET_NULL(log_lsa *lsa_ptr)
Definition: log_lsa.hpp:146
while(1)
Definition: cnvlex.c:816
#define MVCC_SET_FLAG(header, flag)
Definition: mvcc.h:78

Definition at line 451 of file btree.h.

Referenced by btree_construct_leafs(), and btree_set_mvcc_header_ids_for_update().

#define BTREE_IS_PART_KEY_DESC (   btid_int)    ((btid_int)->part_key_desc != 0)

Definition at line 90 of file btree.h.

Referenced by btree_ils_adjust_range(), btree_prepare_bts(), and btree_scan_update_range().

#define BTREE_IS_PRIMARY_KEY (   unique_pk)    ((unique_pk) & BTREE_CONSTRAINT_PRIMARY_KEY)
#define BTREE_IS_UNIQUE (   unique_pk)    ((unique_pk) & BTREE_CONSTRAINT_UNIQUE)

Definition at line 89 of file btree.h.

Referenced by index_builder_loader_task::add_key(), btree_build_nleafs(), btree_check_valid_record(), btree_construct_leafs(), btree_delete_internal(), btree_dump_leaf_record(), btree_dump_root_header(), btree_find_oid_from_ovfl(), btree_fix_ovfl_oid_pages_tree(), btree_fix_root_for_delete(), btree_fix_root_for_insert(), btree_get_class_oid_of_unique_btid(), btree_get_next_key_info(), btree_insert_internal(), btree_is_fixed_size(), btree_key_append_object_non_unique(), btree_key_append_object_unique(), btree_key_delete_remove_object(), btree_key_find_and_insert_delete_mvccid(), btree_key_find_and_lock_unique(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_and_lock_unique_of_unique(), btree_key_find_first_visible_row(), btree_key_insert_delete_mvccid(), btree_key_insert_new_key(), 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_relocate_last_into_ovf(), btree_key_remove_delete_mvccid(), btree_key_remove_delete_mvccid_non_unique(), btree_key_remove_delete_mvccid_unique(), btree_key_remove_object_and_keep_visible_first(), btree_leaf_change_first_object(), btree_leaf_get_nth_oid_ptr(), btree_leaf_record_handle_first_overflow(), btree_online_index_list_dispatcher(), btree_or_get_object(), btree_or_put_object(), btree_range_scan_select_visible_oids(), btree_read_record_without_decompression(), btree_record_get_last_object(), btree_record_get_num_oids(), btree_record_get_num_visible_oids(), btree_record_remove_delid(), btree_record_remove_insid(), btree_record_remove_object_internal(), btree_record_replace_object(), btree_record_satisfies_snapshot(), btree_reflect_global_unique_statistics(), btree_rv_record_modify_internal(), btree_rv_save_keyval_for_undo(), btree_rv_save_keyval_for_undo_two_objects(), btree_select_visible_object_for_range_scan(), btree_seq_find_oid_from_ovfl(), btree_sort_get_next(), btree_verify_leaf_node(), btree_write_record(), compare_driver(), online_index_builder(), xbtree_add_index(), xbtree_load_index(), and xbtree_load_online_index().

#define BTREE_NEED_UNIQUE_CHECK (   thread_p,
  op 
)
Value:
#define MULTI_ROW_INSERT
Definition: btree.h:56
#define SINGLE_ROW_UPDATE
Definition: btree.h:54
bool logtb_is_current_active(THREAD_ENTRY *thread_p)
#define SINGLE_ROW_INSERT
Definition: btree.h:52

Definition at line 63 of file btree.h.

#define BTREE_NODE_SCAN_ADD_PAGE_TO_QUEUE (   bns,
  node 
)
Value:
if ((bns)->queue_tail == NULL) \
{ \
(bns)->queue_head = (bns)->queue_tail = node; \
} \
{ \
(bns)->queue_tail->next = node; \
(bns)->queue_tail = node; \
}
#define NULL
Definition: freelistheap.h:34
else

Definition at line 412 of file btree.h.

Referenced by btree_get_next_node_info().

#define BTREE_NODE_SCAN_INIT (   bns)
Value:
do \
{ \
VPID_SET_NULL (&(bns)->crt_vpid); \
(bns)->crt_page = NULL; \
(bns)->queue_head = (bns)->queue_tail = NULL; \
(bns)->first_call = true; \
} \
while (0)
#define NULL
Definition: freelistheap.h:34
while(1)
Definition: cnvlex.c:816
#define VPID_SET_NULL(vpid_ptr)
Definition: dbtype_def.h:906

Definition at line 401 of file btree.h.

Referenced by scan_open_index_node_info_scan(), and scan_start_scan().

#define BTREE_NODE_SCAN_IS_QUEUE_EMPTY (   bns)    ((bns)->queue_head == NULL)

Definition at line 447 of file btree.h.

Referenced by btree_get_next_node_info().

#define BTREE_NODE_SCAN_POP_PAGE_FROM_QUEUE (   bns,
  node 
)
Value:
if ((bns)->queue_head == NULL) \
{ \
node = NULL; \
} \
{ \
if ((bns)->queue_head == (bns)->queue_tail) \
{ \
/* Only one item in queue */ \
node = (bns)->queue_head; \
(bns)->queue_tail = NULL; \
(bns)->queue_head = NULL; \
} \
{ \
node = (bns)->queue_head; \
(bns)->queue_head = node->next; \
node->next = NULL; \
} \
}
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
else

Definition at line 424 of file btree.h.

Referenced by btree_get_next_node_info().

#define BTREE_RESET_SCAN (   bts)
Value:
do { \
(bts)->P_vpid.pageid = NULL_PAGEID; \
(bts)->C_vpid.pageid = NULL_PAGEID; \
(bts)->O_vpid.pageid = NULL_PAGEID; \
(bts)->P_page = NULL; \
(bts)->C_page = NULL; \
(bts)->O_page = NULL; \
(bts)->slot_id = -1; \
(bts)->oid_pos = 0; \
(bts)->restart_scan = 0; \
(bts)->common_prefix = COMMON_PREFIX_UNKNOWN; \
pr_clear_value (&(bts)->cur_key); \
db_make_null (&(bts)->cur_key); \
(bts)->clear_cur_key = false; \
(bts)->is_scan_started = false; \
} while (0)
#define COMMON_PREFIX_UNKNOWN
Definition: btree.h:251
#define NULL_PAGEID
#define NULL
Definition: freelistheap.h:34
int pr_clear_value(DB_VALUE *value)
int db_make_null(DB_VALUE *value)

Definition at line 299 of file btree.h.

Referenced by scan_reset_scan_block().

#define BTREE_RESTART_SCAN   -8

Definition at line 75 of file btree.h.

#define BTREE_SEARCH_AGAIN_WITH_CHECK   -4

Definition at line 71 of file btree.h.

#define BTREE_SET_UNIQUE_VIOLATION_ERROR (   THREAD,
  KEY,
  OID,
  C_OID,
  BTID,
  BTNM 
)
Value:
btree_set_error(THREAD, KEY, OID, C_OID, BTID, BTNM, \
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)
Definition: btree.c:18312
#define ER_BTREE_UNIQUE_FAILED
Definition: error_code.h:811

Definition at line 96 of file btree.h.

Referenced by btree_construct_leafs(), btree_key_lock_and_append_object_unique(), btree_online_index_check_unique_constraint(), locator_force_for_multi_update(), qexec_oid_of_duplicate_key_update(), qexec_process_partition_unique_stats(), qexec_process_unique_stats(), qexec_remove_duplicates_for_replace(), cubload::server_object_loader::stop_scancache(), and xbtree_class_test_unique().

#define BTREE_START_OF_SCAN (   bts)    BTREE_END_OF_SCAN(bts)

Definition at line 322 of file btree.h.

#define BTS_IS_DESCENDING_SCAN (   bts)    ((bts)->index_scan_idp->indx_info->use_desc_index)

Definition at line 324 of file btree.h.

#define BTS_SET_INDEX_SCANID (   bts,
  index_scan_idp 
)    ((bts)->index_scan_idp = index_scan_idp)

Definition at line 327 of file btree.h.

#define BTS_SET_KEY_LIMIT (   bts,
  lower,
  upper 
)
Value:
do \
{ \
(bts)->key_limit_lower = lower; \
(bts)->key_limit_upper = upper; \
} while (false)

Definition at line 329 of file btree.h.

#define COMMON_PREFIX_UNKNOWN   (-1)

Definition at line 251 of file btree.h.

Referenced by btree_find_next_index_record(), and btree_read_record().

Typedef Documentation

typedef struct btid_int BTID_INT

Definition at line 118 of file btree.h.

Definition at line 354 of file btree.h.

Definition at line 346 of file btree.h.

Definition at line 336 of file btree.h.

Definition at line 137 of file btree.h.

Definition at line 513 of file btree.h.

Definition at line 388 of file btree.h.

Definition at line 380 of file btree.h.

Definition at line 526 of file btree.h.

Definition at line 506 of file btree.h.

typedef int BTREE_RANGE_SCAN_PROCESS_KEY_FUNC(THREAD_ENTRY *thread_p, BTREE_SCAN *bts)

Definition at line 643 of file btree.h.

typedef struct btree_scan BTREE_SCAN

Definition at line 162 of file btree.h.

Definition at line 156 of file btree.h.

typedef struct indx_scan_id INDX_SCAN_ID

Definition at line 148 of file btree.h.

typedef struct leaf_rec LEAF_REC

Definition at line 110 of file btree.h.

typedef struct non_leaf_rec NON_LEAF_REC

Definition at line 102 of file btree.h.

typedef struct or_buf OR_BUF

Definition at line 50 of file btree.h.

Enumeration Type Documentation

anonymous enum
Enumerator
BTREE_COERCE_KEY_WITH_MIN_VALUE 
BTREE_COERCE_KEY_WITH_MAX_VALUE 

Definition at line 77 of file btree.h.

Enumerator
BTREE_LEAF_NODE 
BTREE_NON_LEAF_NODE 
BTREE_OVERFLOW_NODE 

Definition at line 81 of file btree.h.

Enumerator
BTREE_OP_NO_OP 
BTREE_OP_INSERT_NEW_OBJECT 
BTREE_OP_INSERT_MVCC_DELID 
BTREE_OP_INSERT_MARK_DELETED 
BTREE_OP_INSERT_UNDO_PHYSICAL_DELETE 
BTREE_OP_DELETE_OBJECT_PHYSICAL 
BTREE_OP_DELETE_OBJECT_PHYSICAL_POSTPONED 
BTREE_OP_DELETE_UNDO_INSERT 
BTREE_OP_DELETE_UNDO_INSERT_UNQ_MULTIUPD 
BTREE_OP_DELETE_UNDO_INSERT_DELID 
BTREE_OP_DELETE_VACUUM_OBJECT 
BTREE_OP_DELETE_VACUUM_INSID 
BTREE_OP_NOTIFY_VACUUM 
BTREE_OP_ONLINE_INDEX_IB_INSERT 
BTREE_OP_ONLINE_INDEX_IB_DELETE 
BTREE_OP_ONLINE_INDEX_TRAN_INSERT 
BTREE_OP_ONLINE_INDEX_TRAN_INSERT_DF 
BTREE_OP_ONLINE_INDEX_UNDO_TRAN_INSERT 
BTREE_OP_ONLINE_INDEX_TRAN_DELETE 
BTREE_OP_ONLINE_INDEX_UNDO_TRAN_DELETE 

Definition at line 468 of file btree.h.

Enumerator
BTS_KEY_IS_NOT_VERIFIED 
BTS_KEY_IS_VERIFIED 
BTS_KEY_IS_CONSUMED 

Definition at line 150 of file btree.h.

Function Documentation

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 
)
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:

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:

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 
)
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:

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 
)
int btree_get_pkey_btid ( THREAD_ENTRY thread_p,
OID cls_oid,
BTID pkey_btid 
)
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:

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 **  ctx 
)

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 
)
bool btree_is_btid_online_index ( THREAD_ENTRY thread_p,
OID class_oid,
BTID btid 
)
int btree_keyval_search ( THREAD_ENTRY thread_p,
BTID btid,
SCAN_OPERATION_TYPE  scan_op_type,
BTREE_SCAN BTS,
key_val_range key_val_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 
)
int btree_multicol_key_has_null ( DB_VALUE key)
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 
)
int btree_online_index_list_dispatcher ( THREAD_ENTRY thread_p,
BTID btid,
OID cls_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:

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:

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:

int btree_prepare_bts ( THREAD_ENTRY thread_p,
BTREE_SCAN bts,
BTID btid,
INDX_SCAN_ID index_scan_id_p,
key_val_range key_val_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:

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:

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,
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().

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 
)
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:

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 mvccid,
MVCC_REC_HEADER mvcc_rec_header 
)
char* btree_unpack_mvccinfo ( char *  ptr,
BTREE_MVCC_INFO mvcc_info,
short  btree_mvcc_flags 
)
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 xbtree_get_key_type ( THREAD_ENTRY thread_p,
BTID  btid,
TP_DOMAIN **  key_type 
)