CUBRID Engine  latest
object_accessor.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <assert.h>
#include "chartype.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "server_interface.h"
#include "dbtype.h"
#include "work_space.h"
#include "object_domain.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "set_object.h"
#include "class_object.h"
#include "schema_manager.h"
#include "object_accessor.h"
#include "authenticate.h"
#include "db.h"
#include "locator_cl.h"
#include "virtual_object.h"
#include "parser.h"
#include "transaction_cl.h"
#include "trigger_manager.h"
#include "view_transform.h"
#include "network_interface_cl.h"

Go to the source code of this file.

Classes

struct  argstate
 

Macros

#define OBJ_MAX_ARGS   32
 
#define MAX_DOMAIN_NAME   128
 

Typedefs

typedef struct argstate ARGSTATE
 

Enumerations

enum  TEMPOID_FLUSH_RESULT { TEMPOID_FLUSH_FAIL = -1, TEMPOID_FLUSH_OK = 0, TEMPOID_FLUSH_NOT_SUPPORT = 1 }
 

Functions

static MOP obj_find_object_by_cons_and_key (MOP classop, SM_CLASS_CONSTRAINT *cons, DB_VALUE *key, AU_FETCHMODE fetchmode)
 
static int find_attribute (SM_CLASS **classp, SM_ATTRIBUTE **attp, MOP op, const char *name, int for_write)
 
static int find_shared_attribute (SM_CLASS **classp, SM_ATTRIBUTE **attp, MOP op, const char *name, int for_write)
 
static int assign_null_value (MOP op, SM_ATTRIBUTE *att, char *mem)
 
static int assign_set_value (MOP op, SM_ATTRIBUTE *att, char *mem, SETREF *setref)
 
static int obj_set_att (MOP op, SM_CLASS *class_, SM_ATTRIBUTE *att, DB_VALUE *value, SM_VALIDATION *valid)
 
static int get_object_value (MOP op, SM_ATTRIBUTE *att, char *mem, DB_VALUE *source, DB_VALUE *dest)
 
static int get_set_value (MOP op, SM_ATTRIBUTE *att, char *mem, DB_VALUE *source, DB_VALUE *dest)
 
static int obj_get_temp (DB_OBJECT *obj, SM_CLASS *class_, SM_ATTRIBUTE *att, DB_VALUE *value)
 
static int obj_set_temp (DB_OBJECT *obj, SM_ATTRIBUTE *att, DB_VALUE *value)
 
static void argstate_from_list (ARGSTATE *state, DB_VALUE_LIST *arglist)
 
static void argstate_from_array (ARGSTATE *state, DB_VALUE **argarray)
 
static void argstate_from_va (ARGSTATE *state, va_list args, int nargs)
 
static void cleanup_argstate (ARGSTATE *state)
 
static int call_method (METHOD_FUNCTION method, MOP obj, DB_VALUE *returnval, int nargs, DB_VALUE **values, DB_VALUE_LIST *overow)
 
static int check_args (SM_METHOD *method, ARGSTATE *state)
 
static int obj_send_method_va (MOP obj, SM_CLASS *class_, SM_METHOD *method, DB_VALUE *returnval, va_list args)
 
