CUBRID Engine
latest
|
#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"
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 |
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) |
#define BTREE_END_OF_SCAN | ( | bts | ) |
Definition at line 317 of file btree.h.
Referenced by btree_find_lower_bound_leaf(), btree_find_min_or_max_key(), btree_get_stats_with_fullscan(), btree_keyoid_checkscan_check(), locator_check_btree_entries(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), scan_get_index_oidset(), scan_next_index_scan(), and scan_next_scan_block().
#define BTREE_INIT_MVCC_HEADER | ( | p_mvcc_rec_header | ) |
Definition at line 451 of file btree.h.
Referenced by btree_construct_leafs(), and btree_set_mvcc_header_ids_for_update().
#define BTREE_INIT_SCAN | ( | bts | ) |
Definition at line 253 of file btree.h.
Referenced by btree_find_foreign_key(), btree_find_min_or_max_key(), btree_get_stats(), btree_keyoid_checkscan_check(), btree_keyoid_checkscan_start(), btree_load_check_fk(), locator_check_btree_entries(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_check_unique_btree_entries(), locator_prefetch_index_page_internal(), scan_open_index_key_info_scan(), and scan_open_index_scan().
#define BTREE_IS_MULTI_ROW_OP | ( | op | ) | (op == MULTI_ROW_INSERT || op == MULTI_ROW_UPDATE || op == MULTI_ROW_DELETE) |
Definition at line 60 of file btree.h.
Referenced by btree_fix_root_for_delete(), btree_fix_root_for_insert(), heap_scancache_start_modify(), qexec_execute_duplicate_key_update(), qexec_execute_update(), qexec_oid_of_duplicate_key_update(), qexec_remove_duplicates_for_replace(), and qexec_upddel_setup_current_class().
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) |
Definition at line 88 of file btree.h.
Referenced by btree_build_nleafs(), btree_dump_root_header(), xbtree_add_index(), xbtree_load_index(), and xbtree_load_online_index().
#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_MVCC_INFO_INITIALIZER { 0, MVCCID_ALL_VISIBLE, MVCCID_NULL } |
Definition at line 520 of file btree.h.
Referenced by btree_delete_postponed(), btree_insert(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_and_lock_unique_of_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_mvcc_delete(), btree_physical_delete(), btree_rv_keyval_undo_insert_mvcc_delid(), btree_rv_record_modify_internal(), btree_undo_insert_object(), btree_undo_insert_object_unique_multiupd(), btree_undo_mvcc_delete(), btree_vacuum_insert_mvccid(), and btree_vacuum_object().
#define BTREE_NEED_UNIQUE_CHECK | ( | thread_p, | |
op | |||
) |
#define BTREE_NODE_SCAN_ADD_PAGE_TO_QUEUE | ( | bns, | |
node | |||
) |
#define BTREE_NODE_SCAN_INIT | ( | bns | ) |
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 | |||
) |
Definition at line 424 of file btree.h.
Referenced by btree_get_next_node_info().
#define BTREE_NORMAL_KEY 0 |
Definition at line 93 of file btree.h.
Referenced by btree_connect_page(), btree_first_oid(), btree_key_insert_new_key(), btree_read_record_without_decompression(), btree_split_node(), btree_split_root(), btree_split_test(), and btree_write_record().
#define BTREE_OBJECT_INFO_INITIALIZER { OID_INITIALIZER, OID_INITIALIZER, BTREE_MVCC_INFO_INITIALIZER } |
Definition at line 533 of file btree.h.
Referenced by btree_remove_delete_mvccid_unique_internal(), btree_rv_keyval_undo_insert_unique(), and btree_rv_remove_marked_for_delete().
#define BTREE_OVERFLOW_KEY 1 |
Definition at line 94 of file btree.h.
Referenced by btree_connect_page(), btree_first_oid(), btree_key_insert_new_key(), btree_read_record_without_decompression(), btree_split_node(), btree_split_root(), and btree_write_record().
#define BTREE_RESET_SCAN | ( | bts | ) |
Definition at line 299 of file btree.h.
Referenced by scan_reset_scan_block().
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) |
#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 COMMON_PREFIX_UNKNOWN (-1) |
Definition at line 251 of file btree.h.
Referenced by btree_find_next_index_record(), and btree_read_record().
#define DBVAL_BUFSIZE 4096 |
Definition at line 449 of file btree.h.
Referenced by btree_sort_get_next(), heap_attrinfo_generate_key(), heap_attrvalue_get_key(), locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_foreign_key(), locator_check_unique_btree_entries(), locator_prefetch_index_page_internal(), locator_update_index(), online_index_builder(), qexec_oid_of_duplicate_key_update(), qexec_remove_duplicates_for_replace(), scan_open_index_scan(), xlocator_check_fk_validity(), and xlocator_remove_class_from_index().
#define MULTI_ROW_DELETE 6 |
Definition at line 57 of file btree.h.
Referenced by btree_delete_internal(), btree_op_type_to_string(), catcls_delete_subset(), locator_add_or_remove_index_internal(), locator_update_index(), qexec_execute_delete(), qexec_execute_update(), qexec_remove_duplicates_for_replace(), and xlocator_remove_class_from_index().
#define MULTI_ROW_INSERT 5 |
Definition at line 56 of file btree.h.
Referenced by btree_op_type_to_string(), cubload::server_object_loader::flush_records(), locator_add_or_remove_index_internal(), locator_update_index(), qexec_execute_insert(), and cubload::server_object_loader::start_scancache().
#define MULTI_ROW_UPDATE 7 |
Definition at line 58 of file btree.h.
Referenced by btree_delete_internal(), btree_fix_root_for_delete(), btree_insert_internal(), btree_key_delete_remove_object(), btree_key_insert_delete_mvccid(), btree_op_type_to_string(), catcls_insert_subset(), catcls_update_subset(), locator_add_or_remove_index_internal(), locator_force_for_multi_update(), locator_update_index(), qexec_execute_duplicate_key_update(), qexec_execute_update(), and qexec_oid_of_duplicate_key_update().
#define SINGLE_ROW_DELETE 2 |
Definition at line 53 of file btree.h.
Referenced by btree_delete_internal(), btree_key_online_index_IB_insert(), btree_key_online_index_tran_insert_DF(), btree_online_index_list_dispatcher(), btree_op_type_to_string(), catcls_delete_catalog_classes(), catcls_delete_instance(), locator_check_primary_key_delete(), locator_repair_btree_by_delete(), qexec_execute_delete(), qexec_execute_update(), qexec_remove_duplicates_for_replace(), xlocator_force(), and xlocator_repl_force().
#define SINGLE_ROW_INSERT 1 |
Definition at line 52 of file btree.h.
Referenced by btree_key_online_index_tran_delete(), btree_online_index_list_dispatcher(), btree_op_type_to_string(), btree_undo_delete_physical(), catcls_insert_instance(), locator_move_record(), locator_repair_btree_by_insert(), locator_update_force(), qexec_execute_insert(), redistribute_partition_data(), xlocator_force(), and xlocator_repl_force().
#define SINGLE_ROW_MODIFY 4 /* used in case of undo */ |
Definition at line 55 of file btree.h.
Referenced by btree_delete_internal(), btree_delete_postponed(), btree_op_type_to_string(), btree_undo_insert_object(), btree_undo_insert_object_unique_multiupd(), btree_undo_mvcc_delete(), btree_vacuum_insert_mvccid(), btree_vacuum_object(), and locator_update_force().
#define SINGLE_ROW_UPDATE 3 |
Definition at line 54 of file btree.h.
Referenced by boot_db_parm_update_heap(), btree_delete_internal(), btree_op_type_to_string(), catcls_insert_catalog_classes(), catcls_update_catalog_classes(), catcls_update_instance(), heap_object_upgrade_domain(), locator_check_primary_key_delete(), locator_check_primary_key_update(), process_class(), process_object(), qexec_execute_duplicate_key_update(), qexec_execute_increment(), qexec_execute_update(), qexec_oid_of_duplicate_key_update(), tde_update_keyinfo(), update_indexes(), xlocator_force(), xlocator_repl_force(), and xlocator_upgrade_instances_domain().
typedef struct btree_capacity BTREE_CAPACITY |
typedef struct btree_checkscan BTREE_CHECKSCAN |
typedef struct btree_iscan_oid_list BTREE_ISCAN_OID_LIST |
typedef struct btree_keyrange BTREE_KEYRANGE |
typedef struct btree_mvcc_info BTREE_MVCC_INFO |
typedef struct btree_node_scan BTREE_NODE_SCAN |
typedef struct btree_node_scan_queue_item BTREE_NODE_SCAN_QUEUE_ITEM |
typedef struct btree_object_info BTREE_OBJECT_INFO |
typedef enum btree_op_purpose BTREE_OP_PURPOSE |
typedef int BTREE_RANGE_SCAN_PROCESS_KEY_FUNC(THREAD_ENTRY *thread_p, BTREE_SCAN *bts) |
typedef struct btree_scan BTREE_SCAN |
typedef enum bts_key_status BTS_KEY_STATUS |
typedef struct indx_scan_id INDX_SCAN_ID |
typedef struct non_leaf_rec NON_LEAF_REC |
anonymous enum |
enum BTREE_NODE_TYPE |
enum btree_op_purpose |
enum bts_key_status |
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 | ||
) |
Definition at line 15938 of file btree.c.
References db_get_midxkey(), DB_TYPE_MIDXKEY, DB_VALUE_TYPE, ER_FAILED, error(), i, NO_ERROR, NULL, pr_clear_value(), pr_clone_value(), and pr_midxkey_get_element_nocopy().
Referenced by btree_dump_curr_key(), partition_attrinfo_get_key(), and scan_dump_key_into_tuple().
DISK_ISVALID btree_check_all | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 8271 of file btree.c.
References assert, ASSERT_ERROR, assert_release, btree_check_by_btid(), DISK_ERROR, DISK_INVALID, DISK_VALID, FILE_BTREE, file_tracker_interruptable_iterate(), lock_unlock_object(), NO_ERROR, OID_INITIALIZER, OID_ISNULL, oid_Root_class_oid, SCH_S_LOCK, btid::vfid, VFID_ISNULL, and VFID_SET_NULL.
Referenced by xboot_check_db_consistency().
DISK_ISVALID btree_check_by_btid | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid | ||
) |
Definition at line 7773 of file btree.c.
References assert, ASSERT_ERROR, BTID_AS_ARGS, file_descriptors::btree, btree_check_tree(), btree_get_btid_from_file(), btree_log_if_enabled, file_btree_des::class_oid, DISK_ERROR, DISK_INVALID, DISK_VALID, er_errid(), file_descriptor_get(), free_and_init, heap_get_indexinfo_of_btid(), NO_ERROR, NULL, btid::vfid, and VFID_ISNULL.
Referenced by btree_check_all(), and btree_check_by_class_oid().
DISK_ISVALID btree_check_by_class_oid | ( | THREAD_ENTRY * | thread_p, |
OID * | cls_oid, | ||
BTID * | idx_btid | ||
) |
Definition at line 7885 of file btree.c.
References ARG_FILE_LINE, ASSERT_ERROR, or_index::btid, BTID_COPY, BTID_IS_EQUAL, btree_check_by_btid(), DISK_ERROR, DISK_VALID, er_errid(), ER_ERROR_SEVERITY, er_set(), ER_UNEXPECTED, heap_classrepr_free_and_init, heap_classrepr_get(), i, or_classrep::indexes, IS_LOCK, LK_GRANTED, LK_UNCOND_LOCK, lock_object(), lock_unlock_object(), NULL, NULL_REPRID, oid_Root_class_oid, and rv.
Referenced by xboot_checkdb_table().
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 | ||
) |
Definition at line 22005 of file btree.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, BTID_COPY, BTREE_ERROR_OCCURRED, BTREE_KEY_FOUND, BTREE_KEY_NOTFOUND, btree_multicol_key_has_null(), COPY_OID, DB_IS_NULL, db_make_null(), DB_PARTITIONED_CLASS, db_private_free, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_FK_INVALID, er_set(), or_classrep::has_partition_info, heap_classrepr_free_and_init, heap_classrepr_get(), NO_ERROR, NULL, NULL_REPRID, OID_SET_NULL, partition_clear_pruning_context(), partition_init_pruning_context(), partition_load_pruning_context(), partition_prune_unique_btid(), pruning_context::partitions, pr_valstring(), S_SELECT_WITH_LOCK, and xbtree_find_unique().
Referenced by xlocator_check_fk_validity().
DISK_ISVALID btree_check_tree | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid_p, | ||
BTID * | btid, | ||
const char * | btname | ||
) |
Definition at line 7711 of file btree.c.
References btree_check_pages(), btree_get_root_header(), btree_glean_root_header_info(), btree_verify_tree(), DISK_ERROR, DISK_VALID, error(), NO_ERROR, NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btid_int::sys_btid, btid::vfid, vpid::volid, and vfid::volid.
Referenced by btree_check_by_btid().
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().
int btree_coerce_key | ( | DB_VALUE * | src_keyp, |
int | keysize, | ||
TP_DOMAIN * | btree_domainp, | ||
int | key_minmax | ||
) |
Definition at line 14798 of file btree.c.
References ARG_FILE_LINE, BTREE_COERCE_KEY_WITH_MAX_VALUE, BTREE_COERCE_KEY_WITH_MIN_VALUE, db_get_midxkey(), db_make_null(), db_private_alloc, db_private_free_and_init, DB_TYPE_BIT, DB_TYPE_CHAR, DB_TYPE_MIDXKEY, DB_TYPE_NCHAR, DB_TYPE_OBJECT, DB_TYPE_OID, DB_TYPE_VARBIT, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, DB_VALUE_TYPE, db_midxkey::domain, DOMAIN_COMPATIBLE, ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), err, tp_domain::is_desc, MAX_COLUMN, MIN_COLUMN, db_midxkey::min_max_val, db_midxkey::ncolumns, tp_domain::next, NO_ERROR, NULL, special_column::position, pr_clear_value(), pr_clone_value(), pr_midxkey_add_elements(), tp_domain::setdomain, TP_DOMAIN_TYPE, TP_IS_DATE_OR_TIME_TYPE, TP_IS_NUMERIC_TYPE, tp_more_general_type(), tp_value_coerce(), tp_value_coerce_strict(), and special_column::type.
Referenced by scan_dbvals_to_midxkey().
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().
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 | ||
) |
Definition at line 18636 of file btree.c.
References ARG_FILE_LINE, assert, assert_release, pr_type::cmpval(), tp_domain::collation_id, db_get_midxkey(), db_get_string_collation(), DB_GT, DB_IS_NULL, DB_LT, DB_TYPE_MIDXKEY, DB_UNK, DB_VALUE_DOMAIN_TYPE, ER_ERROR_SEVERITY, er_set(), ER_TP_CANT_COERCE, tp_domain::is_desc, NULL, pr_midxkey_compare(), pr_type_name(), TP_ARE_COMPARABLE_KEY_TYPES, TP_DOMAIN_TYPE, TP_IS_STRING_TYPE, tp_valid_indextype(), tp_value_compare_with_error(), and tp_domain::type.
Referenced by btree_apply_key_range_and_filter(), btree_check_page_key(), btree_check_valid_record(), btree_construct_leafs(), btree_get_prefix_separator(), btree_ils_adjust_range(), btree_key_online_index_IB_insert_list(), btree_leaf_is_key_between_min_max(), btree_load_check_fk(), btree_search_leaf_page(), btree_search_nonleaf_page(), btree_split_node(), btree_split_root(), btree_verify_leaf_node(), btree_verify_nonleaf_node(), compare_driver(), locator_update_index(), and btree_insert_list::prepare_list().
int btree_create_file | ( | THREAD_ENTRY * | thread_p, |
const OID * | class_oid, | ||
int | attrid, | ||
BTID * | btid | ||
) |
Definition at line 32892 of file btree.c.
References ASSERT_ERROR, assert_release, file_btree_des::attr_id, file_descriptors::btree, btree_initialize_new_page(), file_btree_des::class_oid, er_clear(), ER_FAILED, file_alloc_sticky_first_page(), file_apply_tde_algorithm(), FILE_BTREE, file_create_with_npages(), heap_get_class_tde_algorithm(), log_sysop_abort(), log_sysop_commit(), log_sysop_start(), NO_ERROR, NULL, vpid::pageid, btid::root_pageid, STATIC_INLINE, TDE_ALGORITHM_NONE, btid::vfid, vpid::volid, and vfid::volid.
Referenced by xbtree_add_index(), and xbtree_load_index().
void btree_dump | ( | THREAD_ENTRY * | thread_p, |
FILE * | fp, | ||
BTID * | btid, | ||
int | level | ||
) |
Definition at line 9029 of file btree.c.
References btree_dump_page_with_subtree(), btree_dump_root_header(), btree_get_root_header(), btree_glean_root_header_info(), NO_ERROR, NULL, OLD_PAGE, vpid::pageid, pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btid_int::sys_btid, btid::vfid, vpid::volid, and vfid::volid.
int btree_dump_capacity | ( | THREAD_ENTRY * | thread_p, |
FILE * | fp, | ||
BTID * | btid | ||
) |
Definition at line 8734 of file btree.c.
References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, btree_capacity::avg_key_len, btree_capacity::avg_pg_free_sp, btree_capacity::avg_pg_key_cnt, btree_capacity::avg_rec_len, btree_capacity::avg_val_per_key, file_descriptors::btree, btree_index_capacity(), file_btree_des::class_oid, btree_capacity::dis_key_cnt, file_descriptor_get(), vfid::fileid, free_and_init, heap_get_class_name(), heap_get_indexinfo_of_btid(), btree_capacity::height, btree_capacity::leaf_pg_cnt, btree_capacity::nleaf_pg_cnt, NO_ERROR, NULL, btid::root_pageid, btree_capacity::tot_free_space, btree_capacity::tot_pg_cnt, btree_capacity::tot_space, btree_capacity::tot_used_space, btree_capacity::tot_val_cnt, btid::vfid, and vfid::volid.
Referenced by file_tracker_item_dump_btree_capacity().
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().
int btree_find_foreign_key | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
DB_VALUE * | key, | ||
OID * | class_oid, | ||
OID * | found_oid | ||
) |
Definition at line 5972 of file btree.c.
References assert, ASSERT_ERROR, btree_scan::btid_int, BTREE_FIND_FK_OBJECT_INITIALIZER, BTREE_INIT_SCAN, btree_prepare_bts(), btree_range_scan(), btree_range_scan_find_fk_any_object(), COPY_OID, er_errid(), btree_find_fk_object::found_oid, GE_LE, key_val_range::key1, key_val_range::key2, lock_unlock_object_donot_move_to_non2pl(), NO_ERROR, NULL, key_val_range::num_index_term, OID_ISNULL, OID_SET_NULL, key_val_range::range, S_LOCK, and btid_int::topclass_oid.
Referenced by locator_check_primary_key_delete(), and locator_check_primary_key_update().
DISK_ISVALID btree_find_key | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
OID * | oid, | ||
DB_VALUE * | key, | ||
bool * | clear_key | ||
) |
Definition at line 18273 of file btree.c.
References assert, btree_find_key_from_page(), btree_get_root_header(), btree_glean_root_header_info(), DISK_ERROR, NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btid_int::sys_btid, btid::vfid, vpid::volid, and vfid::volid.
Referenced by locator_repair_btree_by_delete().
int btree_find_min_or_max_key | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
DB_VALUE * | key, | ||
int | flag_minkey | ||
) |
Definition at line 16284 of file btree.c.
References assert, btree_scan::btid_int, btree_clear_key_value(), BTREE_END_OF_SCAN, btree_find_lower_bound_leaf(), btree_get_root_header(), btree_glean_root_header_info(), BTREE_INIT_SCAN, btree_init_temp_key_value(), BTREE_LEAF_NODE, btree_read_record(), btree_scan::C_page, db_make_null(), er_errid(), ER_FAILED, tp_domain::is_desc, btid_int::key_type, NO_ERROR, NULL, btree_scan::O_page, OLD_PAGE, btree_scan::P_page, PAGE_BTREE, vpid::pageid, PEEK, PEEK_KEY_VALUE, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, pr_clone_value(), btid::root_pageid, S_SUCCESS, btree_scan::slot_id, spage_get_record(), btid_int::sys_btid, TP_DOMAIN_TYPE, tp_valid_indextype(), btree_scan::use_desc_index, btid::vfid, vpid::volid, and vfid::volid.
Referenced by qdata_evaluate_aggregate_optimize().
int btree_get_btid_from_file | ( | THREAD_ENTRY * | thread_p, |
const VFID * | vfid, | ||
BTID * | btid_out | ||
) |
Definition at line 6930 of file btree.c.
References assert, ASSERT_ERROR, file_get_sticky_first_page(), NO_ERROR, vpid::pageid, btid::root_pageid, btid::vfid, vpid::volid, vfid::volid, and VPID_ISNULL.
Referenced by btree_check_by_btid(), btree_repair_prev_link(), and file_tracker_item_dump_btree_capacity().
int btree_get_class_oid_of_unique_btid | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
OID * | class_oid | ||
) |
Definition at line 35304 of file btree.c.
References btree_fix_root_with_info(), BTREE_IS_UNIQUE, COPY_OID, ER_FAILED, NO_ERROR, NULL, OID_SET_NULL, PGBUF_LATCH_READ, pgbuf_unfix_and_init, btree_root_header::topclass_oid, and btree_root_header::unique_pk.
Referenced by logtb_tran_update_stats_online_index_rb().
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().
SCAN_CODE btree_get_next_node_info | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
BTREE_NODE_SCAN * | btns, | ||
DB_VALUE ** | node_info | ||
) |
Definition at line 20162 of file btree.c.
References ARG_FILE_LINE, assert, btree_node_scan::btid_int, btree_clear_key_value(), btree_get_node_header(), btree_init_temp_key_value(), BTREE_LEAF_NODE, BTREE_NODE_INFO_FIRST_KEY, BTREE_NODE_INFO_KEY_COUNT, BTREE_NODE_INFO_LAST_KEY, BTREE_NODE_INFO_NODE_TYPE, BTREE_NODE_INFO_PAGEID, BTREE_NODE_INFO_VOLUMEID, btree_node_number_of_keys(), BTREE_NODE_SCAN_ADD_PAGE_TO_QUEUE, BTREE_NODE_SCAN_IS_QUEUE_EMPTY, BTREE_NODE_SCAN_POP_PAGE_FROM_QUEUE, BTREE_NON_LEAF_NODE, btree_read_fixed_portion_of_non_leaf_record(), btree_read_record(), btree_node_scan::crt_page, btree_node_scan_queue_item::crt_vpid, btree_node_scan::crt_vpid, db_make_int(), db_make_null(), db_make_string(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), btree_node_scan::first_call, free_and_init, i, btree_node_scan_queue_item::next, NO_ERROR, btree_node_header::node_level, NULL, OLD_PAGE, vpid::pageid, PEEK, PEEK_KEY_VALUE, pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, non_leaf_rec::pnt, pr_clear_value(), pr_clone_value(), btid::root_pageid, S_END, S_ERROR, S_SUCCESS, spage_get_record(), btid::vfid, vpid::volid, and vfid::volid.
Referenced by scan_next_index_node_info_scan().
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 | ||
) |
Definition at line 2566 of file btree.c.
References assert, ASSERT_ERROR, btree_get_num_visible_oids_from_all_ovf(), BTREE_LEAF_NODE, btree_record_get_num_visible_oids(), NO_ERROR, NULL, leaf_rec::ovfl, and VPID_ISNULL.
Referenced by btree_get_stats_key(), btree_is_slot_visible(), btree_key_delete_remove_object(), btree_key_find_and_insert_delete_mvccid(), btree_key_lock_and_append_object_unique(), and btree_key_record_check_no_visible().
PERF_PAGE_TYPE btree_get_perf_btree_page_type | ( | THREAD_ENTRY * | thread_p, |
PAGE_PTR | page_ptr | ||
) |
Definition at line 33161 of file btree.c.
References assert, recdes::data, HEADER, if(), recdes::length, btree_node_header::node_level, NULL, spage_header::num_slots, PEEK, PERF_PAGE_BTREE_GENERIC, PERF_PAGE_BTREE_LEAF, PERF_PAGE_BTREE_NONLEAF, PERF_PAGE_BTREE_OVF, PERF_PAGE_BTREE_ROOT, PERF_PAGE_UNKNOWN, S_SUCCESS, and spage_get_record().
Referenced by pgbuf_get_page_type_for_stat(), and pgbuf_has_perm_pages_fixed().
int btree_get_pkey_btid | ( | THREAD_ENTRY * | thread_p, |
OID * | cls_oid, | ||
BTID * | pkey_btid | ||
) |
Definition at line 7833 of file btree.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, or_index::btid, BTID_COPY, BTID_SET_NULL, BTREE_PRIMARY_KEY, ER_ERROR_SEVERITY, er_set(), ER_UNEXPECTED, error(), heap_classrepr_free_and_init, heap_classrepr_get(), i, or_classrep::indexes, NO_ERROR, NULL, NULL_REPRID, and or_index::type.
Referenced by locator_repl_prepare_force().
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().
int btree_get_stats | ( | THREAD_ENTRY * | thread_p, |
BTREE_STATS * | stat_info_p, | ||
bool | with_fullscan | ||
) |
Definition at line 6959 of file btree.c.
References assert, ASSERT_ERROR, assert_release, btree_stats::btid, btree_scan::btid_int, BTID_IS_NULL, btree_get_root_header(), btree_get_stats_with_AR_sampling(), btree_get_stats_with_fullscan(), btree_glean_root_header_info(), BTREE_INIT_SCAN, btree_stats_env::btree_scan, BTREE_STATS_PKEYS_NUM, db_make_null(), DB_TYPE_MIDXKEY, er_errid(), ER_FAILED, file_get_num_user_pages(), btree_stats::height, i, btid_int::key_type, btree_stats::keys, btree_stats::leafs, NO_ERROR, NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, btree_stats::pages, perfmon_inc_stat(), pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btree_stats::pkeys, btree_stats::pkeys_size, btree_stats_env::pkeys_val, btree_stats_env::pkeys_val_num, pr_clear_value(), PSTAT_BT_NUM_GET_STATS, btid::root_pageid, btree_stats_env::stat_info, STATS_SAMPLING_THRESHOLD, btid_int::sys_btid, TP_DOMAIN_TYPE, tp_valid_indextype(), btid::vfid, vpid::volid, and vfid::volid.
Referenced by btree_get_statistics(), sbtree_get_statistics(), and xstats_update_statistics().
int btree_get_unique_statistics | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
int * | oid_cnt, | ||
int * | null_cnt, | ||
int * | key_cnt | ||
) |
Definition at line 6199 of file btree.c.
References ARG_FILE_LINE, assert, btree_clear_key_value(), BTREE_CONSTRAINT_PRIMARY_KEY, BTREE_CONSTRAINT_UNIQUE, btree_get_node_header(), btree_get_root_header(), btree_init_temp_key_value(), BTREE_LEAF_NODE, btree_node_number_of_keys(), btree_read_fixed_portion_of_non_leaf_record(), btree_read_record(), BTREE_STATS_PKEYS_NUM, DB_EQ, db_get_midxkey(), DB_TYPE_MIDXKEY, er_errid(), ER_FAILED, er_log_debug, btree_stats::height, i, btid_int::key_type, btree_stats::keys, btree_stats::leafs, NO_ERROR, btree_node_header::node_level, NULL, btree_root_header::num_keys, btree_root_header::num_nulls, btree_root_header::num_oids, OLD_PAGE, PAGE_BTREE, vpid::pageid, btree_stats::pages, PEEK, PEEK_KEY_VALUE, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btree_stats::pkeys, btree_stats::pkeys_size, non_leaf_rec::pnt, pr_clear_value(), pr_clone_value(), pr_midxkey_get_element_nocopy(), btid::root_pageid, S_SUCCESS, spage_get_record(), btree_stats_env::stat_info, TP_DOMAIN_TYPE, tp_value_compare(), btree_root_header::unique_pk, btid::vfid, vpid::volid, and vfid::volid.
Referenced by logtb_get_global_unique_stats_entry().
int btree_get_unique_statistics_for_count | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
int * | oid_cnt, | ||
int * | null_cnt, | ||
int * | key_cnt | ||
) |
Definition at line 6171 of file btree.c.
References ER_FAILED, log_tran_btid_unique_stats::global_stats, logtb_tran_find_btid_stats(), NO_ERROR, NULL, log_unique_stats::num_keys, log_unique_stats::num_nulls, log_unique_stats::num_oids, and log_tran_btid_unique_stats::tran_stats.
Referenced by qdata_evaluate_aggregate_optimize().
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().
int btree_index_capacity | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
BTREE_CAPACITY * | cpc | ||
) |
Definition at line 8673 of file btree.c.
References btree_get_root_header(), btree_get_subtree_capacity(), btree_glean_root_header_info(), er_errid(), ER_FAILED, NO_ERROR, NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btid_int::sys_btid, btid::vfid, vpid::volid, and vfid::volid.
Referenced by btree_dump_capacity(), and btree_scan_for_show_index_capacity().
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().
SCAN_CODE btree_index_next_scan | ( | THREAD_ENTRY * | thread_p, |
int | cursor, | ||
DB_VALUE ** | out_values, | ||
int | out_cnt, | ||
void * | ctx | ||
) |
Definition at line 20669 of file btree.c.
References ARG_FILE_LINE, assert, or_index::btname, btree_scan_for_show_index_capacity(), btree_scan_for_show_index_header(), show_index_scan_ctx::class_oid_count, show_index_scan_ctx::class_oids, cleanup(), ER_ERROR_SEVERITY, ER_OBJ_INDEX_NOT_FOUND, er_set(), free_and_init, heap_classrepr_free_and_init, heap_classrepr_get(), heap_get_class_name(), i, show_index_scan_ctx::index_name, or_classrep::indexes, show_index_scan_ctx::indexes_count, intl_identifier_casecmp(), show_index_scan_ctx::is_all, or_classrep::n_indexes, NO_ERROR, NULL, NULL_REPRID, S_END, S_ERROR, show_index_scan_ctx::show_type, SHOWSTMT_ALL_INDEXES_CAPACITY, SHOWSTMT_ALL_INDEXES_HEADER, SHOWSTMT_INDEX_CAPACITY, and SHOWSTMT_INDEX_HEADER.
Referenced by showstmt_scan_init().
int btree_index_start_scan | ( | THREAD_ENTRY * | thread_p, |
int | show_type, | ||
DB_VALUE ** | arg_values, | ||
int | arg_cnt, | ||
void ** | ctx | ||
) |
Definition at line 20523 of file btree.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, or_partition::class_oid, show_index_scan_ctx::class_oid_count, show_index_scan_ctx::class_oids, cleanup(), COPY_OID, db_get_int(), db_get_string(), DB_PARTITIONED_CLASS, db_private_alloc, db_private_free_and_init, db_private_strdup(), ER_ERROR_SEVERITY, ER_LC_UNKNOWN_CLASSNAME, er_set(), error(), heap_classrepr_free_and_init, heap_classrepr_get(), heap_clear_partition_info(), heap_get_class_partitions(), i, show_index_scan_ctx::index_name, show_index_scan_ctx::indexes_count, show_index_scan_ctx::is_all, LC_CLASSNAME_DELETED, LC_CLASSNAME_ERROR, or_classrep::n_indexes, NO_ERROR, NULL, NULL_REPRID, S_LOCK, SCH_S_LOCK, show_index_scan_ctx::show_type, SHOWSTMT_ALL_INDEXES_CAPACITY, SHOWSTMT_ALL_INDEXES_HEADER, and xlocator_find_class_oid().
Referenced by showstmt_scan_init().
int btree_initialize_new_page | ( | THREAD_ENTRY * | thread_p, |
PAGE_PTR | page, | ||
void * | args | ||
) |
Definition at line 4971 of file btree.c.
References BTREE_MAX_ALIGN, DONT_FREE, DONT_SAFEGUARD_RVSPACE, log_append_undoredo_data2(), NO_ERROR, NULL, PAGE_BTREE, pgbuf_set_dirty(), pgbuf_set_page_ptype(), RVBT_GET_NEWPAGE, spage_initialize(), and UNANCHORED_KEEP_SEQUENCE.
Referenced by btree_create_file(), btree_get_new_page(), and btree_load_new_page().
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 | ||
) |
Definition at line 25969 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, assert, assert_release, btree_insert_internal(), btree_mvcc_info_from_heap_mvcc_header(), BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_OP_INSERT_NEW_OBJECT, vfid::fileid, MVCC_GET_INSID, MVCCID_ALL_VISIBLE, NULL, oid_Null_oid, db_identifier::pageid, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btid::root_pageid, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by btree_update(), locator_add_or_remove_index_internal(), locator_repair_btree_by_insert(), and locator_update_index().
bool btree_is_btid_online_index | ( | THREAD_ENTRY * | thread_p, |
OID * | class_oid, | ||
BTID * | btid | ||
) |
Definition at line 35329 of file btree.c.
References assert, or_index::btid, BTID_IS_EQUAL, heap_classrepr_free_and_init, heap_classrepr_get(), i, or_index::index_status, or_classrep::indexes, or_classrep::n_indexes, NULL, NULL_REPRID, and OR_ONLINE_INDEX_BUILDING_IN_PROGRESS.
Referenced by logtb_tran_update_stats_online_index_rb().
bool btree_is_unique_type | ( | BTREE_TYPE | type | ) |
Definition at line 6046 of file btree.c.
References BTREE_PRIMARY_KEY, BTREE_REVERSE_UNIQUE, and BTREE_UNIQUE.
Referenced by heap_attrinfo_check_unique_index(), logtb_create_unique_stats_from_repr(), partition_load_aggregate_helper(), qexec_execute_build_indexes(), qexec_oid_of_duplicate_key_update(), and qexec_remove_duplicates_for_replace().
DISK_ISVALID btree_keyoid_checkscan_check | ( | THREAD_ENTRY * | thread_p, |
BTREE_CHECKSCAN * | btscan, | ||
OID * | cls_oid, | ||
DB_VALUE * | key, | ||
OID * | oid | ||
) |
Definition at line 8364 of file btree.c.
References assert, ASSERT_ERROR, btree_checkscan::btid, btree_scan::btid_int, BTREE_END_OF_SCAN, BTREE_INIT_SCAN, btree_keyval_search(), btree_checkscan::btree_scan, btree_scan_clear_key(), btree_iscan_oid_list::capacity, db_value::data, DB_TYPE_MIDXKEY, DB_VALUE_DOMAIN_TYPE, DISK_ERROR, DISK_INVALID, DISK_VALID, db_midxkey::domain, GE_LE, key_val_range::key1, key_val_range::key2, btid_int::key_type, logtb_get_mvcc_snapshot(), db_data::midxkey, NULL, key_val_range::num_index_term, btree_iscan_oid_list::oid_cnt, OID_EQ, btree_checkscan::oid_list, btree_iscan_oid_list::oidp, pr_is_set_type(), key_val_range::range, S_SELECT, and scan_init_index_scan().
Referenced by locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_unique_btree_entries(), and locator_update_index().
void btree_keyoid_checkscan_end | ( | THREAD_ENTRY * | thread_p, |
BTREE_CHECKSCAN * | btscan | ||
) |
Definition at line 8445 of file btree.c.
References btree_iscan_oid_list::capacity, btree_iscan_oid_list::max_oid_cnt, btree_checkscan::oid_list, btree_iscan_oid_list::oidp, and os_free_and_init.
Referenced by locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_unique_btree_entries(), locator_prefetch_index_page_internal(), and locator_update_index().
int btree_keyoid_checkscan_start | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
BTREE_CHECKSCAN * | btscan | ||
) |
Definition at line 8330 of file btree.c.
References ARG_FILE_LINE, assert, btree_checkscan::btid, BTREE_INIT_SCAN, btree_checkscan::btree_scan, btree_iscan_oid_list::capacity, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), ISCAN_OID_BUFFER_CAPACITY, btree_iscan_oid_list::max_oid_cnt, btree_iscan_oid_list::next_list, NO_ERROR, NULL, btree_iscan_oid_list::oid_cnt, btree_checkscan::oid_list, btree_iscan_oid_list::oidp, OR_OID_SIZE, and os_malloc.
Referenced by locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_unique_btree_entries(), locator_prefetch_index_page_internal(), and locator_update_index().
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 | ||
) |
Definition at line 14751 of file btree.c.
References assert, ASSERT_ERROR, btree_prepare_bts(), btree_range_scan(), btree_range_scan_select_visible_oids(), btree_scan::n_oids_read_last_iteration, indx_scan_id::need_count_only, NO_ERROR, NULL, OID_ISNULL, and rc.
Referenced by btree_keyoid_checkscan_check(), and locator_prefetch_index_page_internal().
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 | ||
) |
Definition at line 2798 of file btree.c.
References assert, assert_release, btree_check_valid_record(), BTREE_IS_UNIQUE, btree_leaf_get_flag(), btree_leaf_is_flaged(), BTREE_LEAF_NODE, BTREE_LEAF_RECORD_CLASS_OID, BTREE_LEAF_RECORD_OVERFLOW_OIDS, btree_leaf_set_flag(), BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, BTREE_MVCC_INFO_SET_FIXED_SIZE, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, btree_online_index_is_normal_state(), btree_record_object_is_flagged(), btree_record_object_set_mvcc_flags(), recdes::data, btree_mvcc_info::delete_mvccid, or_buf::endptr, btree_mvcc_info::flags, log_global::hdr, btree_mvcc_info::insert_mvccid, log_Gl, log_rv_pack_redo_record_changes(), log_rv_pack_undo_record_changes(), MVCC_ID_PRECEDES, log_header::mvcc_next_id, MVCCID_IS_VALID, MVCCID_NULL, NO_ERROR, NULL, OID_EQ, OID_ISNULL, or_init(), OR_MVCCID_SIZE, OR_OID_SIZE, or_put_mvccid(), or_put_oid(), or_buf::ptr, RECORD_MOVE_DATA, btid_int::topclass_oid, and btid_int::unique_pk.
Referenced by btree_construct_leafs(), btree_key_append_object_unique(), btree_key_remove_object_and_keep_visible_first(), btree_leaf_record_replace_first_with_last(), btree_record_replace_object(), btree_remove_delete_mvccid_unique_internal(), and btree_replace_first_oid_with_ovfl_oid().
int btree_leaf_get_first_object | ( | BTID_INT * | btid, |
RECDES * | recp, | ||
OID * | oidp, | ||
OID * | class_oid, | ||
BTREE_MVCC_INFO * | mvcc_info | ||
) |
Definition at line 2429 of file btree.c.
References assert, BTREE_LEAF_NODE, btree_or_get_object(), BTREE_RECORD_OR_BUF_INIT, NO_ERROR, and NULL.
Referenced by btree_construct_leafs(), btree_dump_leaf_record(), btree_key_find_and_lock_unique_of_unique(), btree_key_lock_and_append_object_unique(), btree_key_remove_object_and_keep_visible_first(), btree_remove_delete_mvccid_unique_internal(), btree_replace_first_oid_with_ovfl_oid(), and btree_verify_leaf_node().
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 | ||
) |
Definition at line 2296 of file btree.c.
References assert, btree_check_valid_record(), btree_leaf_clear_flag(), btree_leaf_is_flaged(), BTREE_LEAF_NODE, btree_leaf_record_handle_first_overflow(), BTREE_LEAF_RECORD_OVERFLOW_OIDS, BTREE_OID_HAS_MVCC_INSID_AND_DELID, btree_record_object_is_flagged(), recdes::data, DISK_INVALID, disk_is_page_sector_reserved(), DISK_VPID_ALIGNED_SIZE, recdes::length, log_rv_pack_redo_record_changes(), log_rv_pack_undo_record_changes(), NULL, OR_OID_SLOTID, OR_PUT_VPID_ALIGNED, OR_SHORT_SIZE, vpid::pageid, vpid::volid, and VPID_ISNULL.
Referenced by btree_construct_leafs(), btree_key_append_object_as_new_overflow(), and btree_modify_leaf_ovfl_vpid().
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 | ||
) |
Definition at line 14151 of file btree.c.
References assert, ASSERT_ERROR, btree_advance_and_find_key(), BTREE_INVALID_INDEX_ID, BTREE_KEY_FOUND, btree_multicol_key_is_null(), btree_search_key_and_apply_functions(), BTREE_SEARCH_KEY_HELPER_INITIALIZER, DB_IS_NULL, error(), NO_ERROR, NULL, pgbuf_get_vpid(), btree_search_key_helper::result, btree_search_key_helper::slotid, and btid_int::sys_btid.
Referenced by btree_load_check_fk(), btree_range_scan_resume(), and btree_range_scan_start().
int btree_multicol_key_has_null | ( | DB_VALUE * | key | ) |
Definition at line 18079 of file btree.c.
References assert, db_midxkey::buf, db_get_midxkey(), DB_IS_NULL, DB_TYPE_MIDXKEY, DB_VALUE_TYPE, i, db_midxkey::ncolumns, NULL, and OR_MULTI_ATT_IS_UNBOUND.
Referenced by btree_check_foreign_key(), btree_load_check_fk(), btree_sort_get_next(), and locator_check_foreign_key().
Definition at line 18033 of file btree.c.
References assert, db_midxkey::buf, db_get_midxkey(), DB_IS_NULL, DB_TYPE_MIDXKEY, DB_VALUE_TYPE, i, db_midxkey::min_max_val, db_midxkey::ncolumns, NULL, OR_MULTI_BOUND_BIT_BYTES, and special_column::position.
Referenced by index_builder_loader_task::add_key(), btree_fix_root_for_delete(), btree_insert_internal(), btree_key_delete_remove_object(), btree_key_find_and_insert_delete_mvccid(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_insert_new_key(), btree_key_insert_new_object(), btree_key_remove_delete_mvccid(), btree_key_remove_insert_mvccid(), btree_key_remove_object_and_keep_visible_first(), btree_locate_key(), btree_merge_node_and_advance(), btree_online_index_list_dispatcher(), btree_prepare_bts(), btree_scan_update_range(), btree_sort_get_next(), btree_split_node_and_advance(), locator_add_or_remove_index_internal(), locator_check_btree_entries(), locator_check_unique_btree_entries(), locator_update_index(), and xbtree_find_unique().
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 | ||
) |
Definition at line 26021 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, assert, btree_insert_internal(), btree_mvcc_info_from_heap_mvcc_header(), BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_OP_INSERT_MVCC_DELID, vfid::fileid, MVCC_GET_DELID, NULL, oid_Null_oid, db_identifier::pageid, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btid::root_pageid, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by btree_update(), locator_add_or_remove_index_internal(), and locator_update_index().
void btree_mvcc_info_from_heap_mvcc_header | ( | MVCC_REC_HEADER * | mvcc_header, |
BTREE_MVCC_INFO * | mvcc_info | ||
) |
Definition at line 28752 of file btree.c.
References assert, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, btree_mvcc_info::delete_mvccid, btree_mvcc_info::flags, btree_mvcc_info::insert_mvccid, MVCC_GET_DELID, MVCC_GET_INSID, MVCC_IS_FLAG_SET, MVCCID_ALL_VISIBLE, MVCCID_NULL, NULL, OR_MVCC_FLAG_VALID_DELID, and OR_MVCC_FLAG_VALID_INSID.
Referenced by btree_construct_leafs(), btree_first_oid(), btree_insert(), and btree_mvcc_delete().
void btree_mvcc_info_to_heap_mvcc_header | ( | BTREE_MVCC_INFO * | mvcc_info, |
MVCC_REC_HEADER * | mvcc_header | ||
) |
Definition at line 28787 of file btree.c.
References assert, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE, btree_mvcc_info::delete_mvccid, btree_mvcc_info::insert_mvccid, mvcc_rec_header::mvcc_flag, MVCC_SET_DELID, MVCC_SET_INSID, MVCCID_ALL_VISIBLE, MVCCID_NULL, NULL, OR_MVCC_FLAG_VALID_DELID, and OR_MVCC_FLAG_VALID_INSID.
Referenced by btree_construct_leafs(), btree_fk_object_does_exist(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_and_lock_unique_of_unique(), btree_key_find_first_visible_row(), btree_record_get_num_visible_oids(), btree_record_satisfies_snapshot(), and btree_select_visible_object_for_range_scan().
int btree_online_index_check_unique_constraint | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
const char * | index_name, | ||
OID * | class_oid | ||
) |
Definition at line 35273 of file btree.c.
References ASSERT_ERROR, BTREE_SET_UNIQUE_VIOLATION_ERROR, ER_BTREE_UNIQUE_FAILED, ER_FAILED, logtb_get_global_unique_stats(), logtb_tran_find_btid_stats(), NO_ERROR, NULL, log_unique_stats::num_keys, log_unique_stats::num_nulls, log_unique_stats::num_oids, and log_tran_btid_unique_stats::tran_stats.
Referenced by xbtree_load_online_index().
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 | ||
) |
Definition at line 33272 of file btree.c.
References btree_online_index_list_dispatcher().
Referenced by btree_rv_keyval_undo_online_index_tran_delete(), btree_rv_keyval_undo_online_index_tran_insert(), locator_add_or_remove_index_internal(), and locator_update_index().
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().
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().
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().
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 | ||
) |
Definition at line 29340 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, btree_delete_internal(), btree_insert_internal(), BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_SET_DELID, BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_INSERT_MARK_DELETED, vfid::fileid, logtb_get_current_mvccid(), NULL, oid_is_serial(), db_identifier::pageid, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btid::root_pageid, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by btree_update(), locator_add_or_remove_index_internal(), locator_repair_btree_by_delete(), locator_update_index(), and xlocator_remove_class_from_index().
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().
int btree_range_scan | ( | THREAD_ENTRY * | thread_p, |
BTREE_SCAN * | bts, | ||
BTREE_RANGE_SCAN_PROCESS_KEY_FUNC * | key_func | ||
) |
Definition at line 24922 of file btree.c.
References assert, ASSERT_ERROR, btree_log_if_enabled, btree_range_scan_advance_over_filtered_keys(), btree_range_scan_resume(), btree_range_scan_start(), btree_scan_clear_key(), BTS_IS_INDEX_ILS, BTS_KEY_IS_CONSUMED, BTS_KEY_IS_VERIFIED, bts_reset_scan(), btree_scan::C_page, btree_scan::C_vpid, btree_scan::cur_leaf_lsa, btree_scan::end_one_iteration, btree_scan::end_scan, ER_FAILED, btree_scan::force_restart_from_root, btree_scan::index_scan_idp, btree_scan::is_interrupted, btree_scan::is_scan_started, btree_scan::key_limit_upper, btree_scan::key_status, LSA_COPY(), LSA_SET_NULL(), btree_scan::n_oids_read_last_iteration, NO_ERROR, NULL, btree_scan::O_page, btree_scan::O_vpid, indx_scan_id::oid_list, btree_scan::oid_ptr, btree_iscan_oid_list::oidp, btree_scan::P_page, btree_scan::P_vpid, pgbuf_get_lsa(), pgbuf_get_vpid_ptr(), pgbuf_unfix_and_init, PSTAT_BT_LEAF, PSTAT_BT_RANGE_SEARCH, PSTAT_BT_RANGE_SEARCH_TRAVERSE, PSTAT_BT_TRAVERSE, btree_scan::time_track, btree_scan::use_desc_index, VPID_EQ, VPID_ISNULL, and VPID_SET_NULL.
Referenced by btree_find_foreign_key(), 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().
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().
TP_DOMAIN* btree_read_key_type | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid | ||
) |
Definition at line 9079 of file btree.c.
References btree_get_root_header(), NULL, OLD_PAGE, or_unpack_domain(), btree_root_header::packed_key_domain, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btid::vfid, vpid::volid, and vfid::volid.
Referenced by partition_attrinfo_get_key().
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_reflect_global_unique_statistics | ( | THREAD_ENTRY * | thread_p, |
GLOBAL_UNIQUE_STATS * | unique_stat_info, | ||
bool | only_active_tran | ||
) |
Definition at line 14049 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, assert_release, global_unique_stats::btid, btree_get_root_header(), BTREE_IS_UNIQUE, DONT_FREE, ER_FAILED, vfid::fileid, global_unique_stats::last_log_lsa, logtb_is_current_active(), LSA_LT(), NO_ERROR, NULL, btree_root_header::num_keys, log_unique_stats::num_keys, btree_root_header::num_nulls, log_unique_stats::num_nulls, btree_root_header::num_oids, log_unique_stats::num_oids, log_lsa::offset, OLD_PAGE, PAGE_BTREE, log_lsa::pageid, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, pgbuf_get_lsa(), PGBUF_LATCH_WRITE, pgbuf_set_dirty(), pgbuf_set_lsa(), PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, prm_get_bool_value(), PRM_ID_LOG_UNIQUE_STATS, btid::root_pageid, btree_root_header::unique_pk, global_unique_stats::unique_stats, btid::vfid, vpid::volid, and vfid::volid.
Referenced by logtb_reflect_global_unique_stats_to_btree().
DISK_ISVALID btree_repair_prev_link | ( | THREAD_ENTRY * | thread_p, |
OID * | oid, | ||
BTID * | btid, | ||
bool | repair | ||
) |
Definition at line 8203 of file btree.c.
References ASSERT_ERROR, btree_get_btid_from_file(), btree_repair_prev_link_by_btid(), btree_repair_prev_link_by_class_oid(), DISK_ERROR, DISK_VALID, FILE_BTREE, file_tracker_interruptable_iterate(), heap_get_indexinfo_of_btid(), lock_unlock_object(), NO_ERROR, NULL, OID_INITIALIZER, OID_ISNULL, oid_Root_class_oid, SCH_S_LOCK, btid::vfid, VFID_ISNULL, and VFID_SET_NULL.
Referenced by xboot_check_db_consistency(), and xboot_checkdb_table().
void btree_rv_keyval_dump | ( | FILE * | fp, |
int | length, | ||
void * | data | ||
) |
Definition at line 17947 of file btree.c.
References BTREE_LEAF_RECORD_CLASS_OID, BTREE_OID_CLEAR_ALL_FLAGS, BTREE_OID_GET_MVCC_FLAGS, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OID_IS_RECORD_FLAG_SET, CAST_BUFLEN, vfid::fileid, log_rv_dump_hexa(), or_unpack_btid(), or_unpack_mvccid(), or_unpack_oid(), db_identifier::pageid, btid::root_pageid, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
int btree_rv_keyval_undo_delete | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17864 of file btree.c.
References assert, ASSERT_ERROR, btree_rv_read_keyval_info_nocopy(), btree_undo_delete_physical(), log_rcv::data, ER_BTREE_DUPLICATE_OID, ER_INTERRUPTED, log_rcv::length, NO_ERROR, OID_ISNULL, log_rcv::reference_lsa, and btid_int::sys_btid.
int btree_rv_keyval_undo_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17696 of file btree.c.
References assert, ASSERT_ERROR, btree_rv_read_keybuf_nocopy(), btree_undo_insert_object(), log_rcv::data, ER_BTREE_UNKNOWN_KEY, ER_INTERRUPTED, err, log_rcv::length, log_rcv::mvcc_id, MVCCID_ALL_VISIBLE, MVCCID_IS_VALID, NO_ERROR, OID_ISNULL, log_rcv::reference_lsa, and btid_int::sys_btid.
int btree_rv_keyval_undo_insert_mvcc_delid | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17801 of file btree.c.
References assert, ASSERT_ERROR, BTREE_MVCC_INFO_DELID, BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_MVCC_INFO_SET_DELID, BTREE_MVCC_INFO_SET_INSID, BTREE_RV_IS_UNDO_MVCCDEL_MYOBJ, btree_rv_read_keybuf_nocopy(), btree_undo_mvcc_delete(), log_rcv::data, btree_mvcc_info::delete_mvccid, ER_BTREE_UNKNOWN_KEY, ER_INTERRUPTED, err, log_rcv::length, btree_delete_helper::match_mvccinfo, log_rcv::mvcc_id, MVCCID_IS_VALID, MVCCID_NULL, NO_ERROR, log_rcv::offset, OID_ISNULL, log_rcv::reference_lsa, and btid_int::sys_btid.
int btree_rv_keyval_undo_insert_unique | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17750 of file btree.c.
References assert_release, BTREE_OBJECT_INFO_INITIALIZER, btree_rv_read_keybuf_two_objects(), btree_undo_insert_object_unique_multiupd(), log_rcv::data, ER_FAILED, err, log_rcv::length, log_rcv::mvcc_id, MVCCID_ALL_VISIBLE, MVCCID_IS_VALID, MVCCID_NULL, NO_ERROR, log_rcv::reference_lsa, and btid_int::sys_btid.
int btree_rv_keyval_undo_online_index_tran_delete | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 35100 of file btree.c.
References assert, ASSERT_ERROR, btree_online_index_dispatcher(), BTREE_OP_ONLINE_INDEX_UNDO_TRAN_DELETE, btree_rv_read_keyval_info_nocopy(), log_rcv::data, log_rcv::length, NO_ERROR, OID_ISNULL, pr_clear_value(), log_rcv::reference_lsa, btid_int::sys_btid, and btid_int::unique_pk.
int btree_rv_keyval_undo_online_index_tran_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 35150 of file btree.c.
References assert, ASSERT_ERROR, btree_online_index_dispatcher(), BTREE_OP_ONLINE_INDEX_UNDO_TRAN_INSERT, btree_rv_read_keyval_info_nocopy(), log_rcv::data, err, log_rcv::length, NO_ERROR, OID_ISNULL, pr_clear_value(), log_rcv::reference_lsa, btid_int::sys_btid, and btid_int::unique_pk.
int btree_rv_newpage_redo_init | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17442 of file btree.c.
References BTREE_MAX_ALIGN, DONT_SAFEGUARD_RVSPACE, NO_ERROR, PAGE_BTREE, pgbuf_set_page_ptype(), log_rcv::pgptr, spage_initialize(), and UNANCHORED_KEEP_SEQUENCE.
int btree_rv_nodehdr_redo_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17142 of file btree.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, log_rcv::data, recdes::data, DONT_FREE, er_errid(), ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), HEADER, log_rcv::length, recdes::length, NO_ERROR, pgbuf_set_dirty(), log_rcv::pgptr, REC_HOME, SP_ERROR, SP_SUCCESS, spage_insert_at(), and recdes::type.
int btree_rv_nodehdr_undo_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17175 of file btree.c.
References assert, DONT_FREE, HEADER, NO_ERROR, NULL_SLOTID, pgbuf_set_dirty(), log_rcv::pgptr, and spage_delete().
int btree_rv_nodehdr_undoredo_update | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17096 of file btree.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, log_rcv::data, recdes::data, DONT_FREE, er_errid(), ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), HEADER, log_rcv::length, recdes::length, NO_ERROR, PEEK, pgbuf_set_dirty(), log_rcv::pgptr, REC_HOME, S_SUCCESS, SP_ERROR, SP_SUCCESS, spage_get_record(), spage_update(), and recdes::type.
void btree_rv_noderec_dump | ( | FILE * | fp, |
int | length, | ||
void * | data | ||
) |
Definition at line 17296 of file btree.c.
References recdes::area_size, recdes::data, DB_PAGESIZE, free_and_init, recdes::length, OFFS1, OFFS2, OFFS3, and recdes::type.
void btree_rv_noderec_dump_slot_id | ( | FILE * | fp, |
int | length, | ||
void * | data | ||
) |
int btree_rv_noderec_redo_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17234 of file btree.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, log_rcv::data, recdes::data, DONT_FREE, er_errid(), ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), log_rcv::length, recdes::length, NO_ERROR, OFFS2, OFFS3, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, SP_ERROR, SP_SUCCESS, spage_insert_at(), and recdes::type.
int btree_rv_noderec_undo_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17271 of file btree.c.
References assert, DONT_FREE, NO_ERROR, NULL_SLOTID, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, and spage_delete_for_recovery().
int btree_rv_noderec_undoredo_update | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17197 of file btree.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, log_rcv::data, recdes::data, DONT_FREE, er_errid(), ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), log_rcv::length, recdes::length, NO_ERROR, OFFS2, OFFS3, log_rcv::offset, pgbuf_set_dirty(), log_rcv::pgptr, SP_ERROR, SP_SUCCESS, spage_update(), and recdes::type.
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_ovfid_undoredo_update | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17039 of file btree.c.
References ARG_FILE_LINE, assert, btree_get_root_header(), log_rcv::data, DONT_FREE, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), log_rcv::length, NO_ERROR, NULL, btree_root_header::ovfid, pgbuf_set_dirty(), and log_rcv::pgptr.
int btree_rv_pagerec_delete | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17410 of file btree.c.
References assert, ASSERT_ERROR, log_rcv::data, DONT_FREE, er_errid(), recset_header::first_slotid, for(), i, NO_ERROR, pgbuf_set_dirty(), log_rcv::pgptr, recset_header::rec_cnt, and spage_delete().
int btree_rv_pagerec_insert | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 17347 of file btree.c.
References recdes::area_size, ARG_FILE_LINE, assert, ASSERT_ERROR, BTREE_MAX_ALIGN, log_rcv::data, recdes::data, DB_WASTED_ALIGN, DONT_FREE, er_errid(), ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), recset_header::first_slotid, i, recdes::length, NO_ERROR, pgbuf_set_dirty(), log_rcv::pgptr, recset_header::rec_cnt, SP_ERROR, SP_SUCCESS, spage_insert_at(), and recdes::type.
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 | ||
) |
Definition at line 17567 of file btree.c.
References assert, BTREE_LEAF_RECORD_CLASS_OID, BTREE_OID_CLEAR_ALL_FLAGS, BTREE_OID_GET_MVCC_FLAGS, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OID_IS_RECORD_FLAG_SET, CAST_BUFLEN, btree_mvcc_info::delete_mvccid, btree_mvcc_info::flags, btree_mvcc_info::insert_mvccid, INT_ALIGNMENT, MVCCID_ALL_VISIBLE, MVCCID_NULL, NULL, OID_SET_NULL, OR_GET_MVCCID, OR_GET_OID, or_init(), OR_MVCCID_SIZE, OR_OID_SIZE, or_unpack_btid(), PTR_ALIGN, and btid_int::sys_btid.
Referenced by btree_rv_keyval_undo_insert(), btree_rv_keyval_undo_insert_mvcc_delid(), btree_rv_read_keyval_info_nocopy(), btree_rv_remove_marked_for_delete(), and vacuum_process_log_block().
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 | ||
) |
Definition at line 17631 of file btree.c.
References assert, BTREE_LEAF_RECORD_CLASS_OID, BTREE_OID_CLEAR_ALL_FLAGS, BTREE_OID_GET_MVCC_FLAGS, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OID_IS_MVCC_FLAG_SET, BTREE_OID_IS_RECORD_FLAG_SET, CAST_BUFLEN, btree_object_info::class_oid, btree_mvcc_info::delete_mvccid, btree_mvcc_info::flags, btree_mvcc_info::insert_mvccid, INT_ALIGNMENT, btree_object_info::mvcc_info, NULL, btree_object_info::oid, OID_SET_NULL, or_init(), or_unpack_btid(), or_unpack_mvccid(), or_unpack_oid(), PTR_ALIGN, and btid_int::sys_btid.
Referenced by btree_rv_keyval_undo_insert_unique(), and vacuum_process_log_block().
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 | ||
) |
Definition at line 17473 of file btree.c.
References assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, btree_get_root_header(), btree_glean_root_header_info(), btree_rv_read_keybuf_nocopy(), CAST_BUFLEN, DB_TYPE_MIDXKEY, or_buf::endptr, ER_FAILED, error(), pr_type::id, pr_type::index_readval(), btid_int::key_type, NO_ERROR, NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, or_buf::ptr, btid::root_pageid, btid_int::sys_btid, tp_domain::type, btid::vfid, vpid::volid, and vfid::volid.
Referenced by btree_rv_keyval_undo_delete(), btree_rv_keyval_undo_online_index_tran_delete(), and btree_rv_keyval_undo_online_index_tran_insert().
int btree_rv_redo_global_unique_stats_commit | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 22425 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, assert, global_unique_stats_table::curr_rcv_rec_lsa, log_rcv::data, disk_is_page_sector_reserved(), DISK_VALID, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), vfid::fileid, log_rcv::length, log_Gl, logtb_rv_update_global_unique_stats_by_abs(), NO_ERROR, log_lsa::offset, OR_BTID_ALIGNED_SIZE, OR_GET_BTID, OR_GET_INT, OR_INT_SIZE, log_lsa::pageid, prm_get_bool_value(), PRM_ID_LOG_UNIQUE_STATS, btid::root_pageid, log_global::unique_stats_table, btid::vfid, and vfid::volid.
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().
int btree_rv_remove_marked_for_delete | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | rcv | ||
) |
Definition at line 17914 of file btree.c.
References assert, assert_release, btree_delete_postponed(), BTREE_OBJECT_INFO_INITIALIZER, btree_rv_read_keybuf_nocopy(), btree_object_info::class_oid, log_rcv::data, btree_mvcc_info::delete_mvccid, log_rcv::length, LSA_ISNULL(), btree_object_info::mvcc_info, NO_ERROR, btree_delete_helper::object_info, btree_object_info::oid, log_rcv::reference_lsa, and btid_int::sys_btid.
int btree_rv_remove_unique_stats | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 29276 of file btree.c.
References assert, assert_release, log_rcv::data, log_tran_btid_unique_stats::deleted, ER_FAILED, log_rcv::length, log_append_redo_data(), log_check_system_op_is_started(), LOG_DATA_ADDR_INITIALIZER, logtb_delete_global_unique_stats(), logtb_tran_find_btid_stats(), NO_ERROR, NULL, log_data_addr::offset, log_rcv::offset, and RVBT_REMOVE_UNIQUE_STATS.
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_roothdr_undo_update | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 16966 of file btree.c.
References ARG_FILE_LINE, assert, btree_get_root_header(), log_rcv::data, DONT_FREE, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), log_rcv::length, NO_ERROR, NULL, btree_root_header::num_keys, btree_root_header::num_nulls, btree_root_header::num_oids, OR_GET_INT, OR_INT_SIZE, pgbuf_set_dirty(), and log_rcv::pgptr.
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 | ||
) |
Definition at line 16504 of file btree.c.
References assert, ASSERT_ALIGN, ASSERT_ERROR, ASSERT_ERROR_AND_SET, btree_get_disk_size_of_key(), BTREE_IS_UNIQUE, BTREE_LEAF_RECORD_CLASS_OID, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_MVCC_INFO_IS_INSID_NOT_ALL_VISIBLE, BTREE_OBJECT_MAX_SIZE, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OID_IS_MVCC_FLAG_SET, BTREE_OID_SET_MVCC_FLAG, BTREE_OID_SET_RECORD_FLAG, BTREE_OP_DELETE_OBJECT_PHYSICAL, BTREE_OP_INSERT_MARK_DELETED, BTREE_OP_NOTIFY_VACUUM, BTREE_OP_ONLINE_INDEX_TRAN_DELETE, CAST_BUFLEN, COPY_OID, db_private_alloc, db_private_free_and_init, db_private_realloc, btree_mvcc_info::delete_mvccid, pr_type::index_writeval(), btree_mvcc_info::insert_mvccid, INT_ALIGNMENT, btid_int::key_type, logtb_get_current_mvccid(), MVCCID_IS_NOT_ALL_VISIBLE, MVCCID_IS_VALID, NO_ERROR, NULL, OID_EQ, OR_BTID_ALIGNED_SIZE, or_init(), OR_MVCCID_SIZE, OR_OID_SIZE, or_pack_btid(), OR_PUT_MVCCID, OR_PUT_OID, btid_int::sys_btid, btid_int::topclass_oid, tp_domain::type, and btid_int::unique_pk.
Referenced by btree_construct_leafs(), btree_insert_mvcc_delid_into_page(), btree_key_delete_remove_object(), btree_key_insert_new_object(), btree_key_online_index_tran_delete(), btree_key_online_index_tran_insert(), and btree_key_online_index_tran_insert_DF().
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 | ||
) |
Definition at line 16714 of file btree.c.
References assert, ASSERT_ALIGN, ASSERT_ERROR, ASSERT_ERROR_AND_SET, btree_dump_leaf_record(), btree_dump_non_leaf_record(), btree_get_disk_size_of_key(), BTREE_IS_UNIQUE, BTREE_LEAF_RECORD_CLASS_OID, BTREE_MVCC_INFO_IS_DELID_VALID, BTREE_OID_HAS_MVCC_DELID, BTREE_OID_HAS_MVCC_INSID, BTREE_OID_IS_MVCC_FLAG_SET, BTREE_OID_SET_MVCC_FLAG, BTREE_OID_SET_RECORD_FLAG, BTREE_OP_INSERT_NEW_OBJECT, CAST_BUFLEN, btree_object_info::class_oid, COPY_OID, db_private_alloc, db_private_free_and_init, db_private_realloc, btree_mvcc_info::delete_mvccid, pr_type::index_writeval(), btree_mvcc_info::insert_mvccid, INT_ALIGNMENT, btid_int::key_type, btree_object_info::mvcc_info, NO_ERROR, NULL, btree_object_info::oid, OID_EQ, OR_BTID_ALIGNED_SIZE, or_init(), OR_OID_SIZE, or_pack_btid(), or_pack_mvccid(), or_pack_oid(), btid_int::sys_btid, btid_int::topclass_oid, tp_domain::type, and btid_int::unique_pk.
Referenced by btree_key_lock_and_append_object_unique().
int btree_rv_undo_global_unique_stats_commit | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 22356 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, assert, global_unique_stats_table::curr_rcv_rec_lsa, log_rcv::data, disk_is_page_sector_reserved(), DISK_VALID, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), vfid::fileid, log_rcv::length, log_Gl, LOG_RECOVERY_UNDO_PHASE, logtb_update_global_unique_stats_by_delta(), NO_ERROR, log_lsa::offset, OR_BTID_ALIGNED_SIZE, OR_GET_BTID, OR_GET_INT, OR_INT_SIZE, log_lsa::pageid, prm_get_bool_value(), PRM_ID_LOG_UNIQUE_STATS, log_global::rcv_phase, btid::root_pageid, log_global::unique_stats_table, btid::vfid, and vfid::volid.
int btree_rv_undo_mark_dealloc_page | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | rcv | ||
) |
Definition at line 32847 of file btree.c.
References assert, btree_get_node_header(), log_rcv::data, DONT_FREE, ER_FAILED, log_rcv::length, NO_ERROR, btree_node_header::node_level, NULL, pgbuf_set_dirty(), and log_rcv::pgptr.
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 | ||
) |
Definition at line 17996 of file btree.c.
References log_rcv::data, DB_PAGESIZE, DONT_FREE, NO_ERROR, PAGE_BTREE, pgbuf_set_dirty(), pgbuf_set_page_ptype(), and log_rcv::pgptr.
int btree_rv_update_tran_stats | ( | THREAD_ENTRY * | thread_p, |
LOG_RCV * | recv | ||
) |
Definition at line 16922 of file btree.c.
References ARG_FILE_LINE, assert, log_rcv::data, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), log_rcv::length, logtb_tran_update_unique_stats(), NO_ERROR, OR_BTID_ALIGNED_SIZE, OR_GET_BTID, OR_GET_INT, and OR_INT_SIZE.
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().
void btree_scan_clear_key | ( | BTREE_SCAN * | btree_scan | ) |
Definition at line 6035 of file btree.c.
References btree_clear_key_value(), btree_scan::clear_cur_key, and btree_scan::cur_key.
Referenced by btree_get_next_key_info(), btree_keyoid_checkscan_check(), btree_range_scan(), btree_range_scan_read_record(), btree_range_scan_start(), locator_check_primary_key_delete(), locator_check_primary_key_update(), locator_prefetch_index_page_internal(), and scan_end_scan().
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 at line 18312 of file btree.c.
References assert, db_private_free, er_clear(), er_set(), vfid::fileid, free_and_init, heap_get_class_name(), heap_get_indexinfo_of_btid(), LK_FORCE_ZERO_WAIT, NO_ERROR, NULL, OID_ISNULL, OID_MSG_BUF_SIZE, db_identifier::pageid, pr_valstring(), btid::root_pageid, db_identifier::slotid, VACUUM_IS_THREAD_VACUUM, btid::vfid, vfid::volid, db_identifier::volid, and xlogtb_reset_wait_msecs().
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().
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 | ||
) |
Definition at line 21297 of file btree.c.
References assert, BTREE_INIT_MVCC_HEADER, MVCC_SET_DELID, MVCC_SET_FLAG_BITS, MVCC_SET_INSID, NULL, OR_MVCC_FLAG_VALID_DELID, and OR_MVCC_FLAG_VALID_INSID.
Referenced by locator_add_or_remove_index_internal(), and locator_update_index().
char* btree_unpack_mvccinfo | ( | char * | ptr, |
BTREE_MVCC_INFO * | mvcc_info, | ||
short | btree_mvcc_flags | ||
) |
Definition at line 21338 of file btree.c.
References assert, BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, btree_mvcc_info::delete_mvccid, btree_mvcc_info::flags, btree_mvcc_info::insert_mvccid, MVCCID_ALL_VISIBLE, MVCCID_NULL, NULL, and or_unpack_mvccid().
Referenced by btree_find_oid_from_ovfl(), btree_or_get_mvccinfo(), and btree_seq_find_oid_from_ovfl().
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 | ||
) |
Definition at line 13967 of file btree.c.
References assert, ASSERT_ERROR, assert_release, btree_insert(), btree_mvcc_delete(), btree_physical_delete(), ER_BTREE_UNKNOWN_KEY, er_errid(), NO_ERROR, NULL, perfmon_inc_stat(), and PSTAT_BT_NUM_UPDATES.
Referenced by locator_update_index().
int btree_vacuum_insert_mvccid | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
OR_BUF * | buffered_key, | ||
OID * | oid, | ||
OID * | class_oid, | ||
MVCCID | insert_mvccid | ||
) |
Definition at line 29397 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, btree_delete_internal(), BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_SET_INSID, BTREE_OP_DELETE_VACUUM_INSID, vfid::fileid, btree_delete_helper::match_mvccinfo, NULL, db_identifier::pageid, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btid::root_pageid, SINGLE_ROW_MODIFY, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by vacuum_process_log_block().
int btree_vacuum_object | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid, | ||
OR_BUF * | buffered_key, | ||
OID * | oid, | ||
OID * | class_oid, | ||
MVCCID | delete_mvccid | ||
) |
Definition at line 29429 of file btree.c.
References _er_log_debug(), ARG_FILE_LINE, btree_delete_internal(), BTREE_MVCC_INFO_INITIALIZER, BTREE_MVCC_INFO_SET_DELID, BTREE_OP_DELETE_VACUUM_OBJECT, vfid::fileid, btree_delete_helper::match_mvccinfo, NULL, db_identifier::pageid, prm_get_bool_value(), PRM_ID_LOG_BTREE_OPS, btid::root_pageid, SINGLE_ROW_MODIFY, db_identifier::slotid, btid::vfid, vfid::volid, and db_identifier::volid.
Referenced by vacuum_process_log_block().
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 | ||
) |
Definition at line 4076 of file btree.c.
References recdes::area_size, assert, assert_release, BTREE_IS_UNIQUE, BTREE_LEAF_NODE, BTREE_LEAF_RECORD_CLASS_OID, BTREE_LEAF_RECORD_OVERFLOW_KEY, btree_leaf_set_flag(), BTREE_MVCC_INFO_HAS_DELID, BTREE_MVCC_INFO_HAS_INSID, BTREE_NON_LEAF_NODE, BTREE_NORMAL_KEY, BTREE_OVERFLOW_KEY, btree_record_object_set_mvcc_flags(), btree_store_overflow_key(), btree_write_fixed_portion_of_non_leaf_record_to_orbuf(), or_buf::buffer, CAST_BUFLEN, recdes::data, btree_mvcc_info::delete_mvccid, btree_mvcc_info::flags, pr_type::index_writeval(), btree_mvcc_info::insert_mvccid, btid_int::key_type, recdes::length, NO_ERROR, btid_int::nonleaf_key_type, NULL, OID_EQ, or_init(), or_put_align32(), or_put_int(), or_put_mvccid(), or_put_oid(), or_put_short(), vpid::pageid, or_buf::ptr, REC_HOME, btid_int::topclass_oid, tp_domain::type, recdes::type, btid_int::unique_pk, and vpid::volid.
Referenced by btree_connect_page(), btree_first_oid(), btree_key_insert_new_key(), btree_split_node(), btree_split_root(), and btree_split_test().
int xbtree_get_key_type | ( | THREAD_ENTRY * | thread_p, |
BTID | btid, | ||
TP_DOMAIN ** | key_type | ||
) |
Definition at line 7167 of file btree.c.
References assert, btree_get_root_header(), ER_FAILED, NO_ERROR, NULL, OLD_PAGE, or_get_domain(), or_init(), btree_root_header::packed_key_domain, vpid::pageid, pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix, btid::root_pageid, btid::vfid, vpid::volid, and vfid::volid.
Referenced by btree_get_index_key_type(), and sbtree_get_key_type().
int xbtree_get_unique_pk | ( | THREAD_ENTRY * | thread_p, |
BTID * | btid | ||
) |
Definition at line 6129 of file btree.c.
References btree_get_root_header(), NULL, OLD_PAGE, PAGE_BTREE, vpid::pageid, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btid::root_pageid, btree_root_header::unique_pk, btid::vfid, vpid::volid, and vfid::volid.
Referenced by locator_check_class(), and xstats_get_statistics_from_server().