CUBRID Engine  latest
virtual_object.c File Reference
#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"
Include dependency graph for virtual_object.c:

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
 

Functions

static int vid_build_non_upd_object (MOP mop, DB_VALUE *seq)
 
static int vid_make_vid (OID *view_id, OID *proxy_id, DB_VALUE *val, DB_VALUE *vobj)
 
static int vid_db_value_size (DB_VALUE *dbval)
 
static char * vid_pack_db_value (char *lbuf, DB_VALUE *dbval)
 
static int vid_pack_vobj (char *buf, OID *view, OID *proxy, DB_VALUE *keys, int *vobj_size, int buflen)
 
static int vid_get_class_object (MOP class_p, SM_CLASS **class_object_p)
 
static int vid_is_new_oobj (MOP mop)
 
int vid_is_new_pobj (MOP mop)
 
int vid_make_vobj (const OID *view_oid, const OID *class_oid, const DB_VALUE *keys, DB_VALUE *vobj)
 
MOBJ vid_fetch_instance (MOP mop, DB_FETCH_MODE purpose, LC_FETCH_VERSION_TYPE read_fetch_version_type)
 
MOBJ vid_upd_instance (MOP mop)
 
int vid_flush_all_instances (MOP class_mop, bool decache)
 
int vid_flush_and_rehash (MOP mop)
 
DB_VALUEvid_flush_and_rehash_lbl (DB_VALUE *value)
 
int vid_allflush (void)
 
MOP vid_add_virtual_instance (MOBJ instance, MOP vclass_mop, MOP bclass_mop, SM_CLASS *bclass)
 
MOP vid_build_virtual_mop (MOP bmop, MOP vclass_mop)
 
MOP vid_get_referenced_mop (MOP mop)
 
bool vid_is_updatable (MOP mop)
 
bool vid_is_base_instance (MOP mop)
 
MOP vid_base_instance (MOP mop)
 
bool vid_att_in_obj_id (SM_ATTRIBUTE *attribute_p)
 
bool vid_compare_non_updatable_objects (MOP mop1, MOP mop2)
 
void vid_rem_instance (MOP mop)
 
void vid_decache_instance (MOP mop)
 
void vid_get_keys (MOP mop, DB_VALUE *value)
 
DB_OBJLISTvid_getall_mops (MOP class_mop, SM_CLASS *class_p, DB_FETCH_MODE purpose)
 
int vid_vobj_to_object (const DB_VALUE *vobj, DB_OBJECT **mop)
 
int vid_oid_to_object (const DB_VALUE *value, DB_OBJECT **mop)
 
int vid_object_to_vobj (const DB_OBJECT *obj, DB_VALUE *vobj)
 
int vid_encode_object (DB_OBJECT *object, char *string, int allocated_length, int *actual_length)
 
int vid_decode_object (const char *string, DB_OBJECT **object)
 
int vid_flush_instance (MOP mop, void *arg)
 

Variables

bool vid_inhibit_null_check = false
 

Macro Definition Documentation

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

Function Documentation

MOP vid_add_virtual_instance ( MOBJ  instance,
MOP  vclass_mop,
MOP  bclass_mop,
SM_CLASS bclass 
)

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

MOP vid_base_instance ( MOP  mop)
MOP vid_build_virtual_mop ( MOP  bmop,
MOP  vclass_mop 
)

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

Here is the caller graph for this function:

static int vid_db_value_size ( DB_VALUE dbval)
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().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

int vid_flush_all_instances ( MOP  class_mop,
bool  decache 
)
DB_VALUE* vid_flush_and_rehash_lbl ( DB_VALUE value)

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

Here is the caller graph for this function:

int vid_flush_instance ( MOP  mop,
void *  arg 
)
static int vid_get_class_object ( MOP  class_p,
SM_CLASS **  class_object_p 
)
static
void vid_get_keys ( MOP  mop,
DB_VALUE value 
)
static int vid_is_new_oobj ( MOP  mop)
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().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

static int vid_make_vid ( OID view_id,
OID proxy_id,
DB_VALUE val,
DB_VALUE vobj 
)
static
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().

Here is the caller graph for this function:

int vid_object_to_vobj ( const DB_OBJECT obj,
DB_VALUE vobj 
)
int vid_oid_to_object ( const DB_VALUE value,
DB_OBJECT **  mop 
)
static char * vid_pack_db_value ( char *  lbuf,
DB_VALUE dbval 
)
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().

Here is the caller graph for this function:

static int vid_pack_vobj ( char *  buf,
OID view,
OID proxy,
DB_VALUE keys,
int *  vobj_size,
int  buflen 
)
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().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

MOBJ vid_upd_instance ( MOP  mop)

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

Here is the caller graph for this function:

Variable Documentation

bool vid_inhibit_null_check = false

Definition at line 48 of file virtual_object.c.

Referenced by get_object_value().