static int obj_send_method_list (MOP obj, SM_CLASS *class_, SM_METHOD *method, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
 
static int obj_send_method_array (MOP obj, SM_CLASS *class_, SM_METHOD *method, DB_VALUE *returnval, DB_VALUE **argarray)
 
static MOP find_unique (MOP classop, SM_ATTRIBUTE *att, DB_VALUE *value, AU_FETCHMODE fetchmode)
 
static int flush_temporary_OID (MOP classop, DB_VALUE *key)
 
static DB_VALUEobj_make_key_value (DB_VALUE *key, const DB_VALUE *values[], int size)
 
int obj_locate_attribute (MOP op, int attid, int for_write, char **memp, SM_ATTRIBUTE **attp)
 
int obj_assign_value (MOP op, SM_ATTRIBUTE *att, char *mem, DB_VALUE *value)
 
int obj_set (MOP op, const char *name, DB_VALUE *value)
 
int obj_desc_set (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
 
int obj_set_shared (MOP op, const char *name, DB_VALUE *value)
 
int obj_get_value (MOP op, SM_ATTRIBUTE *att, void *mem, DB_VALUE *source, DB_VALUE *dest)
 
int obj_get_att (MOP op, SM_CLASS *class_, SM_ATTRIBUTE *att, DB_VALUE *value)
 
int obj_desc_get (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value)
 
int obj_get (MOP op, const char *name, DB_VALUE *value)
 
int obj_get_shared (MOP op, const char *name, DB_VALUE *value)
 
int obj_get_path (DB_OBJECT *object, const char *attpath, DB_VALUE *value)
 
char * obj_alloc (SM_CLASS *class_, int bound_bit_status)
 
MOP obj_create (MOP classop)
 
MOP obj_create_by_name (const char *name)
 
MOP obj_copy (MOP op)
 
void obj_free_memory (SM_CLASS *class_, MOBJ obj)
 
int obj_delete (MOP op)
 
int obj_send_va (MOP obj, const char *name, DB_VALUE *returnval, va_list args)
 
int obj_desc_send_va (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, va_list args)
 
int obj_send_list (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
 
int obj_desc_send_list (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE_LIST *arglist)
 
int obj_send_array (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE **argarray)
 
int obj_desc_send_array (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, DB_VALUE **argarray)
 
int obj_desc_send_array_quick (MOP obj, SM_DESCRIPTOR *desc, DB_VALUE *returnval, int nargs, DB_VALUE **argarray)
 
MOP obj_desc_find_unique (MOP op, SM_DESCRIPTOR *desc, DB_VALUE *value, AU_FETCHMODE fetchmode)
 
MOP obj_find_unique (MOP op, const char *attname, DB_VALUE *value, AU_FETCHMODE fetchmode)
 
MOP obj_find_multi_attr (MOP op, int size, const char *attr_names[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
 
MOP obj_find_multi_desc (MOP op, int size, const SM_DESCRIPTOR *desc[], const DB_VALUE *values[], AU_FETCHMODE fetchmode)
 
MOP obj_find_primary_key (MOP op, const DB_VALUE **values, int size, AU_FETCHMODE fetchmode)
 
MOP obj_find_object_by_pkey (MOP classop, DB_VALUE *key, AU_FETCHMODE fetchmode)
 
int obj_isinstance (MOP obj)
 
int obj_is_instance_of (MOP obj, MOP class_mop)
 
int obj_lock (MOP op, int for_write)
 
int obj_class_lock (MOP op, int for_write)
 
int obj_inst_lock (MOP op, int for_write)
 

Variables

char * obj_Method_error_msg
 
static int forge_flag_pat = 0
 
static int obj_Method_call_level = 0
 

Macro Definition Documentation

#define MAX_DOMAIN_NAME   128

Definition at line 72 of file object_accessor.c.

Referenced by check_args().

Typedef Documentation

typedef struct argstate ARGSTATE

Enumeration Type Documentation

Enumerator
TEMPOID_FLUSH_FAIL 
TEMPOID_FLUSH_OK 
TEMPOID_FLUSH_NOT_SUPPORT 

Definition at line 74 of file object_accessor.c.

Function Documentation

static void argstate_from_array ( ARGSTATE state,
DB_VALUE **  argarray 
)
static

Definition at line 2310 of file object_accessor.c.

References argstate::free_overflow, i, argstate::nargs, argstate::noverflow, NULL, OBJ_MAX_ARGS, argstate::overflow, argstate::save, argstate::save_overflow, and argstate::values.

Referenced by obj_send_method_array().

Here is the caller graph for this function:

static void argstate_from_list ( ARGSTATE state,
DB_VALUE_LIST arglist 
)
static
static void argstate_from_va ( ARGSTATE state,
va_list  args,
int  nargs 
)
static

Definition at line 2348 of file object_accessor.c.

References argstate::free_overflow, i, argstate::nargs, argstate::noverflow, NULL, OBJ_MAX_ARGS, argstate::overflow, argstate::save, argstate::save_overflow, and argstate::values.

Referenced by obj_send_method_va().

Here is the caller graph for this function:

static int call_method ( METHOD_FUNCTION  method,
MOP  obj,
DB_VALUE returnval,
int  nargs,
DB_VALUE **  values,
DB_VALUE_LIST overow 
)
static
static void cleanup_argstate ( ARGSTATE state)
static

Definition at line 2380 of file object_accessor.c.

References i, argstate::nargs, NULL, pr_free_ext_value(), argstate::save, and argstate::values.

Referenced by obj_send_method_array(), obj_send_method_list(), and obj_send_method_va().

Here is the caller graph for this function:

static int find_attribute ( SM_CLASS **  classp,
SM_ATTRIBUTE **  attp,
MOP  op,
const char *  name,
int  for_write 
)
static
static int find_shared_attribute ( SM_CLASS **  classp,
SM_ATTRIBUTE **  attp,
MOP  op,
const char *  name,
int  for_write 
)
static
static int flush_temporary_OID ( MOP  classop,
DB_VALUE key 
)
static
int obj_class_lock ( MOP  op,
int  for_write 
)

Definition at line 4387 of file object_accessor.c.

References AU_ALTER, au_fetch_class(), AU_FETCH_READ, AU_FETCH_UPDATE, AU_SELECT, error(), db_object::is_temp, NO_ERROR, and NULL.

Referenced by obj_lock().

Here is the caller graph for this function:

MOP obj_create ( MOP  classop)

Definition at line 1921 of file object_accessor.c.

References NULL, obt_def_object(), obt_quit(), and obt_update_internal().

Referenced by au_install(), au_make_user(), au_set_password_internal(), db_create_internal(), and obj_create_by_name().

Here is the caller graph for this function:

MOP obj_create_by_name ( const char *  name)

Definition at line 1949 of file object_accessor.c.

References NULL, obj_create(), and sm_find_class().

Referenced by db_create_by_name_internal().

Here is the caller graph for this function:

MOP obj_desc_find_unique ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value,
AU_FETCHMODE  fetchmode 
)

Definition at line 3539 of file object_accessor.c.

References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OBJ_INVALID_ARGUMENTS, er_set(), find_unique(), NO_ERROR, NULL, and sm_get_descriptor_component().

Referenced by db_dfind_unique().

Here is the caller graph for this function:

int obj_desc_get ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value 
)

Definition at line 1470 of file object_accessor.c.

References assert, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_get_att(), and sm_get_descriptor_component().

Referenced by db_dget().

Here is the caller graph for this function:

int obj_desc_send_array ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
DB_VALUE **  argarray 
)

Definition at line 3254 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_send_method_array(), and sm_get_descriptor_component().

Referenced by db_dsend_argarray().

Here is the caller graph for this function:

int obj_desc_send_array_quick ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
int  nargs,
DB_VALUE **  argarray 
)
int obj_desc_send_list ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
DB_VALUE_LIST arglist 
)

