CUBRID Engine  latest
db_obj.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include "system_parameter.h"
#include "storage_common.h"
#include "db.h"
#include "class_object.h"
#include "object_print.h"
#include "server_interface.h"
#include "boot_cl.h"
#include "locator_cl.h"
#include "schema_manager.h"
#include "schema_template.h"
#include "object_accessor.h"
#include "set_object.h"
#include "virtual_object.h"
#include "execute_schema.h"
#include "execute_statement.h"
#include "parser.h"
#include "view_transform.h"
#include "network_interface_cl.h"
#include "transform.h"
#include "dbtype.h"
#include "printer.hpp"

Go to the source code of this file.

Functions

DB_OBJECTdb_create (DB_OBJECT *obj)
 
DB_OBJECTdb_create_internal (DB_OBJECT *obj)
 
DB_OBJECTdb_create_by_name (const char *name)
 
DB_OBJECTdb_create_by_name_internal (const char *name)
 
DB_OBJECTdb_copy (MOP sourcemop)
 
int db_drop (DB_OBJECT *obj)
 
int db_get (DB_OBJECT *object, const char *attpath, DB_VALUE *value)
 
int db_get_shared (DB_OBJECT *object, const char *attname, DB_VALUE *value)
 
int db_get_expression (DB_OBJECT *object, const char *expression, DB_VALUE *value)
 
int db_put (DB_OBJECT *obj, const char *name, DB_VALUE *value)
 
int db_put_internal (DB_OBJECT *obj, const char *name, DB_VALUE *value)
 
int db_send (MOP obj, const char *name, DB_VALUE *returnval,...)
 
int db_send_arglist (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE_LIST *args)
 
int db_send_argarray (MOP obj, const char *name, DB_VALUE *returnval, DB_VALUE **args)
 
DB_OTMPLdbt_create_object (MOP classobj)
 
DB_OTMPLdbt_create_object_internal (MOP classobj)
 
DB_OTMPLdbt_edit_object (MOP object)
 
DB_OBJECTdbt_finish_object (DB_OTMPL *def)
 
DB_OBJECTdbt_finish_object_and_decache_when_failure (DB_OTMPL *def)
 
void dbt_abort_object (DB_OTMPL *def)
 
int dbt_put (DB_OTMPL *def, const char *name, DB_VALUE *value)
 
int dbt_put_internal (DB_OTMPL *def, const char *name, DB_VALUE *value)
 
int dbt_set_label (DB_OTMPL *def, DB_VALUE *label)
 
int db_get_attribute_descriptor (DB_OBJECT *obj, const char *attname, int class_attribute, int for_update, DB_ATTDESC **descriptor)
 
DB_DOMAINdb_attdesc_domain (DB_ATTDESC *desc)
 
void db_free_attribute_descriptor (DB_ATTDESC *descriptor)
 
int db_get_method_descriptor (DB_OBJECT *obj, const char *methname, int class_method, DB_METHDESC **descriptor)
 
void db_free_method_descriptor (DB_ATTDESC *descriptor)
 
