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_schema.h"
Go to the source code of this file.
Functions | |
static int | drop_internal (MOP class_, const char *name, SM_NAME_SPACE name_space) |
static int | add_method_internal (MOP class_, const char *name, const char *implementation, SM_NAME_SPACE name_space) |
static int | add_arg_domain (DB_OBJECT *class_, const char *name, int class_method, int index, int initial_domain, const char *domain) |
DB_OBJECT * | db_create_class (const char *name) |
int | db_drop_class (MOP class_) |
int | db_drop_class_ex (MOP class_, bool is_cascade_constraints) |
int | db_rename_class (MOP classop, const char *new_name) |
int | db_add_attribute_internal (MOP class_, const char *name, const char *domain, DB_VALUE *default_value, SM_NAME_SPACE name_space) |
int | db_add_attribute (MOP obj, const char *name, const char *domain, DB_VALUE *default_value) |
int | db_add_shared_attribute (MOP obj, const char *name, const char *domain, DB_VALUE *default_value) |
int | db_add_class_attribute (MOP obj, const char *name, const char *domain, DB_VALUE *default_value) |
int | db_drop_attribute (MOP class_, const char *name) |
int | db_drop_attribute_internal (MOP class_, const char *name) |
int | db_drop_shared_attribute (MOP class_, const char *name) |
int | db_drop_class_attribute (MOP class_, const char *name) |
int | db_add_set_attribute_domain (MOP class_, const char *name, int class_attribute, const char *domain) |
int | db_add_element_domain (MOP class_, const char *name, const char *domain) |
int | db_drop_set_attribute_domain (MOP class_, const char *name, int class_attribute, const char *domain) |
int | db_drop_element_domain (MOP class_, const char *name, const char *domain) |
int | db_change_default (MOP class_, const char *name, DB_VALUE *value) |
int | db_rename (MOP class_, const char *name, int class_namespace, const char *newname) |
int | db_rename_internal (MOP class_, const char *name, int class_namespace, const char *newname) |
int | db_rename_attribute (MOP class_, const char *name, int class_attribute, const char *newname) |
int | db_rename_method (MOP class_, const char *name, int class_method, const char *newname) |
int | db_add_method (MOP class_, const char *name, const char *implementation) |
int | db_add_class_method (MOP class_, const char *name, const char *implementation) |
int | db_drop_method (MOP class_, const char *name) |
int | db_drop_class_method (MOP class_, const char *name) |
int | db_change_method_implementation (MOP class_, const char *name, int class_method, const char *newname) |
int | db_add_argument (DB_OBJECT *class_, const char *name, int class_method, int index, const char *domain) |
int | db_set_method_arg_domain (DB_OBJECT *class_, const char *name, int index, const char *domain) |
int | db_set_class_method_arg_domain (DB_OBJECT *class_, const char *name, int index, const char *domain) |
int | db_add_set_argument_domain (DB_OBJECT *class_, const char *name, int class_method, int index, const char *domain) |
int | db_set_loader_commands (MOP class_, const char *commands) |
int | db_add_method_file (MOP class_, const char *name) |
int | db_drop_method_file (MOP class_, const char *name) |
int | db_drop_method_files (MOP class_) |
int | db_add_super (MOP class_, MOP super) |
int | db_add_super_internal (MOP class_, MOP super) |
int | db_drop_super (MOP class_, MOP super) |
int | db_drop_super_connect (MOP class_, MOP super) |
int | db_constrain_non_null (MOP class_, const char *name, int class_attribute, int on_or_off) |
int | db_constrain_unique (MOP class_, const char *name, int on_or_off) |
int | db_add_resolution (MOP class_, MOP super, const char *name, const char *alias) |
int | db_add_class_resolution (MOP class_, MOP super, const char *name, const char *alias) |
int | db_drop_resolution (MOP class_, MOP super, const char *name) |
int | db_drop_class_resolution (MOP class_, MOP super, const char *name) |
int | db_add_index (MOP classmop, const char *attname) |
int | db_drop_index (MOP classmop, const char *attname) |
int | db_add_constraint (MOP classmop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, int class_attributes) |
int | db_drop_constraint (MOP classmop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, int class_attributes) |
int | db_truncate_class (DB_OBJECT *class_) |
|
static |
Definition at line 928 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_add_set_argument_domain(), smt_assign_argument_domain(), smt_edit_class_mop(), and smt_quit().
Referenced by db_add_argument(), db_add_set_argument_domain(), db_set_class_method_arg_domain(), and db_set_method_arg_domain().
|
static |
Definition at line 749 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class_auto(), smt_add_method_any(), smt_edit_class_mop(), and smt_quit().
Referenced by db_add_class_method(), and db_add_method().
int db_add_argument | ( | DB_OBJECT * | class_, |
const char * | name, | ||
int | class_method, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 988 of file db_class.c.
References add_arg_domain().
Definition at line 248 of file db_class.c.
References db_add_attribute_internal(), and ID_ATTRIBUTE.
Referenced by boot_define_view_attribute(), boot_define_view_attribute_set_domain(), boot_define_view_authorization(), boot_define_view_class(), boot_define_view_db_charset(), boot_define_view_db_collation(), boot_define_view_index(), boot_define_view_index_key(), boot_define_view_method(), boot_define_view_method_argument(), boot_define_view_method_argument_set_domain(), boot_define_view_method_file(), boot_define_view_partition(), boot_define_view_stored_procedure(), boot_define_view_stored_procedure_arguments(), boot_define_view_super_class(), boot_define_view_trigger(), and boot_define_view_vclass().
int db_add_attribute_internal | ( | MOP | class_, |
const char * | name, | ||
const char * | domain, | ||
DB_VALUE * | default_value, | ||
SM_NAME_SPACE | name_space | ||
) |
Definition at line 184 of file db_class.c.
References assert, AU_ALTER, CHECK_3ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), ID_CLASS, ID_CLASS_ATTRIBUTE, NO_ERROR, NULL, sm_update_class_auto(), smt_add_attribute_any(), smt_edit_class_mop(), smt_quit(), and smt_set_attribute_default().
Referenced by db_add_attribute(), db_add_class_attribute(), and db_add_shared_attribute().
int db_add_class_attribute | ( | MOP | obj, |
const char * | name, | ||
const char * | domain, | ||
DB_VALUE * | default_value | ||
) |
Definition at line 288 of file db_class.c.
References db_add_attribute_internal(), and ID_CLASS_ATTRIBUTE.
Definition at line 819 of file db_class.c.
References add_method_internal(), and ID_CLASS_METHOD.
Definition at line 1581 of file db_class.c.
References assert, AU_ALTER, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class_auto(), smt_add_class_resolution(), smt_edit_class_mop(), and smt_quit().
int db_add_constraint | ( | MOP | classmop, |
DB_CONSTRAINT_TYPE | constraint_type, | ||
const char * | constraint_name, | ||
const char ** | att_names, | ||
int | class_attributes | ||
) |
Definition at line 1777 of file db_class.c.
References assert, CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), free_and_init, NO_ERROR, NULL, sm_add_constraint(), SM_NORMAL_INDEX, and sm_produce_constraint_name_mop().
Referenced by au_install(), boot_define_attribute(), boot_define_class(), boot_define_class_authorization(), boot_define_domain(), boot_define_ha_apply_info(), boot_define_index(), boot_define_index_key(), boot_define_meth_argument(), boot_define_meth_file(), boot_define_meth_sig(), boot_define_method(), boot_define_partition(), boot_define_query_spec(), boot_define_serial(), boot_define_stored_procedure(), boot_define_stored_procedure_arguments(), db_add_index(), db_constrain_non_null(), db_constrain_unique(), and do_alter_clause_change_attribute().
Definition at line 490 of file db_class.c.
References db_add_set_attribute_domain().
Definition at line 1720 of file db_class.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, db_add_constraint(), DB_CONSTRAINT_INDEX, and NULL.
Definition at line 797 of file db_class.c.
References add_method_internal(), and ID_METHOD.
Definition at line 1127 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_add_method_file(), smt_edit_class_mop(), and smt_quit().
Definition at line 1534 of file db_class.c.
References assert, AU_ALTER, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class_auto(), smt_add_resolution(), smt_edit_class_mop(), and smt_quit().
int db_add_set_argument_domain | ( | DB_OBJECT * | class_, |
const char * | name, | ||
int | class_method, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 1049 of file db_class.c.
References add_arg_domain().
int db_add_set_attribute_domain | ( | MOP | class_, |
const char * | name, | ||
int | class_attribute, | ||
const char * | domain | ||
) |
Definition at line 444 of file db_class.c.
References assert, AU_ALTER, CHECK_3ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_add_set_attribute_domain(), smt_edit_class_mop(), and smt_quit().
Referenced by db_add_element_domain().
int db_add_shared_attribute | ( | MOP | obj, |
const char * | name, | ||
const char * | domain, | ||
DB_VALUE * | default_value | ||
) |
Definition at line 268 of file db_class.c.
References db_add_attribute_internal(), and ID_SHARED_ATTRIBUTE.
Definition at line 1267 of file db_class.c.
References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, db_add_super_internal(), do_check_partitioned_class(), error(), NO_ERROR, and NULL.
Definition at line 1295 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class_auto(), smt_add_super(), smt_edit_class_mop(), and smt_quit().
Referenced by db_add_super().
Definition at line 584 of file db_class.c.
References assert, AU_ALTER, CHECK_3ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_edit_class_mop(), smt_quit(), and smt_set_attribute_default().
Referenced by ldr_class_attr_db_generic().
int db_change_method_implementation | ( | MOP | class_, |
const char * | name, | ||
int | class_method, | ||
const char * | newname | ||
) |
Definition at line 871 of file db_class.c.
References assert, AU_ALTER, CHECK_3ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_change_method_implementation(), smt_edit_class_mop(), and smt_quit().
Definition at line 1455 of file db_class.c.
References ARG_FILE_LINE, db_add_constraint(), DB_CONSTRAINT_NOT_NULL, db_drop_constraint(), do_check_rows_for_null(), ER_ERROR_SEVERITY, er_set(), ER_SM_ATTR_NOT_NULL, NO_ERROR, and NULL.
Referenced by boot_define_ha_apply_info(), boot_define_serial(), and do_alter_clause_change_attribute().
Definition at line 1497 of file db_class.c.
References db_add_constraint(), DB_CONSTRAINT_UNIQUE, db_drop_constraint(), and NULL.
Definition at line 70 of file db_class.c.
References assert_release, CHECK_1ARG_NULL, CHECK_CONNECT_NULL, CHECK_MODIFICATION_NULL, LC_CLASSNAME_RESERVED, locator_reserve_class_name(), sm_template::name, NO_ERROR, NULL, OID_INITIALIZER, sm_update_class(), smt_def_class(), and smt_quit().
Referenced by au_install(), and catcls_class_install().
Definition at line 354 of file db_class.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, db_drop_attribute_internal(), do_check_partitioned_class(), error(), and NO_ERROR.
Definition at line 380 of file db_class.c.
References drop_internal(), ER_SM_ATTRIBUTE_NOT_FOUND, error(), ID_ATTRIBUTE, ID_SHARED_ATTRIBUTE, and NO_ERROR.
Referenced by db_drop_attribute().
int db_drop_class | ( | MOP | class_ | ) |
Definition at line 110 of file db_class.c.
References db_drop_class_ex().
Referenced by au_install(), and catcls_vclass_install().
Definition at line 421 of file db_class.c.
References drop_internal(), and ID_CLASS_ATTRIBUTE.
Definition at line 122 of file db_class.c.
References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), NULL, and sm_delete_class_mop().
Referenced by db_drop_class(), and drop_class_name().
Definition at line 852 of file db_class.c.
References drop_internal(), and ID_CLASS_METHOD.
Referenced by catcls_vclass_install().
Definition at line 1668 of file db_class.c.
References assert, AU_ALTER, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class_auto(), smt_delete_class_resolution(), smt_edit_class_mop(), and smt_quit().
int db_drop_constraint | ( | MOP | classmop, |
DB_CONSTRAINT_TYPE | constraint_type, | ||
const char * | constraint_name, | ||
const char ** | att_names, | ||
int | class_attributes | ||
) |
Definition at line 1826 of file db_class.c.
References assert, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), free_and_init, NO_ERROR, NULL, sm_drop_constraint(), and sm_produce_constraint_name_mop().
Referenced by db_constrain_non_null(), db_constrain_unique(), and db_drop_index().
Definition at line 559 of file db_class.c.
References db_drop_set_attribute_domain().
Definition at line 1745 of file db_class.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, DB_CONSTRAINT_INDEX, db_drop_constraint(), and NULL.
Definition at line 835 of file db_class.c.
References drop_internal(), and ID_METHOD.
Definition at line 1174 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_drop_method_file(), smt_edit_class_mop(), and smt_quit().
int db_drop_method_files | ( | MOP | class_ | ) |
Definition at line 1218 of file db_class.c.
References assert, AU_ALTER, CHECK_1ARG_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_edit_class_mop(), smt_quit(), and smt_reset_method_files().
Definition at line 1625 of file db_class.c.
References assert, AU_ALTER, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class_auto(), smt_delete_resolution(), smt_edit_class_mop(), and smt_quit().
int db_drop_set_attribute_domain | ( | MOP | class_, |
const char * | name, | ||
int | class_attribute, | ||
const char * | domain | ||
) |
Definition at line 513 of file db_class.c.
References assert, AU_ALTER, CHECK_3ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class(), smt_delete_set_attribute_domain(), smt_edit_class_mop(), and smt_quit().
Referenced by db_drop_element_domain().
Definition at line 404 of file db_class.c.
References drop_internal(), and ID_SHARED_ATTRIBUTE.
Definition at line 1346 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class_auto(), smt_delete_super(), smt_edit_class_mop(), and smt_quit().
Definition at line 1399 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class_auto(), smt_delete_super_connect(), smt_edit_class_mop(), and smt_quit().
Definition at line 628 of file db_class.c.
References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, db_rename_internal(), do_check_partitioned_class(), error(), and NO_ERROR.
int db_rename_attribute | ( | MOP | class_, |
const char * | name, | ||
int | class_attribute, | ||
const char * | newname | ||
) |
Definition at line 701 of file db_class.c.
References CHECK_PARTITION_SUBS, db_rename_internal(), do_check_partitioned_class(), error(), and NO_ERROR.
Definition at line 151 of file db_class.c.
References CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), NULL, and sm_rename_class().
Referenced by do_rename_internal().
Definition at line 654 of file db_class.c.
References assert, AU_ALTER, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class_auto(), smt_edit_class_mop(), smt_quit(), and smt_rename_any().
Referenced by db_rename(), db_rename_attribute(), and db_rename_method().
Definition at line 726 of file db_class.c.
References db_rename_internal().
int db_set_class_method_arg_domain | ( | DB_OBJECT * | class_, |
const char * | name, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 1024 of file db_class.c.
References add_arg_domain().
Definition at line 1075 of file db_class.c.
References assert, AU_ALTER, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, er_errid(), error(), NO_ERROR, NULL, sm_update_class(), smt_edit_class_mop(), smt_quit(), and smt_set_loader_commands().
int db_set_method_arg_domain | ( | DB_OBJECT * | class_, |
const char * | name, | ||
int | index, | ||
const char * | domain | ||
) |
Definition at line 1006 of file db_class.c.
References add_arg_domain().
int db_truncate_class | ( | DB_OBJECT * | class_ | ) |
Definition at line 1859 of file db_class.c.
References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, NO_ERROR, and sm_truncate_class().
Referenced by synccoll_force(), and truncate_class_name().
|
static |
Definition at line 311 of file db_class.c.
References assert, AU_ALTER, CHECK_2ARGS_RETURN_EXPR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, er_errid(), ER_OBJ_INVALID_ARGUMENTS, error(), NO_ERROR, NULL, sm_update_class_auto(), smt_delete_any(), smt_edit_class_mop(), and smt_quit().
Referenced by db_drop_attribute_internal(), db_drop_class_attribute(), db_drop_class_method(), db_drop_method(), and db_drop_shared_attribute().