Definition at line 3105 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_send_method_list(), and sm_get_descriptor_component().

Referenced by db_dsend_arglist().

Here is the caller graph for this function:

int obj_desc_send_va ( MOP  obj,
SM_DESCRIPTOR desc,
DB_VALUE returnval,
va_list  args 
)

Definition at line 2882 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_desc_send_va(), obj_send_method_va(), obj_send_va(), and sm_get_descriptor_component().

Referenced by db_dsend(), and obj_desc_send_va().

Here is the caller graph for this function:

int obj_desc_set ( MOP  op,
SM_DESCRIPTOR desc,
DB_VALUE value 
)

Definition at line 967 of file object_accessor.c.

References assert, DB_TYPE_LAST, DB_VALUE_TYPE, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, NO_ERROR, NULL, obj_set_att(), sm_get_descriptor_component(), and sm_descriptor::valid.

Referenced by db_dput_internal(), and ldr_generic().

Here is the caller graph for this function:

MOP obj_find_primary_key ( MOP  op,
const DB_VALUE **  values,
int  size,
AU_FETCHMODE  fetchmode 
)
void obj_free_memory ( SM_CLASS class_,
MOBJ  obj 
)
int obj_get_shared ( MOP  op,
const char *  name,
DB_VALUE value 
)

Definition at line 1549 of file object_accessor.c.

References ER_OBJ_INVALID_ARGUMENTS, error(), ERROR0, find_shared_attribute(), NO_ERROR, NULL, and obj_get_value().

Referenced by db_get_shared().

Here is the caller graph for this function:

int obj_is_instance_of ( MOP  obj,
MOP  class_mop 
)

Definition at line 4305 of file object_accessor.c.

References au_fetch_instance(), AU_FETCH_READ, AU_SELECT, NO_ERROR, NULL, TM_TRAN_READ_FETCH_VERSION, and ws_class_mop().

Referenced by db_is_instance_of().

Here is the caller graph for this function:

static DB_VALUE * obj_make_key_value ( DB_VALUE key,
const DB_VALUE values[],
int  size 
)
static
int obj_send_array ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE **  argarray 
)
int obj_send_list ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE_LIST arglist 
)
int obj_send_va ( MOP  obj,
const char *  name,
DB_VALUE returnval,
va_list  args 
)
int obj_set_shared ( MOP  op,
const char *  name,
DB_VALUE value 
)
static int obj_set_temp ( DB_OBJECT obj,
SM_ATTRIBUTE att,
DB_VALUE value 
)
static

Definition at line 1809 of file object_accessor.c.

References db_object::class_mop, ER_OBJ_INVALID_TEMP_OBJECT, error(), ERROR0, obj_template::is_old_template, NO_ERROR, NULL, db_object::object, and obt_assign().

Referenced by obj_set_att().

Here is the caller graph for this function:

Variable Documentation

int forge_flag_pat = 0
static

Definition at line 108 of file object_accessor.c.

Referenced by call_method().

int obj_Method_call_level = 0
static

Definition at line 109 of file object_accessor.c.

Referenced by call_method().

char* obj_Method_error_msg

Definition at line 106 of file object_accessor.c.

Referenced by call_method().