CUBRID Engine
latest
|
#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_CTMPL * | dbt_reserve_name (DB_CTMPL *def, const char *name) |
DB_CTMPL * | dbt_create_class (const char *name) |
DB_CTMPL * | dbt_create_vclass (const char *name) |
DB_CTMPL * | dbt_edit_class (MOP classobj) |
DB_CTMPL * | dbt_copy_class (const char *new_name, const char *existing_name, SM_CLASS **class_) |
DB_OBJECT * | dbt_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) |
#define ATTR_RENAME_SAVEPOINT "aTTrNAMeSAVE" |
Definition at line 58 of file db_temp.c.
Referenced by dbt_rename().
#define ERROR_SET | ( | error, | |
code | |||
) |
Definition at line 52 of file db_temp.c.
Referenced by dbt_add_constraint(), and dbt_drop_constraint().
void dbt_abort_class | ( | DB_CTMPL * | def | ) |
Definition at line 249 of file db_temp.c.
References NULL, and smt_quit().
Referenced by adjust_partition_range(), define_trigger_classes(), do_alter_change_col_comment(), do_alter_change_default_cs_coll(), do_alter_change_tbl_comment(), do_alter_clause_change_attribute(), do_alter_one_clause_with_template(), do_create_entity(), do_create_partition(), do_promote_partition(), drop_foreign_key_ref_internal(), sm_drop_cascade_foreign_key(), sm_touch_class(), sm_truncate_class(), and update_foreign_key_ref().
int dbt_add_argument | ( | DB_CTMPL * | def, |
const char * | name, | ||
int | class_method, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 800 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, NULL, and smt_assign_argument_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().
int dbt_add_class_attribute | ( | DB_CTMPL * | def, |
const char * | name, | ||
const char * | domain, | ||
DB_VALUE * | default_value | ||
) |
Definition at line 317 of file db_temp.c.
References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_CLASS_ATTRIBUTE, NO_ERROR, NULL, and smt_add_attribute_w_dflt().
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().
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().
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 | ||
) |
Definition at line 423 of file db_temp.c.
References assert, CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, DB_CONSTRAINT_NOT_NULL, DB_IS_CONSTRAINT_UNIQUE_FAMILY, er_errid(), ER_SM_INVALID_CONSTRAINT, error(), ERROR_SET, free_and_init, NO_ERROR, NULL, SM_NORMAL_INDEX, sm_produce_constraint_name_tmpl(), and smt_add_constraint().
Referenced by classobj_copy_attribute_like(), dbt_constrain_non_null(), and dbt_constrain_unique().
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 | ||
) |
Definition at line 524 of file db_temp.c.
References assert, classobj_free_class_constraints(), DB_CONSTRAINT_FOREIGN_KEY, sm_foreign_key_info::delete_action, er_errid(), error(), free_and_init, sm_foreign_key_info::is_dropped, NO_ERROR, NULL, sm_template::op, sm_foreign_key_info::ref_attrs, sm_foreign_key_info::ref_class, SM_NORMAL_INDEX, sm_produce_constraint_name_tmpl(), smt_add_constraint(), and sm_foreign_key_info::update_action.
Referenced by add_foreign_key(), classobj_copy_constraint_like(), and sm_truncate_class().
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().
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().
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().
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().
int dbt_add_set_argument_domain | ( | DB_CTMPL * | def, |
const char * | name, | ||
int | class_method, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 823 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, NULL, and smt_add_set_argument_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().
int dbt_add_shared_attribute | ( | DB_CTMPL * | def, |
const char * | name, | ||
const char * | domain, | ||
DB_VALUE * | default_value | ||
) |
Definition at line 294 of file db_temp.c.
References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_SHARED_ATTRIBUTE, NO_ERROR, NULL, and smt_add_attribute_w_dflt().
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().
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().
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().
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().
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().
int dbt_constrain_non_null | ( | DB_CTMPL * | def, |
const char * | name, | ||
int | class_attribute, | ||
int | on_or_off | ||
) |
Definition at line 344 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, DB_CONSTRAINT_NOT_NULL, dbt_add_constraint(), dbt_drop_constraint(), do_check_fk_constraints(), error(), NO_ERROR, and NULL.
Referenced by do_add_attribute(), do_add_attribute_from_select_column(), and do_change_att_schema_only().
Definition at line 382 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, DB_CONSTRAINT_UNIQUE, dbt_add_constraint(), dbt_drop_constraint(), error(), NO_ERROR, and NULL.
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().
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().
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().
Definition at line 653 of file db_temp.c.
References au_check_serial_authorization(), AU_DISABLE, AU_ENABLE, sm_attribute::auto_increment, CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, COPY_OID, ER_SM_ATTRIBUTE_NOT_FOUND, error(), ID_ATTRIBUTE, ID_SHARED_ATTRIBUTE, NO_ERROR, NULL, obj_delete(), serial_decache(), smt_delete_any(), smt_find_attribute(), and ws_identifier().
Referenced by do_alter_one_clause_with_template().
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().
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().
Definition at line 1181 of file db_temp.c.
References CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_delete_class_resolution().
int dbt_drop_constraint | ( | DB_CTMPL * | def, |
DB_CONSTRAINT_TYPE | constraint_type, | ||
const char * | constraint_name, | ||
const char ** | attnames, | ||
int | class_attributes | ||
) |
Definition at line 473 of file db_temp.c.
References assert, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, DB_IS_CONSTRAINT_FAMILY, er_errid(), ER_SM_INVALID_CONSTRAINT, error(), ERROR_SET, free_and_init, NO_ERROR, NULL, SM_ATTFLAG_UNIQUE, SM_MAP_CONSTRAINT_TO_ATTFLAG, sm_produce_constraint_name_tmpl(), and smt_drop_constraint().
Referenced by dbt_constrain_non_null(), dbt_constrain_unique(), do_alter_one_clause_with_template(), sm_drop_cascade_foreign_key(), and sm_truncate_class().
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().
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().
int dbt_drop_method_files | ( | DB_CTMPL * | def | ) |
Definition at line 1054 of file db_temp.c.
References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_reset_method_files().
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().
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().
int dbt_drop_set_attribute_domain | ( | DB_CTMPL * | def, |
const char * | name, | ||
int | class_attribute, | ||
const char * | domain | ||
) |
Definition at line 633 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_delete_set_attribute_domain().
Definition at line 714 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), ID_SHARED_ATTRIBUTE, NO_ERROR, and smt_delete_any().
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().
Definition at line 945 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_delete_super_connect().
Definition at line 133 of file db_temp.c.
References AU_ALTER, CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, NULL, and smt_edit_class_mop().
Referenced by adjust_partition_range(), do_alter_change_col_comment(), do_alter_change_default_cs_coll(), do_alter_change_tbl_comment(), do_alter_clause_change_attribute(), do_alter_one_clause_with_template(), do_create_partition(), do_promote_partition(), drop_foreign_key_ref_internal(), sm_drop_cascade_foreign_key(), sm_touch_class(), sm_truncate_class(), and update_foreign_key_ref().
Definition at line 226 of file db_temp.c.
References CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, NO_ERROR, NULL, and sm_finish_class().
Referenced by adjust_partition_range(), define_trigger_classes(), do_alter_change_col_comment(), do_alter_change_default_cs_coll(), do_alter_change_tbl_comment(), do_alter_clause_change_attribute(), do_alter_one_clause_with_template(), do_create_entity(), do_create_partition(), do_promote_partition(), drop_foreign_key_ref_internal(), sm_drop_cascade_foreign_key(), sm_touch_class(), sm_truncate_class(), and update_foreign_key_ref().
Definition at line 967 of file db_temp.c.
References ATTR_RENAME_SAVEPOINT, sm_template::attributes, sm_attribute::auto_increment, CHECK_3ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, do_update_auto_increment_serial_on_rename(), error(), sm_template::name, NO_ERROR, NULL, SM_FIND_NAME_IN_COMPONENT_LIST, smt_rename_any(), tran_abort_upto_system_savepoint(), and tran_system_savepoint().
Referenced by do_alter_one_clause_with_template().
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().
Definition at line 186 of file db_temp.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR, ER_ERROR_SEVERITY, ER_LC_CLASSNAME_EXIST, er_set(), LC_CLASSNAME_EXIST, LC_CLASSNAME_RESERVED, locator_reserve_class_name(), sm_template::name, NULL, OID_INITIALIZER, and smt_quit().
Referenced by dbt_copy_class(), dbt_create_class(), and dbt_create_vclass().
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().
Definition at line 1095 of file db_temp.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, error(), NO_ERROR, and smt_set_loader_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().