int db_dget (DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
 
int db_dput (DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
 
int db_dput_internal (DB_OBJECT *obj, DB_ATTDESC *attribute, DB_VALUE *value)
 
int dbt_dput (DB_OTMPL *def, DB_ATTDESC *attribute, DB_VALUE *value)
 
int dbt_dput_internal (DB_OTMPL *def, DB_ATTDESC *attribute, DB_VALUE *value)
 
int db_dsend (DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval,...)
 
int db_dsend_arglist (DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, DB_VALUE_LIST *args)
 
int db_dsend_argarray (DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, DB_VALUE **args)
 
int db_dsend_quick (DB_OBJECT *obj, DB_METHDESC *method, DB_VALUE *returnval, int nargs, DB_VALUE **args)
 
DB_OBJECTdb_find_unique (MOP classmop, const char *attname, DB_VALUE *value)
 
DB_OBJECTdb_find_unique_write_mode (MOP classmop, const char *attname, DB_VALUE *value)
 
DB_OBJECTdb_find_primary_key (MOP classmop, const DB_VALUE **values, int size, DB_FETCH_MODE purpose)
 
DB_OBJECTdb_find_multi_unique (MOP classmop, int size, char *attr_names[], DB_VALUE *values[], DB_FETCH_MODE purpose)
 
DB_OBJECTdb_dfind_unique (MOP classmop, DB_ATTDESC *attdesc, DB_VALUE *value, DB_FETCH_MODE purpose)
 
DB_OBJECTdb_dfind_multi_unique (MOP classmop, int size, DB_ATTDESC *attdesc[], DB_VALUE *values[], DB_FETCH_MODE purpose)
 
void db_print (DB_OBJECT *obj)
 
void db_fprint (FILE *fp, DB_OBJECT *obj)
 
DB_OBJECTdb_create_trigger (const char *name, DB_TRIGGER_STATUS status, double priority, DB_TRIGGER_EVENT event, DB_OBJECT *class_, const char *attr, DB_TRIGGER_TIME cond_time, const char *cond_source, DB_TRIGGER_TIME action_time, DB_TRIGGER_ACTION action_type, const char *action_source)
 
int db_drop_trigger (DB_OBJECT *obj)
 
int db_rename_trigger (DB_OBJECT *obj, const char *newname)
 
DB_OBJECTdb_find_trigger (const char *name)
 
int db_find_all_triggers (DB_OBJLIST **list)
 
int db_find_event_triggers (DB_TRIGGER_EVENT event, DB_OBJECT *class_, const char *attr, DB_OBJLIST **list)
 
int db_alter_trigger_priority (DB_OBJECT *trobj, double priority)
 
int db_alter_trigger_status (DB_OBJECT *trobj, DB_TRIGGER_STATUS status)
 
int db_execute_deferred_activities (DB_OBJECT *trigger_obj, DB_OBJECT *target)
 
int db_drop_deferred_activities (DB_OBJECT *trigger_obj, DB_OBJECT *target)
 
int db_trigger_name (DB_OBJECT *trobj, char **name)
 
int db_trigger_status (DB_OBJECT *trobj, DB_TRIGGER_STATUS *status)
 
int db_trigger_priority (DB_OBJECT *trobj, double *priority)
 
int db_trigger_event (DB_OBJECT *trobj, DB_TRIGGER_EVENT *event)
 
int db_trigger_class (DB_OBJECT *trobj, DB_OBJECT **class_)
 
int db_trigger_attribute (DB_OBJECT *trobj, char **attr)
 
int db_trigger_condition (DB_OBJECT *trobj, char **condition)
 
int db_trigger_condition_time (DB_OBJECT *trobj, DB_TRIGGER_TIME *tr_time)
 
int db_trigger_action_type (DB_OBJECT *trobj, DB_TRIGGER_ACTION *type)
 
int db_trigger_action_time (DB_OBJECT *trobj, DB_TRIGGER_TIME *tr_time)
 
int db_trigger_action (DB_OBJECT *trobj, char **action)
 
int db_trigger_comment (DB_OBJECT *trobj, char **comment)
 
int db_encode_object (DB_OBJECT *object, char *string, int allocated_length, int *actual_length)
 
int db_decode_object (const char *string, DB_OBJECT **object)
 
int db_get_serial_current_value (const char *serial_name, DB_VALUE *serial_value)
 
int db_get_serial_next_value (const char *serial_name, DB_VALUE *serial_value)
 
int db_get_serial_next_value_ex (const char *serial_name, DB_VALUE *serial_value, int num_alloc)
 

Function Documentation

int db_alter_trigger_priority ( DB_OBJECT trobj,
double  priority 
)
int db_alter_trigger_status ( DB_OBJECT trobj,
DB_TRIGGER_STATUS  status 
)
DB_OBJECT* db_copy ( MOP  sourcemop)

Definition at line 171 of file db_obj.c.

References CHECK_CONNECT_NULL, and obj_copy().

DB_OBJECT* db_create_by_name_internal ( const char *  name)

Definition at line 145 of file db_obj.c.

References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, and obj_create_by_name().

Referenced by db_create_by_name().

Here is the caller graph for this function:

DB_OBJECT* db_create_internal ( DB_OBJECT obj)
DB_OBJECT* db_create_trigger ( const char *  name,
DB_TRIGGER_STATUS  status,
double  priority,
DB_TRIGGER_EVENT  event,
DB_OBJECT class_,
const char *  attr,
DB_TRIGGER_TIME  cond_time,
const char *  cond_source,
DB_TRIGGER_TIME  action_time,
DB_TRIGGER_ACTION  action_type,
const char *  action_source 
)

Definition at line 1301 of file db_obj.c.

References CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, NULL, and tr_create_trigger().

int db_decode_object ( const char *  string,
DB_OBJECT **  object 
)

Definition at line 1805 of file db_obj.c.

References NO_ERROR, and vid_decode_object().

DB_OBJECT* db_dfind_multi_unique ( MOP  classmop,
int  size,
DB_ATTDESC attdesc[],
DB_VALUE values[],
DB_FETCH_MODE  purpose 
)
DB_OBJECT* db_dfind_unique ( MOP  classmop,
DB_ATTDESC attdesc,
DB_VALUE value,
DB_FETCH_MODE  purpose 
)
int db_dget ( DB_OBJECT obj,
DB_ATTDESC attribute,
DB_VALUE value 
)

Definition at line 889 of file db_obj.c.

References CHECK_CONNECT_ERROR, and obj_desc_get().

Referenced by mq_get_expression().

Here is the caller graph for this function:

int db_dput_internal ( DB_OBJECT obj,
DB_ATTDESC attribute,
DB_VALUE value 
)

Definition at line 933 of file db_obj.c.

References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, and obj_desc_set().

Referenced by db_dput().

Here is the caller graph for this function:

int db_drop_deferred_activities ( DB_OBJECT trigger_obj,
DB_OBJECT target 
)
int db_drop_trigger ( DB_OBJECT obj)
int db_dsend ( DB_OBJECT obj,
DB_METHDESC method,
DB_VALUE returnval,
  ... 
)

Definition at line 999 of file db_obj.c.

References CHECK_CONNECT_ERROR, error(), NO_ERROR, and obj_desc_send_va().

int db_dsend_argarray ( DB_OBJECT obj,
DB_METHDESC method,
DB_VALUE returnval,
DB_VALUE **  args 
)

Definition at line 1042 of file db_obj.c.

References CHECK_CONNECT_ERROR, and obj_desc_send_array().

int db_dsend_arglist ( DB_OBJECT obj,
DB_METHDESC method,
DB_VALUE returnval,
DB_VALUE_LIST args 
)

Definition at line 1022 of file db_obj.c.

References CHECK_CONNECT_ERROR, and obj_desc_send_list().

int db_dsend_quick ( DB_OBJECT obj,
DB_METHDESC method,
DB_VALUE returnval,
int  nargs,
DB_VALUE **  args 
)

Definition at line 1067 of file db_obj.c.

References CHECK_CONNECT_ERROR, and obj_desc_send_array_quick().

int db_encode_object ( DB_OBJECT object,
char *  string,
int  allocated_length,
int *  actual_length 
)

Definition at line 1787 of file db_obj.c.

References NO_ERROR, and vid_encode_object().

int db_execute_deferred_activities ( DB_OBJECT trigger_obj,
DB_OBJECT target 
)
int db_find_all_triggers ( DB_OBJLIST **  list)

Definition at line 1394 of file db_obj.c.

References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and tr_find_all_triggers().

Referenced by sch_trigger().

Here is the caller graph for this function:

int db_find_event_triggers ( DB_TRIGGER_EVENT  event,
DB_OBJECT class_,
const char *  attr,
DB_OBJLIST **  list 
)

Definition at line 1421 of file db_obj.c.

References CHECK_CONNECT_ERROR, and tr_find_event_triggers().

DB_OBJECT* db_find_multi_unique ( MOP  classmop,
int  size,
char *  attr_names[],
DB_VALUE values[],
DB_FETCH_MODE  purpose 
)
DB_OBJECT* db_find_primary_key ( MOP  classmop,
const DB_VALUE **  values,
int  size,
DB_FETCH_MODE  purpose 
)
DB_OBJECT* db_find_trigger ( const char *  name)

Definition at line 1370 of file db_obj.c.

References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, and tr_find_trigger().

DB_OBJECT* db_find_unique ( MOP  classmop,
const char *  attname,
DB_VALUE value 
)

Definition at line 1092 of file db_obj.c.

References AU_FETCH_READ, CHECK_3ARGS_NULL, CHECK_CONNECT_NULL, and obj_find_unique().

Referenced by do_get_serial_obj_id(), and jsp_find_stored_procedure().

Here is the caller graph for this function:

DB_OBJECT* db_find_unique_write_mode ( MOP  classmop,
const char *  attname,
DB_VALUE value 
)

Definition at line 1115 of file db_obj.c.

References AU_FETCH_UPDATE, CHECK_3ARGS_NULL, CHECK_CONNECT_NULL, and obj_find_unique().

void db_fprint ( FILE *  fp,
DB_OBJECT obj 
)

Definition at line 1268 of file db_obj.c.

References CHECK_CONNECT_VOID, help_print_obj(), and NULL.

void db_free_attribute_descriptor ( DB_ATTDESC descriptor)
void db_free_method_descriptor ( DB_ATTDESC descriptor)

Definition at line 875 of file db_obj.c.

References sm_free_descriptor().

int db_get_attribute_descriptor ( DB_OBJECT obj,
const char *  attname,
int  class_attribute,
int  for_update,
DB_ATTDESC **  descriptor 
)
int db_get_expression ( DB_OBJECT object,
const char *  expression,
DB_VALUE value 
)

Definition at line 296 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and mq_get_expression().

int db_get_method_descriptor ( DB_OBJECT obj,
const char *  methname,
int  class_method,
DB_METHDESC **  descriptor 
)

Definition at line 857 of file db_obj.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, and sm_get_method_descriptor().

int db_get_serial_next_value ( const char *  serial_name,
DB_VALUE serial_value 
)

Definition at line 1866 of file db_obj.c.

References db_get_serial_next_value_ex().

int db_get_serial_next_value_ex ( const char *  serial_name,
DB_VALUE serial_value,
int  num_alloc 
)
int db_get_shared ( DB_OBJECT object,
const char *  attname,
DB_VALUE value 
)

Definition at line 255 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and obj_get_shared().

void db_print ( DB_OBJECT obj)

Definition at line 1251 of file db_obj.c.

References CHECK_CONNECT_VOID, help_print_obj(), NULL, and file_print_output::std_output().

int db_put ( DB_OBJECT obj,
const char *  name,
DB_VALUE value 
)
int db_rename_trigger ( DB_OBJECT obj,
const char *  newname 
)
int db_send ( MOP  obj,
const char *  name,
DB_VALUE returnval,
  ... 
)

Definition at line 381 of file db_obj.c.

References CHECK_CONNECT_ERROR, error(), NO_ERROR, NULL, and obj_send_va().

Referenced by apif_last_pos(), and apif_tell().

Here is the caller graph for this function:

int db_send_argarray ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE **  args 
)

Definition at line 444 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and obj_send_array().

Referenced by construct_instance().

Here is the caller graph for this function:

int db_send_arglist ( MOP  obj,
const char *  name,
DB_VALUE returnval,
DB_VALUE_LIST args 
)

Definition at line 417 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and obj_send_list().

Referenced by call_method().

Here is the caller graph for this function:

int db_trigger_action ( DB_OBJECT trobj,
char **  action 
)

Definition at line 1742 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_action().

Referenced by fetch_trigger(), and trigger_description::init().

Here is the caller graph for this function:

int db_trigger_action_time ( DB_OBJECT trobj,
DB_TRIGGER_TIME tr_time 
)

Definition at line 1724 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_action_time().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_action_type ( DB_OBJECT trobj,
DB_TRIGGER_ACTION type 
)

Definition at line 1705 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_action_type().

int db_trigger_attribute ( DB_OBJECT trobj,
char **  attr 
)

Definition at line 1643 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_attribute().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_class ( DB_OBJECT trobj,
DB_OBJECT **  class_ 
)

Definition at line 1623 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_class().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_comment ( DB_OBJECT trobj,
char **  comment 
)

Definition at line 1763 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_comment().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_condition ( DB_OBJECT trobj,
char **  condition 
)

Definition at line 1663 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_condition().

Referenced by fetch_trigger(), and trigger_description::init().

Here is the caller graph for this function:

int db_trigger_condition_time ( DB_OBJECT trobj,
DB_TRIGGER_TIME tr_time 
)

Definition at line 1683 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_condition_time().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_event ( DB_OBJECT trobj,
DB_TRIGGER_EVENT event 
)

Definition at line 1603 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_event().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_name ( DB_OBJECT trobj,
char **  name 
)

Definition at line 1548 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_name().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_priority ( DB_OBJECT trobj,
double *  priority 
)

Definition at line 1585 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_priority().

Referenced by fetch_trigger().

Here is the caller graph for this function:

int db_trigger_status ( DB_OBJECT trobj,
DB_TRIGGER_STATUS status 
)

Definition at line 1567 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and tr_trigger_status().

Referenced by fetch_trigger().

Here is the caller graph for this function:

DB_OTMPL* dbt_create_object_internal ( MOP  classobj)

Definition at line 501 of file db_obj.c.

References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, NULL, and obt_def_object().

Referenced by dbt_create_object().

Here is the caller graph for this function:

int dbt_dput_internal ( DB_OTMPL def,
DB_ATTDESC attribute,
DB_VALUE value 
)

Definition at line 977 of file db_obj.c.

References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, and obt_desc_set().

Referenced by db_gadget_exec(), dbt_dput(), insert_object_attr(), and update_object_attribute().

Here is the caller graph for this function:

DB_OBJECT* dbt_finish_object_and_decache_when_failure ( DB_OTMPL def)
int dbt_put ( DB_OTMPL def,
const char *  name,
DB_VALUE value 
)

Definition at line 635 of file db_obj.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_NONE, obj_template::classobj, dbt_put_internal(), do_check_partitioned_class(), error(), and NO_ERROR.

Referenced by ux_oid_put().

Here is the caller graph for this function: