CUBRID Engine  latest
db_temp.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include "authenticate.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 "parser.h"
#include "execute_statement.h"
#include "execute_schema.h"
#include "network_interface_cl.h"

Go to the source code of this file.

Macros

#define ERROR_SET(error, code)
 
#define ATTR_RENAME_SAVEPOINT   "aTTrNAMeSAVE"
 

Functions

static DB_CTMPLdbt_reserve_name (DB_CTMPL *def, const char *name)
 
DB_CTMPLdbt_create_class (const char *name)
 
DB_CTMPLdbt_create_vclass (const char *name)
 
DB_CTMPLdbt_edit_class (MOP classobj)
 
DB_CTMPLdbt_copy_class (const char *new_name, const char *existing_name, SM_CLASS **class_)
 
DB_OBJECTdbt_finish_class (DB_CTMPL *def)
 
void dbt_abort_class (DB_CTMPL *def)
 
int dbt_add_attribute (DB_CTMPL *def, const char *name, const char *domain, DB_VALUE *default_value)
 
int dbt_add_shared_attribute (DB_CTMPL *def, const char *name, const char *domain, DB_VALUE *default_value)
 
int dbt_add_class_attribute (DB_CTMPL *def, const char *name, const char *domain, DB_VALUE *default_value)
 
int dbt_constrain_non_null (DB_CTMPL *def, const char *name, int class_attribute, int on_or_off)
 
int dbt_constrain_unique (DB_CTMPL *def, const char *attname, int on_or_off)
 
int dbt_add_constraint (DB_CTMPL *def, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **attnames, int class_attributes, const char *comment)
 
int dbt_drop_constraint (DB_CTMPL *def, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **attnames, int class_attributes)
 
int dbt_add_foreign_key (DB_CTMPL *def, const char *constraint_name, const char **attnames, const char *ref_class, const char **ref_attrs, int del_action, int upd_action, const char *comment)
 
int dbt_add_set_attribute_domain (DB_CTMPL *def, const char *name, int class_attribute, const char *domain)
 
int dbt_change_domain (DB_CTMPL *def, const char *name, int class_attribute, const char *domain)
 
int dbt_change_default (DB_CTMPL *def, const char *name, int class_attribute, DB_VALUE *value)
 
int dbt_drop_set_attribute_domain (DB_CTMPL *def, const char *name, int class_attribute, const char *domain)
 
int dbt_drop_attribute (DB_CTMPL *def, const char *name)
 
int dbt_drop_shared_attribute (DB_CTMPL *def, const char *name)
 
int dbt_drop_class_attribute (DB_CTMPL *def, const char *name)
 
int dbt_add_method (DB_CTMPL *def, const char *name, const char *implementation)
 
int dbt_add_class_method (DB_CTMPL *def, const char *name, const char *implementation)
 
int dbt_add_argument (DB_CTMPL *def, const char *name, int class_method, int index, const char *domain)
 
int dbt_add_set_argument_domain (DB_CTMPL *def, const char *name, int class_method, int index, const char *domain)
 
int dbt_change_method_implementation (DB_CTMPL *def, const char *name, int class_method, const char *newname)
 
int dbt_drop_method (DB_CTMPL *def, const char *name)
 
int dbt_drop_class_method (DB_CTMPL *def, const char *name)
 
int dbt_add_super (DB_CTMPL *def, MOP super)
 
int dbt_drop_super (DB_CTMPL *def, MOP super)
 
int dbt_drop_super_connect (DB_CTMPL *def, MOP super)
 
int dbt_rename (DB_CTMPL *def, const char *name, int class_namespace, const char *newname)
 
int dbt_add_method_file (DB_CTMPL *def, const char *name)
 
int dbt_drop_method_file (DB_CTMPL *def, const char *name)
 
int dbt_drop_method_files (DB_CTMPL *def)
 
int dbt_rename_method_file (DB_CTMPL *def, const char *old_name, const char *new_name)
 
int dbt_set_loader_commands (DB_CTMPL *def, const char *commands)
 
int dbt_add_resolution (DB_CTMPL *def, MOP super, const char *name, const char *alias)
 
int dbt_add_class_resolution (DB_CTMPL *def, MOP super, const char *name, const char *alias)
 
