CUBRID Engine
latest
|
#include "dbtype_def.h"
#include "log_lsa.hpp"
#include "mvcc.h"
#include "storage_common.h"
#include "system_catalog.h"
#include <atomic>
Go to the source code of this file.
Classes | |
struct | or_default_value |
union | or_aligned_oid |
struct | or_auto_increment |
struct | or_attribute |
struct | or_foreign_key |
struct | or_predicate |
struct | or_function_index |
struct | or_index |
struct | or_partition |
struct | or_classrep |
struct | or_class |
Macros | |
#define | OR_ATT_BTID_PREALLOC 8 |
Typedefs | |
typedef struct or_default_value | OR_DEFAULT_VALUE |
typedef struct or_attribute | OR_ATTRIBUTE |
typedef struct or_foreign_key | OR_FOREIGN_KEY |
typedef struct or_predicate | OR_PREDICATE |
typedef struct or_function_index | OR_FUNCTION_INDEX |
typedef struct or_index | OR_INDEX |
typedef struct or_partition | OR_PARTITION |
typedef struct or_classrep | OR_CLASSREP |
typedef struct or_class | OR_CLASS |
Enumerations | |
enum | OR_INDEX_STATUS { OR_NO_INDEX = 0, OR_NORMAL_INDEX = 1, OR_INVISIBLE_INDEX = 2, OR_ONLINE_INDEX_BUILDING_IN_PROGRESS = 3, OR_RESERVED_INDEX_STATUS1 = 4, OR_RESERVED_INDEX_STATUS2 = 5, OR_RESERVED_INDEX_STATUS3 = 6, OR_RESERVED_INDEX_STATUS4 = 7, OR_RESERVED_INDEX_STATUS5 = 8, OR_RESERVED_INDEX_STATUS6 = 9, OR_LAST_INDEX_STATUS = 10 } |
#define OR_ATT_BTID_PREALLOC 8 |
Definition at line 46 of file object_representation_sr.h.
Referenced by or_install_btids_attribute().
typedef struct or_attribute OR_ATTRIBUTE |
Definition at line 89 of file object_representation_sr.h.
Definition at line 219 of file object_representation_sr.h.
typedef struct or_classrep OR_CLASSREP |
Definition at line 196 of file object_representation_sr.h.
typedef struct or_default_value OR_DEFAULT_VALUE |
Definition at line 49 of file object_representation_sr.h.
typedef struct or_foreign_key OR_FOREIGN_KEY |
Definition at line 121 of file object_representation_sr.h.
typedef struct or_function_index OR_FUNCTION_INDEX |
Definition at line 142 of file object_representation_sr.h.
Definition at line 169 of file object_representation_sr.h.
typedef struct or_partition OR_PARTITION |
Definition at line 186 of file object_representation_sr.h.
typedef struct or_predicate OR_PREDICATE |
Definition at line 134 of file object_representation_sr.h.
enum OR_INDEX_STATUS |
Definition at line 153 of file object_representation_sr.h.
int or_class_get_partition_info | ( | RECDES * | record, |
OR_PARTITION * | partition_info, | ||
REPR_ID * | repr_id, | ||
int * | has_partition_info | ||
) |
Definition at line 3408 of file object_representation_sr.c.
References assert, CAST_BUFLEN, or_partition::class_hfid, recdes::data, db_get_set(), db_seq_copy(), or_buf::endptr, ER_FAILED, NO_ERROR, NULL, or_class_hfid(), OR_GET_INT, or_get_value(), or_init(), or_rep_id(), OR_SET_ELEMENT_OFFSET, OR_VAR_IS_NULL, OR_VAR_OFFSET, OR_VAR_TABLE_ELEMENT_LENGTH, OR_VAR_TABLE_ELEMENT_OFFSET, OR_VAR_TABLE_SIZE, ORC_PARTITION_INDEX, ORC_PARTITION_VALUES_INDEX, ORC_PARTITION_VAR_ATT_COUNT, or_partition::partition_type, pr_clear_value(), or_buf::ptr, or_partition::rep_id, and or_partition::values.
Referenced by heap_class_get_partition_info().
Definition at line 732 of file object_representation_sr.c.
References assert, BIG_VAR_OFFSET_SIZE, recdes::data, vfid::fileid, hfid::hpgid, OR_FIXED_ATTRIBUTES_OFFSET, OR_GET_INT, OR_GET_OFFSET_SIZE, ORC_CLASS_VAR_ATT_COUNT, ORC_HFID_FILEID_OFFSET, ORC_HFID_PAGEID_OFFSET, ORC_HFID_VOLID_OFFSET, hfid::vfid, and vfid::volid.
Referenced by catalog_get_representation(), catalog_update(), heap_class_get_partition_info(), heap_get_class_info_from_record(), locator_check_all_entries_of_all_btrees(), locator_check_unique_btree_entries(), locator_prefetch_index_page_internal(), or_class_get_partition_info(), or_get_hierarchy_helper(), and orc_class_info_from_record().
Definition at line 708 of file object_representation_sr.c.
References assert, BIG_VAR_OFFSET_SIZE, recdes::data, OR_FIXED_ATTRIBUTES_OFFSET, OR_GET_OFFSET_SIZE, OR_GET_OID, ORC_CLASS_VAR_ATT_COUNT, and ORC_REP_DIR_OFFSET.
Referenced by catalog_get_dir_oid_from_cache(), catalog_get_rep_dir(), catalog_get_representation(), catalog_update(), locator_insert_force(), locator_update_force(), orc_class_info_from_record(), and xcatalog_check_rep_dir().
void or_class_tde_algorithm | ( | RECDES * | record, |
TDE_ALGORITHM * | tde_algo | ||
) |
Definition at line 752 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, BIG_VAR_OFFSET_SIZE, recdes::data, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), i, max, NO_ERROR, NULL, OID_ISNULL, OID_SET_NULL, OR_FIXED_ATTRIBUTES_OFFSET, OR_GET_INT, OR_GET_OFFSET_SIZE, OR_GET_OID, OR_INT_SIZE, OR_OID_SIZE, OR_SET_ELEMENT_COUNT, OR_SET_HEADER_SIZE, OR_VAR_IS_NULL, OR_VAR_OFFSET, ORC_CLASS_TDE_ALGORITHM, ORC_CLASS_VAR_ATT_COUNT, and ORC_SUBCLASSES_INDEX.
Referenced by heap_get_class_tde_algorithm(), and locator_update_force().
OR_CLASSREP* or_classrep_load_indexes | ( | OR_CLASSREP * | rep, |
RECDES * | record | ||
) |
Definition at line 3378 of file object_representation_sr.c.
References or_classrep::id, or_classrep::needs_indexes, or_free_classrep(), and or_get_classrep().
void or_free_classrep | ( | OR_CLASSREP * | rep | ) |
Definition at line 3603 of file object_representation_sr.c.
References or_index::asc_desc, or_classrep::attributes, or_index::attrs_prefix_length, or_index::atts, or_attribute::btid_pack, or_attribute::btids, or_index::btname, or_classrep::class_attrs, or_attribute::current_default_value, or_default_value::default_expr, db_default_expr::default_expr_format, or_attribute::default_value, or_function_index::expr_stream, or_function_index::expr_string, or_index::filter_predicate, or_index::fk, or_foreign_key::fkname, free_and_init, or_index::func_index_info, i, or_classrep::indexes, or_foreign_key::next, NULL, or_predicate::pred_stream, or_predicate::pred_string, or_classrep::shared_attrs, and or_default_value::value.
Referenced by heap_classrepr_dump_all(), heap_classrepr_entry_reset(), heap_classrepr_finalize_cache(), heap_classrepr_free(), heap_classrepr_get(), or_classrep_load_indexes(), or_get_all_representation(), or_get_hierarchy_helper(), and orc_diskrep_from_record().
OR_CLASSREP** or_get_all_representation | ( | RECDES * | record, |
bool | do_indexes, | ||
int * | count | ||
) |
Definition at line 3092 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, or_classrep::attributes, BIG_VAR_OFFSET_SIZE, BTID_SET_NULL, or_attribute::btids, or_classrep::class_attrs, classobj_initialize_default_expr(), or_attribute::classoid, or_attribute::current_default_value, recdes::data, DB_ATT_ALIGN, db_set_free(), or_default_value::default_expr, or_attribute::default_value, or_attribute::domain, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), or_classrep::fixed_length, free_and_init, or_classrep::has_partition_info, i, or_attribute::id, or_classrep::id, or_attribute::index, or_classrep::indexes, or_attribute::is_fixed, or_attribute::location, or_classrep::n_attributes, or_attribute::n_btids, or_classrep::n_class_attrs, or_classrep::n_indexes, or_classrep::n_shared_attrs, or_classrep::n_variable, or_classrep::needs_indexes, or_classrep::next, NULL, OID_SET_NULL, or_free_classrep(), or_get_current_representation(), or_get_domain_and_cache(), OR_GET_INT, OR_GET_OFFSET_SIZE, or_install_btids(), OR_SET_ELEMENT_COUNT, OR_SET_ELEMENT_OFFSET, or_unpack_setref(), OR_VAR_IS_NULL, OR_VAR_OFFSET, OR_VAR_TABLE_ELEMENT_LENGTH, OR_VAR_TABLE_ELEMENT_OFFSET, OR_VAR_TABLE_SIZE, ORC_PARTITION_INDEX, ORC_PROPERTIES_INDEX, ORC_REP_ATTRIBUTES_INDEX, ORC_REP_FIXED_COUNT_OFFSET, ORC_REP_ID_OFFSET, ORC_REP_VAR_ATT_COUNT, ORC_REP_VARIABLE_COUNT_OFFSET, ORC_REPATT_DOMAIN_INDEX, ORC_REPATT_ID_OFFSET, ORC_REPATT_TYPE_OFFSET, ORC_REPATT_VAR_ATT_COUNT, ORC_REPRESENTATIONS_INDEX, or_attribute::position, or_classrep::shared_attrs, tp_domain_disk_size(), tp_domain_resolve_default(), or_attribute::type, or_default_value::val_length, and or_default_value::value.
Referenced by heap_classrepr_dump_all().
int or_get_attrcomment | ( | RECDES * | record, |
int | attrid, | ||
char ** | string, | ||
int * | alloced_string | ||
) |
Definition at line 3993 of file object_representation_sr.c.
References or_get_attr_string(), and ORC_ATT_COMMENT_INDEX.
Referenced by qexec_execute_build_columns().
int or_get_attrname | ( | RECDES * | record, |
int | attrid, | ||
char ** | string, | ||
int * | alloced_string | ||
) |
Definition at line 3974 of file object_representation_sr.c.
References or_get_attr_string(), and ORC_ATT_NAME_INDEX.
Referenced by catcls_compile_catalog_classes(), catcls_get_apply_info_log_record_time(), catcls_get_db_collation(), catcls_get_server_compat_info(), css_make_access_status_exist_user(), heap_classrepr_dump(), heap_get_partition_attributes(), heap_set_autoincrement_value(), index_attrs_to_string(), qexec_execute_build_columns(), qexec_execute_build_indexes(), cubload::server_class_installer::register_class_with_attributes(), and serial_load_attribute_info_of_db_serial().
OR_CLASSREP* or_get_classrep | ( | RECDES * | record, |
int | repid | ||
) |
Definition at line 3307 of file object_representation_sr.c.
References assert, BIG_VAR_OFFSET_SIZE, recdes::data, NULL_REPRID, or_get_current_representation(), OR_GET_OFFSET_SIZE, or_get_old_representation(), and or_rep_id().
Referenced by heap_classrepr_get_from_record(), or_classrep_load_indexes(), or_get_hierarchy_helper(), and orc_diskrep_from_record().
OR_CLASSREP* or_get_classrep_noindex | ( | RECDES * | record, |
int | repid | ||
) |
Definition at line 3343 of file object_representation_sr.c.
References assert, BIG_VAR_OFFSET_SIZE, recdes::data, NULL_REPRID, or_get_current_representation(), OR_GET_OFFSET_SIZE, or_get_old_representation(), and or_rep_id().
Definition at line 3471 of file object_representation_sr.c.
References assert, recdes::data, db_get_set(), db_get_string(), DB_IS_NULL, DB_TYPE_SEQUENCE, DB_TYPE_STRING, DB_VALUE_TYPE, error(), i, or_classrep::needs_indexes, NO_ERROR, NULL, or_unpack_setref(), OR_VAR_IS_NULL, OR_VAR_OFFSET, ORC_PROPERTIES_INDEX, set_free(), set_get_element_nocopy(), set_size(), SM_PROPERTY_FOREIGN_KEY, SM_PROPERTY_INDEX, SM_PROPERTY_PRIMARY_KEY, SM_PROPERTY_REVERSE_INDEX, SM_PROPERTY_REVERSE_UNIQUE, SM_PROPERTY_UNIQUE, and strdup().
Referenced by qexec_execute_build_indexes().
int or_get_unique_hierarchy | ( | THREAD_ENTRY * | thread_p, |
RECDES * | record, | ||
int | attrid, | ||
BTID * | btid, | ||
OID ** | class_oids, | ||
HFID ** | hfids, | ||
int * | num_heaps, | ||
int * | partition_local_index | ||
) |
Definition at line 1102 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, BIG_VAR_OFFSET_SIZE, recdes::data, ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), error(), free_and_init, i, NO_ERROR, NULL, OR_FIXED_ATTRIBUTES_OFFSET, or_get_hierarchy_helper(), OR_GET_INT, OR_GET_OFFSET_SIZE, OR_GET_OID, OR_SET_ELEMENT_OFFSET, OR_VAR_OFFSET, OR_VAR_TABLE_ELEMENT_LENGTH, OR_VAR_TABLE_ELEMENT_OFFSET, OR_VAR_TABLE_SIZE, ORC_ATT_CLASS_OFFSET, ORC_ATT_ID_OFFSET, ORC_ATT_NAME_INDEX, ORC_ATT_VAR_ATT_COUNT, ORC_ATTRIBUTES_INDEX, ORC_CLASS_VAR_ATT_COUNT, ORC_FIXED_COUNT_OFFSET, and ORC_VARIABLE_COUNT_OFFSET.
Referenced by locator_check_unique_btree_entries().
int or_mvcc_add_header | ( | RECDES * | record, |
MVCC_REC_HEADER * | mvcc_rec_header, | ||
int | bound_bit, | ||
int | variable_offset_size | ||
) |
Definition at line 4335 of file object_representation_sr.c.
References recdes::area_size, assert, or_buf::buffer, CAST_BUFLEN, recdes::data, er_errid(), ER_FAILED, error(), recdes::length, mvcc_rec_header::mvcc_flag, NO_ERROR, NULL, OR_BUF_INIT, or_mvcc_set_chn(), or_mvcc_set_delid(), or_mvcc_set_insid(), or_mvcc_set_prev_version_lsa(), or_mvcc_set_repid_and_flags(), or_buf::ptr, and mvcc_rec_header::repid.
Referenced by heap_delete_home(), heap_delete_relocation(), heap_rv_mvcc_redo_insert(), and heap_rv_mvcc_redo_redistribute().
int or_mvcc_get_header | ( | RECDES * | record, |
MVCC_REC_HEADER * | mvcc_rec_header | ||
) |
Definition at line 4191 of file object_representation_sr.c.
References assert, mvcc_rec_header::chn, recdes::data, er_errid(), ER_FAILED, recdes::length, mvcc_rec_header::mvcc_del_id, mvcc_rec_header::mvcc_flag, mvcc_rec_header::mvcc_ins_id, NO_ERROR, NULL, or_init(), OR_MVCC_FLAG_MASK, OR_MVCC_FLAG_SHIFT_BITS, or_mvcc_get_chn(), or_mvcc_get_delid(), or_mvcc_get_insid(), or_mvcc_get_prev_version_lsa(), or_mvcc_get_repid_and_flags(), OR_MVCC_REP_SIZE, OR_MVCC_REPID_MASK, mvcc_rec_header::prev_version_lsa, rc, and mvcc_rec_header::repid.
Referenced by btree_sort_get_next(), heap_delete_home(), heap_delete_relocation(), heap_get_if_diff_chn(), heap_get_mvcc_header(), heap_get_mvcc_rec_header_from_overflow(), heap_get_record_info(), heap_get_visible_version_from_log(), heap_insert_adjust_recdes_header(), heap_mvcc_log_redistribute(), heap_rv_mvcc_redo_delete_internal(), heap_rv_mvcc_undo_delete(), heap_update_adjust_recdes_header(), locator_lock_and_get_object_internal(), locator_lock_and_get_object_with_evaluation(), locator_update_force(), lock_demote_class_lock(), vacuum_check_not_vacuumed_recdes(), vacuum_heap_prepare_record(), vacuum_rv_check_at_undo(), and vacuum_rv_redo_vacuum_heap_page().
int or_mvcc_set_header | ( | RECDES * | record, |
MVCC_REC_HEADER * | mvcc_rec_header | ||
) |
Definition at line 4250 of file object_representation_sr.c.
References recdes::area_size, assert, recdes::data, er_errid(), ER_FAILED, error(), HEAP_MOVE_INSIDE_RECORD, recdes::length, mvcc_rec_header::mvcc_flag, mvcc_header_size_lookup, NO_ERROR, NULL, OR_BOUND_BIT_FLAG, OR_BUF_INIT, OR_GET_MVCC_REPID_AND_FLAG, OR_GET_OFFSET_SIZE, OR_MVCC_FLAG_MASK, OR_MVCC_FLAG_SHIFT_BITS, OR_MVCC_MIN_HEADER_SIZE, or_mvcc_set_chn(), or_mvcc_set_delid(), or_mvcc_set_insid(), or_mvcc_set_prev_version_lsa(), or_mvcc_set_repid_and_flags(), and mvcc_rec_header::repid.
Referenced by heap_insert_adjust_recdes_header(), heap_rv_mvcc_redo_delete_internal(), heap_rv_mvcc_undo_delete(), heap_set_mvcc_rec_header_on_overflow(), heap_update_adjust_recdes_header(), locator_update_force(), vacuum_rv_check_at_undo(), and vacuum_rv_redo_vacuum_heap_page().
Definition at line 4394 of file object_representation_sr.c.
References assert, recdes::data, ER_FAILED, NO_ERROR, NULL, OR_INT_SIZE, OR_MVCC_FLAG_VALID_DELID, OR_MVCC_FLAG_VALID_INSID, OR_MVCC_FLAG_VALID_PREV_VERSION, or_mvcc_get_flag(), OR_MVCC_PREV_VERSION_LSA_SIZE, OR_MVCC_REP_SIZE, OR_MVCCID_SIZE, and OR_REP_OFFSET.
Referenced by heap_update_bigone(), and heap_update_set_prev_version().
int or_replace_rep_id | ( | RECDES * | record, |
int | repid | ||
) |
Definition at line 4131 of file object_representation_sr.c.
References recdes::area_size, or_buf::buffer, recdes::data, NO_ERROR, OR_BOUND_BIT_FLAG, OR_BUF_INIT, OR_GET_BOUND_BIT_FLAG, OR_GET_MVCC_REPID_AND_FLAG, OR_GET_OFFSET_SIZE, or_mvcc_get_flag(), OR_MVCC_REPID_MASK, or_put_int(), OR_REP_OFFSET, OR_SET_VAR_OFFSET_SIZE, and or_buf::ptr.
Referenced by locator_insert_force(), and locator_repl_prepare_force().
Definition at line 494 of file object_representation_sr.c.
References ARG_FILE_LINE, cls_info::ci_hfid, cls_info::ci_rep_dir, cls_info::ci_time_stamp, cls_info::ci_tot_objects, cls_info::ci_tot_pages, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), NULL, or_class_hfid(), and or_class_rep_dir().
Referenced by catalog_insert().
DISK_REPR* orc_diskrep_from_record | ( | THREAD_ENTRY * | thread_p, |
RECDES * | record | ||
) |
Definition at line 173 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, or_classrep::attributes, disk_attribute::bt_stats, btree_stats::btid, or_index::btid, BTID_IS_EQUAL, or_attribute::btids, btree_get_root_header(), btree_glean_root_header_info(), BTREE_STATS_PKEYS_NUM, BTREE_STATS_RESERVED_NUM, disk_attribute::classoid, or_attribute::classoid, or_function_index::col_id, DB_TYPE_MIDXKEY, or_attribute::default_value, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), disk_representation::fixed, disk_representation::fixed_length, or_classrep::fixed_length, or_index::func_index_info, btree_stats::has_function, btree_stats::height, i, disk_representation::id, disk_attribute::id, or_attribute::id, or_classrep::id, or_classrep::indexes, or_attribute::is_fixed, btree_stats::key_type, btid_int::key_type, btree_stats::keys, btree_stats::leafs, disk_attribute::location, or_attribute::location, or_classrep::n_attributes, or_attribute::n_btids, disk_attribute::n_btstats, disk_representation::n_fixed, or_classrep::n_indexes, disk_representation::n_variable, NO_ERROR, NULL, NULL_REPRID, OLD_PAGE, or_free_classrep(), or_get_classrep(), orc_free_diskrep(), PAGE_BTREE, vpid::pageid, btree_stats::pages, pgbuf_check_page_ptype(), pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix_and_init, btree_stats::pkeys, btree_stats::pkeys_size, disk_attribute::position, or_attribute::position, btid::root_pageid, tp_domain::setdomain, btid_int::sys_btid, tp_domain_size(), TP_DOMAIN_TYPE, disk_attribute::type, or_attribute::type, or_default_value::val_length, disk_attribute::val_length, or_default_value::value, disk_attribute::value, disk_representation::variable, btid::vfid, vpid::volid, vfid::volid, and VPID_ISNULL.
Referenced by catalog_insert(), catalog_update(), and xcatalog_check_rep_dir().
void orc_free_class_info | ( | CLS_INFO * | info | ) |
Definition at line 523 of file object_representation_sr.c.
References free_and_init.
Referenced by catalog_insert().
void orc_free_diskrep | ( | DISK_REPR * | rep | ) |
Definition at line 423 of file object_representation_sr.c.
References disk_attribute::bt_stats, disk_representation::fixed, free_and_init, i, disk_attribute::n_btstats, disk_representation::n_fixed, disk_representation::n_variable, NULL, btree_stats::pkeys, disk_attribute::value, and disk_representation::variable.
Referenced by catalog_insert(), catalog_update(), orc_diskrep_from_record(), and xcatalog_check_rep_dir().
Definition at line 544 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, recdes::data, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), i, max, NO_ERROR, NULL, OID_ISNULL, OID_SET_NULL, OR_GET_OID, OR_INT_SIZE, OR_OID_SIZE, OR_SET_ELEMENT_COUNT, OR_SET_HEADER_SIZE, OR_VAR_IS_NULL, OR_VAR_OFFSET, and ORC_SUBCLASSES_INDEX.
Referenced by heap_get_class_subclasses(), and locator_guess_sub_classes().
Definition at line 646 of file object_representation_sr.c.
References ARG_FILE_LINE, assert, recdes::data, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), i, NO_ERROR, NULL, OR_GET_OID, OR_INT_SIZE, OR_OID_SIZE, OR_SET_ELEMENT_COUNT, OR_SET_HEADER_SIZE, OR_VAR_IS_NULL, OR_VAR_OFFSET, and ORC_SUPERCLASSES_INDEX.
Referenced by heap_get_class_supers().