CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "authenticate.h"
#include "virtual_object.h"
#include "set_object.h"
#include "object_accessor.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "db.h"
#include "schema_manager.h"
#include "view_transform.h"
#include "transaction_cl.h"
#include "dbtype.h"
Go to the source code of this file.
Macros | |
#define | ENCODED_LEN(siz) (2*(siz)) |
#define | MAX_STRING_OID_LENGTH 4096 |
#define | MIN_STRING_OID_LENGTH 18 |
Variables | |
bool | vid_inhibit_null_check = false |
#define ENCODED_LEN | ( | siz | ) | (2*(siz)) |
Definition at line 44 of file virtual_object.c.
Referenced by vid_decode_object(), and vid_encode_object().
#define MAX_STRING_OID_LENGTH 4096 |
Definition at line 45 of file virtual_object.c.
Referenced by vid_decode_object(), and vid_encode_object().
#define MIN_STRING_OID_LENGTH 18 |
Definition at line 46 of file virtual_object.c.
Referenced by vid_encode_object().
Definition at line 610 of file virtual_object.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_SM_INVALID_ARGUMENTS, locator_add_instance(), NULL, and vid_build_virtual_mop().
Referenced by create_template_object().
int vid_allflush | ( | void | ) |
Definition at line 573 of file virtual_object.c.
References DONT_DECACHE, db_objlist::next, NO_ERROR, NULL, db_objlist::op, vid_flush_all_instances(), ws_has_dirty_objects(), and ws_Resident_classes.
Referenced by locator_all_flush().
bool vid_att_in_obj_id | ( | SM_ATTRIBUTE * | attribute_p | ) |
Definition at line 799 of file virtual_object.c.
References ARG_FILE_LINE, assert, classobj_get_prop(), classobj_make_prop(), classobj_put_prop(), db_make_int(), er_errid(), er_set(), ER_SM_OBJECT_ID_ALREADY_SET, ER_WARNING_SEVERITY, error(), vid_info::flags, sm_attribute::flags, db_object::is_vid, NO_ERROR, NULL, db_object::oid_info, sm_attribute::properties, SM_ATTFLAG_VID, SM_PROPERTY_VID_KEY, vid_att_in_obj_id(), VID_BASE, vid_flush_instance(), vid_oid::vid_info, ws_dirty(), WS_MAP_CONTINUE, and ws_rehash_vmop().
Referenced by vid_att_in_obj_id().
Definition at line 775 of file virtual_object.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, er_set(), ER_SM_OBJECT_NOT_UPDATABLE, vid_get_referenced_mop(), vid_is_base_instance(), and vid_is_updatable().
Referenced by cursor_get_oid_from_vobj(), db_real_instance(), and ws_oid().
Definition at line 1077 of file virtual_object.c.
References ARG_FILE_LINE, assert, sm_class::attributes, au_fetch_class_force(), AU_FETCH_READ, sm_class::class_type, DB_DEFAULT_PRECISION, DB_DEFAULT_SCALE, db_get_set(), db_make_object(), db_seq_get(), DB_TYPE_MULTISET, DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_TYPE_VOBJ, db_value_domain_init(), DB_VALUE_TYPE, db_ws_free(), er_errid(), ER_ERROR_SEVERITY, er_log_debug, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_SM_INVALID_CLASS, ER_WARNING_SEVERITY, ER_WS_NO_CLASS_FOR_INSTANCE, ER_WS_PIN_VIOLATION, error(), sm_attribute::header, lock_Conv, NA_LOCK, sm_component::next, NO_ERROR, NULL, NULL_LOCK, obj_alloc(), obj_assign_value(), obj_free_memory(), db_object::object, sm_attribute::offset, sm_attribute::order, db_object::pinned, pr_clear_value(), S_LOCK, set_convert_oids_to_objects(), SM_VCLASS_CT, vid_vobj_to_object(), ws_class_mop(), ws_get_lock(), and ws_set_lock().
Referenced by vid_vobj_to_object().
Definition at line 644 of file virtual_object.c.
References ARG_FILE_LINE, db_make_object(), ER_ERROR_SEVERITY, er_set(), ER_SM_INVALID_ARGUMENTS, mq_is_updatable(), NULL, VID_NEW, VID_UPDATABLE, ws_set_lock(), ws_vmop(), and X_LOCK.
Referenced by make_vmops(), and vid_add_virtual_instance().
Definition at line 910 of file virtual_object.c.
References ARG_FILE_LINE, sm_class::attributes, au_fetch_class_force(), AU_FETCH_READ, DB_DEFAULT_PRECISION, DB_DEFAULT_SCALE, DB_EQ, db_get_object(), db_get_set(), DB_TYPE_OBJECT, db_value_domain_init(), db_value_put_null(), sm_attribute::domain, ER_ERROR_SEVERITY, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, ER_WS_NO_CLASS_FOR_INSTANCE, error(), pr_type::getmem(), sm_attribute::header, pr_type::id, sm_component::next, NO_ERROR, NULL, db_object::object, sm_attribute::offset, pr_is_set_type(), rc, set_compare(), tp_Type_object, tp_value_equal(), sm_attribute::type, and WS_IS_DELETED.
Referenced by db_instance_equal().
|
static |
Definition at line 1753 of file virtual_object.c.
References DB_ALIGN, MAX_ALIGNMENT, and pr_data_writeval_disk_size().
Referenced by vid_pack_vobj().
void vid_decache_instance | ( | MOP | mop | ) |
Definition at line 1203 of file virtual_object.c.
References db_object::is_vid, NULL_LOCK, vid_is_base_instance(), vid_is_updatable(), ws_decache(), and ws_set_lock().
Referenced by sm_decache_mop().
Definition at line 2058 of file virtual_object.c.
References ARG_FILE_LINE, cursor_copy_vobj_to_dbvalue(), db_get_object(), DB_INSTANCE_OF_A_CLASS, DB_INSTANCE_OF_A_VCLASS_OF_A_CLASS, DB_INSTANCE_OF_NONUPDATABLE_OBJECT, ENCODED_LEN, ER_ERROR_SEVERITY, ER_OBJ_DELETED, ER_OBJ_INTERNAL_ERROR_IN_DECODING, ER_OBJ_INVALID_ARGUMENT, ER_OBJ_NULL_ADDR_OUTPUT_OBJ, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), free_and_init, MAX_STRING_OID_LENGTH, NO_ERROR, NULL, or_decode(), or_init(), OR_INT_SIZE, OR_OID_SIZE, rc, strlen, and ws_mop().
Referenced by db_decode_object().
int vid_encode_object | ( | DB_OBJECT * | object, |
char * | string, | ||
int | allocated_length, | ||
int * | actual_length | ||
) |
Definition at line 1866 of file virtual_object.c.
References ARG_FILE_LINE, db_attribute_name(), db_attribute_next(), db_get(), db_get_attributes(), db_get_class(), DB_INSTANCE_OF_A_CLASS, DB_INSTANCE_OF_A_VCLASS_OF_A_CLASS, DB_INSTANCE_OF_NONUPDATABLE_OBJECT, db_is_any_class(), db_is_class(), db_is_updatable_object(), db_make_object(), db_make_sequence(), db_real_instance(), db_seq_create(), db_seq_put(), ENCODED_LEN, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_HEAP_UNKNOWN_OBJECT, ER_OBJ_BUFFER_TOO_SMALL, ER_OBJ_CANT_ASSIGN_OID, ER_OBJ_CANT_ENCODE_NONUPD_OBJ, ER_OBJ_CANT_ENCODE_VOBJ, ER_OBJ_CANT_RESOLVE_VOBJ_TO_OBJ, ER_OBJ_VOBJ_MAPS_INVALID_OBJ, er_set(), i, is_class(), locator_assign_permanent_oid(), MAX_STRING_OID_LENGTH, MIN_STRING_OID_LENGTH, NO_ERROR, NULL, OID_ISTEMP, or_encode(), OR_INT_SIZE, OR_OID_SIZE, vid_pack_vobj(), and WS_OID.
Referenced by db_encode_object().
MOBJ vid_fetch_instance | ( | MOP | mop, |
DB_FETCH_MODE | purpose, | ||
LC_FETCH_VERSION_TYPE | read_fetch_version_type | ||
) |
Definition at line 202 of file virtual_object.c.
References ARG_FILE_LINE, au_fetch_instance_force(), AU_FETCH_READ, AU_FETCH_WRITE, DB_DEFAULT_PRECISION, DB_FETCH_WRITE, db_get_object(), db_get_set(), db_make_null(), db_make_object(), db_seq_get(), db_seq_put(), db_seq_size(), db_set_add(), db_set_cardinality(), db_set_get(), DB_TYPE_MULTISET, DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_TYPE_STRING, DB_TYPE_VOBJ, db_value_domain_init(), DB_VALUE_TYPE, sm_attribute::domain, ER_ERROR_SEVERITY, er_set(), ER_VID_LOST_NON_UPDATABLE_OBJECT, error(), db_object::is_vid, vid_info::keys, LC_FETCH_MVCC_VERSION, db_object::lock, NO_ERROR, NULL, NULL_LOCK, db_object::oid_info, pr_clear_value(), pr_clone_value(), set_size(), TP_DOMAIN_TYPE, TP_IS_SET_TYPE, VID_BASE, vid_get_class_object(), vid_get_referenced_mop(), vid_oid::vid_info, VID_UPDATABLE, ws_class_mop(), ws_decache(), ws_dirty(), ws_find(), and ws_vmop().
Referenced by fetch_instance(), vid_upd_instance(), and ws_rehash_vmop().
Definition at line 451 of file virtual_object.c.
References ER_FAILED, NO_ERROR, rc, vid_flush_instance(), ws_map_class(), and WS_MAP_SUCCESS.
Referenced by install_new_representation(), locator_flush_all_instances(), sm_delete_class_mop(), sm_flush_and_decache_objects_internal(), sm_flush_for_multi_update(), vid_allflush(), and vid_getall_mops().
int vid_flush_and_rehash | ( | MOP | mop | ) |
Definition at line 478 of file virtual_object.c.
References ARG_FILE_LINE, assert, er_errid(), ER_ERROR_SEVERITY, ER_GENERIC_ERROR, er_set(), ER_WS_REHASH_VMOP_ERROR, db_object::is_vid, NO_ERROR, NULL, vid_flush_instance(), vid_get_class_object(), vid_is_base_instance(), vid_is_new_oobj(), WS_CLASS_MOP, ws_decache(), WS_MAP_FAIL, and ws_rehash_vmop().
Referenced by obt_apply_assignments(), and vid_flush_and_rehash_lbl().
Definition at line 533 of file virtual_object.c.
References db_get_object(), DB_TYPE_OBJECT, DB_VALUE_TYPE, NO_ERROR, NULL, vid_flush_and_rehash(), and vid_is_new_pobj().
Referenced by pt_find_value_of_label().
int vid_flush_instance | ( | MOP | mop, |
void * | arg | ||
) |
Definition at line 2144 of file virtual_object.c.
References db_object::dirty, vid_info::flags, db_object::is_vid, db_object::oid_info, rc, vid_oid::vid_info, vid_is_base_instance(), vid_is_updatable(), VID_NEW, ws_clean(), ws_decache(), and WS_MAP_CONTINUE.
Referenced by locator_mflush(), vid_att_in_obj_id(), vid_flush_all_instances(), and vid_flush_and_rehash().
Definition at line 75 of file virtual_object.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_HEAP_UNKNOWN_CLASS_OF_INSTANCE, er_set(), db_object::is_vid, NO_ERROR, NULL, vid_oid::oid, db_object::oid_info, oid_Null_oid, db_identifier::pageid, db_identifier::slotid, db_identifier::volid, ws_find(), and WS_FIND_MOP_DELETED.
Referenced by vid_fetch_instance(), and vid_flush_and_rehash().
Definition at line 1238 of file virtual_object.c.
References db_make_oid(), db_object::is_vid, vid_info::keys, db_value::need_clear, NULL, db_object::oid_info, vid_oid::vid_info, and ws_oid().
Referenced by mr_cmpval_object(), pt_print_node_value(), regu_make_constant_vid(), and vid_object_to_vobj().
Definition at line 677 of file virtual_object.c.
References db_get_object(), DB_TYPE_OBJECT, DB_VALUE_TYPE, db_object::is_vid, vid_info::keys, db_object::oid_info, and vid_oid::vid_info.
Referenced by create_template_object(), make_template(), obj_delete(), obj_get_att(), obj_set_att(), sm_coerce_object_domain(), vid_base_instance(), vid_fetch_instance(), and vid_rem_instance().
DB_OBJLIST* vid_getall_mops | ( | MOP | class_mop, |
SM_CLASS * | class_p, | ||
DB_FETCH_MODE | purpose | ||
) |
Definition at line 1280 of file virtual_object.c.
References class_type(), db_compile_and_execute_local(), DB_CURSOR_SUCCESS, DB_FETCH_CLREAD_INSTWRITE, db_fetch_list(), DB_FETCH_QUERY_WRITE, DB_FETCH_WRITE, db_get_class_name(), db_get_object(), db_query_end(), db_query_get_tuple_value_by_name(), db_query_next_tuple(), db_query_tuple_count(), error(), ml_ext_alloc_link(), ml_ext_free(), db_objlist::next, NO_ERROR, NULL, db_objlist::op, sm_get_class_type(), and vid_flush_all_instances().
Referenced by sm_fetch_all_objects_internal().
Definition at line 744 of file virtual_object.c.
References vid_info::flags, db_object::is_vid, db_object::oid_info, VID_BASE, and vid_oid::vid_info.
Referenced by create_template_object(), db_is_real_instance(), make_template(), obt_apply_assignments(), vid_base_instance(), vid_decache_instance(), vid_flush_and_rehash(), vid_flush_instance(), and vid_rem_instance().
|
static |
Definition at line 111 of file virtual_object.c.
References vid_info::flags, db_object::is_vid, db_object::oid_info, vid_oid::vid_info, VID_NEW, ws_class_mop(), ws_find(), and WS_FIND_MOP_DELETED.
Referenced by vid_flush_and_rehash(), and vid_upd_instance().
int vid_is_new_pobj | ( | MOP | mop | ) |
Definition at line 131 of file virtual_object.c.
References vid_info::flags, db_object::is_vid, db_object::oid_info, vid_oid::vid_info, and VID_NEW.
Referenced by vid_flush_and_rehash_lbl().
Definition at line 707 of file virtual_object.c.
References vid_info::flags, db_object::is_vid, NULL, db_object::oid_info, vid_oid::vid_info, and VID_UPDATABLE.
Referenced by cursor_get_oid_from_vobj(), db_is_updatable_object(), obj_get_att(), obj_set_att(), vid_base_instance(), vid_decache_instance(), vid_flush_instance(), vid_rem_instance(), and ws_clear_hints().
Definition at line 1691 of file virtual_object.c.
References db_value::data, DB_DEFAULT_PRECISION, DB_DEFAULT_SCALE, db_make_oid(), db_make_sequence(), db_seq_create(), db_seq_put(), DB_TYPE_OID, DB_TYPE_VOBJ, db_value_alter_type(), db_value_domain_init(), ER_FAILED, NO_ERROR, NULL, db_data::oid, OID_ISNULL, and OID_SET_NULL.
Referenced by vid_pack_vobj().
int vid_make_vobj | ( | const OID * | view_oid, |
const OID * | class_oid, | ||
const DB_VALUE * | keys, | ||
DB_VALUE * | vobj | ||
) |
Definition at line 148 of file virtual_object.c.
References assert, db_make_oid(), db_make_sequence(), DB_TYPE_VOBJ, db_value_alter_type(), er_errid(), error(), NO_ERROR, NULL, set_create_sequence(), and set_put_element().
Referenced by vid_object_to_vobj().
Definition at line 1629 of file virtual_object.c.
References ARG_FILE_LINE, db_get_class(), db_real_instance(), ER_DL_ESYS, ER_ERROR_SEVERITY, er_set(), oid_Null_oid, vid_get_keys(), vid_make_vobj(), and ws_oid().
Referenced by db_value_printer::describe_data(), mr_data_lengthval_object(), mr_data_writeval_object(), and tp_value_cast_internal().
Definition at line 1584 of file virtual_object.c.
References db_get_oid(), db_get_set(), DB_TYPE_MULTISET, DB_TYPE_OID, DB_TYPE_SEQUENCE, DB_TYPE_SET, DB_VALUE_TYPE, ER_GENERIC_ERROR, NO_ERROR, NULL, OID_ISNULL, set_convert_oids_to_objects(), and ws_mop().
Referenced by cursor_fixup_vobjs(), pt_dbval_to_value(), and tp_value_cast_internal().
|
static |
Definition at line 1781 of file virtual_object.c.
References pr_type::data_writeval(), DB_TYPE_LAST, DB_TYPE_TABLE, DB_VALUE_DOMAIN_TYPE, NO_ERROR, NULL, or_init(), pr_data_writeval_disk_size(), and tp_Type_id_map.
Referenced by vid_pack_vobj().
|
static |
Definition at line 1822 of file virtual_object.c.
References ARG_FILE_LINE, db_value_clear(), ER_ERROR_SEVERITY, ER_FAILED, ER_OBJ_CANT_ENCODE_VOBJ, er_set(), NO_ERROR, vid_db_value_size(), vid_make_vid(), and vid_pack_db_value().
Referenced by vid_encode_object().
void vid_rem_instance | ( | MOP | mop | ) |
Definition at line 1041 of file virtual_object.c.
References db_object::is_vid, vid_get_referenced_mop(), vid_is_base_instance(), vid_is_updatable(), and ws_mark_deleted().
Referenced by obj_delete().
Definition at line 417 of file virtual_object.c.
References DB_FETCH_WRITE, LC_FETCH_MVCC_VERSION, vid_fetch_instance(), vid_is_new_oobj(), and ws_find().
Referenced by fetch_instance().
Definition at line 1396 of file virtual_object.c.
References ARG_FILE_LINE, assert, au_fetch_instance_force(), AU_FETCH_READ, db_get_object(), db_get_set(), db_make_object(), db_set_get(), db_set_size(), DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_VOBJ, DB_VALUE_TYPE, db_value::domain, ER_DL_ESYS, er_errid(), ER_ERROR_SEVERITY, er_set(), error(), db_domain_info::general_info, i, db_domain_info::general_info::is_null, db_value::need_clear, NO_ERROR, NULL, db_object::object, pr_clear_value(), TM_TRAN_READ_FETCH_VERSION, db_domain_info::general_info::type, VID_BASE, vid_build_non_upd_object(), VID_UPDATABLE, vid_vobj_to_object(), and ws_vmop().
Referenced by cursor_copy_vobj_to_dbvalue(), cursor_fixup_vobjs(), do_replace_names_for_insert_values_pre(), mq_replace_virtual_oid_with_real_oid(), pt_dbval_to_value(), setobj_convert_oids_to_objects(), tp_value_cast_internal(), vid_build_non_upd_object(), and vid_vobj_to_object().
bool vid_inhibit_null_check = false |
Definition at line 48 of file virtual_object.c.
Referenced by get_object_value().