int dbt_drop_resolution (DB_CTMPL *def, MOP super, const char *name)
 
int dbt_drop_class_resolution (DB_CTMPL *def, MOP super, const char *name)
 
int dbt_add_query_spec (DB_CTMPL *def, const char *query)
 
int dbt_drop_query_spec (DB_CTMPL *def, const int query_no)
 
int dbt_reset_query_spec (DB_CTMPL *def)
 
int dbt_change_query_spec (DB_CTMPL *def, const char *new_query, const int query_no)
 
int dbt_set_object_id (DB_CTMPL *def, DB_NAMELIST *id_list)
 

Macro Definition Documentation

#define ATTR_RENAME_SAVEPOINT   "aTTrNAMeSAVE"

Definition at line 58 of file db_temp.c.

Referenced by dbt_rename().

#define ERROR_SET (   error,
  code 
)
Value:
do { \
error = code; \
} while (0)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
static void error(const char *msg)
Definition: gencat.c:331
#define ARG_FILE_LINE
Definition: error_manager.h:44

Definition at line 52 of file db_temp.c.

Referenced by dbt_add_constraint(), and dbt_drop_constraint().

Function Documentation

int dbt_add_argument ( DB_CTMPL def,
const char *  name,
int  class_method,
int  index,
const char *  domain 
)
int dbt_add_attribute ( DB_CTMPL def,
const char *  name,
const char *  domain,
DB_VALUE default_value 
)

Definition at line 272 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_ATTRIBUTE, NO_ERROR, NULL, and smt_add_attribute_w_dflt().

Referenced by define_trigger_classes().

Here is the caller graph for this function:

int dbt_add_class_attribute ( DB_CTMPL def,
const char *  name,
const char *  domain,
DB_VALUE default_value 
)
int dbt_add_class_method ( DB_CTMPL def,
const char *  name,
const char *  implementation 
)

Definition at line 777 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_CLASS_METHOD, NO_ERROR, and smt_add_method_any().

Referenced by do_add_methods().

Here is the caller graph for this function:

int dbt_add_class_resolution ( DB_CTMPL def,
MOP  super,
const char *  name,
const char *  alias 
)

Definition at line 1139 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_class_resolution().

Referenced by do_add_resolutions().

Here is the caller graph for this function:

int dbt_add_constraint ( DB_CTMPL def,
DB_CONSTRAINT_TYPE  constraint_type,
const char *  constraint_name,
const char **  attnames,
int  class_attributes,
const char *  comment 
)
int dbt_add_foreign_key ( DB_CTMPL def,
const char *  constraint_name,
const char **  attnames,
const char *  ref_class,
const char **  ref_attrs,
int  del_action,
int  upd_action,
const char *  comment 
)
int dbt_add_method ( DB_CTMPL def,
const char *  name,
const char *  implementation 
)

Definition at line 756 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_METHOD, NO_ERROR, and smt_add_method_any().

Referenced by do_add_methods().

Here is the caller graph for this function:

int dbt_add_method_file ( DB_CTMPL def,
const char *  name 
)

Definition at line 1015 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_method_file().

Referenced by do_add_method_files().

Here is the caller graph for this function:

int dbt_add_query_spec ( DB_CTMPL def,
const char *  query 
)

Definition at line 1201 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_query_spec().

Referenced by add_query_to_virtual_class().

Here is the caller graph for this function:

int dbt_add_resolution ( DB_CTMPL def,
MOP  super,
const char *  name,
const char *  alias 
)

Definition at line 1117 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_resolution().

Referenced by do_add_resolutions().

Here is the caller graph for this function:

int dbt_add_set_argument_domain ( DB_CTMPL def,
const char *  name,
int  class_method,
int  index,
const char *  domain 
)
int dbt_add_set_attribute_domain ( DB_CTMPL def,
const char *  name,
int  class_attribute,
const char *  domain 
)

Definition at line 569 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_set_attribute_domain().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_add_shared_attribute ( DB_CTMPL def,
const char *  name,
const char *  domain,
DB_VALUE default_value 
)
int dbt_add_super ( DB_CTMPL def,
MOP  super 
)

Definition at line 905 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_add_super().

Referenced by do_add_supers().

Here is the caller graph for this function:

int dbt_change_default ( DB_CTMPL def,
const char *  name,
int  class_attribute,
DB_VALUE value 
)

Definition at line 611 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, NULL, and smt_set_attribute_default().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_change_domain ( DB_CTMPL def,
const char *  name,
int  class_attribute,
const char *  domain 
)

Definition at line 591 of file db_temp.c.

References ARG_FILE_LINE, CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, ER_DB_NO_DOMAIN_CHANGE, ER_ERROR_SEVERITY, and er_set().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_change_method_implementation ( DB_CTMPL def,
const char *  name,
int  class_method,
const char *  newname 
)

Definition at line 845 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_change_method_implementation().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_change_query_spec ( DB_CTMPL def,
const char *  new_query,
const int  query_no 
)

Definition at line 1261 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_change_query_spec().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_constrain_non_null ( DB_CTMPL def,
const char *  name,
int  class_attribute,
int  on_or_off 
)
int dbt_constrain_unique ( DB_CTMPL def,
const char *  attname,
int  on_or_off 
)
DB_CTMPL* dbt_copy_class ( const char *  new_name,
const char *  existing_name,
SM_CLASS **  class_ 
)

Definition at line 160 of file db_temp.c.

References CHECK_2ARGS_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, dbt_reserve_name(), NULL, and smt_copy_class().

Referenced by do_create_entity().

Here is the caller graph for this function:

DB_CTMPL* dbt_create_class ( const char *  name)

Definition at line 76 of file db_temp.c.

References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, dbt_reserve_name(), NULL, and smt_def_class().

Referenced by define_trigger_classes(), do_create_entity(), and do_create_partition().

Here is the caller graph for this function:

DB_CTMPL* dbt_create_vclass ( const char *  name)

Definition at line 104 of file db_temp.c.

References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, dbt_reserve_name(), NULL, SM_VCLASS_CT, and smt_def_typed_class().

Referenced by do_create_entity().

Here is the caller graph for this function:

int dbt_drop_class_attribute ( DB_CTMPL def,
const char *  name 
)

Definition at line 734 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_CLASS_ATTRIBUTE, NO_ERROR, and smt_delete_any().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_class_method ( DB_CTMPL def,
const char *  name 
)

Definition at line 885 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_CLASS_METHOD, NO_ERROR, and smt_delete_any().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_class_resolution ( DB_CTMPL def,
MOP  super,
const char *  name 
)
int dbt_drop_method ( DB_CTMPL def,
const char *  name 
)

Definition at line 865 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_METHOD, NO_ERROR, and smt_delete_any().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_method_file ( DB_CTMPL def,
const char *  name 
)

Definition at line 1035 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_drop_method_file().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_method_files ( DB_CTMPL def)
int dbt_drop_query_spec ( DB_CTMPL def,
const int  query_no 
)

Definition at line 1221 of file db_temp.c.

References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_drop_query_spec().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_resolution ( DB_CTMPL def,
MOP  super,
const char *  name 
)

Definition at line 1160 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_delete_resolution().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_set_attribute_domain ( DB_CTMPL def,
const char *  name,
int  class_attribute,
const char *  domain 
)
int dbt_drop_shared_attribute ( DB_CTMPL def,
const char *  name 
)
int dbt_drop_super ( DB_CTMPL def,
MOP  super 
)

Definition at line 925 of file db_temp.c.

References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_delete_super().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_drop_super_connect ( DB_CTMPL def,
MOP  super 
)
int dbt_rename_method_file ( DB_CTMPL def,
const char *  old_name,
const char *  new_name 
)

Definition at line 1075 of file db_temp.c.

References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_rename_method_file().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

static DB_CTMPL * dbt_reserve_name ( DB_CTMPL def,
const char *  name 
)
static
int dbt_reset_query_spec ( DB_CTMPL def)

Definition at line 1240 of file db_temp.c.

References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_reset_query_spec().

Referenced by do_alter_one_clause_with_template().

Here is the caller graph for this function:

int dbt_set_loader_commands ( DB_CTMPL def,
const char *  commands 
)
int dbt_set_object_id ( DB_CTMPL def,
DB_NAMELIST id_list 
)

Definition at line 1281 of file db_temp.c.

References NO_ERROR.

Referenced by do_set_object_id().

Here is the caller graph for this function: