CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "error_manager.h"
#include "object_representation.h"
#include "object_domain.h"
#include "work_space.h"
#include "object_primitive.h"
#include "class_object.h"
#include "schema_manager.h"
#include "set_object.h"
#include "locator_cl.h"
#include "authenticate.h"
#include "transform_cl.h"
#include "statistics.h"
#include "virtual_object.h"
#include "db.h"
#include "release_string.h"
#include "execute_schema.h"
#include "dbtype.h"
Go to the source code of this file.
Macros | |
#define | DOWNCASE_NAME(a, b) |
Functions | |
static int | find_method (SM_TEMPLATE *template_, const char *name, int class_method, SM_METHOD **methodp) |
static SM_COMPONENT * | find_component (SM_TEMPLATE *template_, const char *name, int class_stuff) |
static int | find_any (SM_TEMPLATE *template_, const char *name, int class_stuff, SM_COMPONENT **thing) |
static int | find_signature (SM_TEMPLATE *template_, const char *name, int class_method, const char *signame, SM_METHOD **methodp, SM_METHOD_SIGNATURE **sigp) |
static int | find_argument (SM_TEMPLATE *template_, const char *name, int class_method, const char *signame, int index, int create, SM_METHOD **methodp, SM_METHOD_SIGNATURE **sigp, SM_METHOD_ARGUMENT **argp) |
static int | check_namespace (SM_TEMPLATE *temp, const char *name, const bool class_namespace) |
static SM_RESOLUTION * | find_alias (SM_RESOLUTION *reslist, const char *name, SM_NAME_SPACE name_space) |
static int | resolve_class_domain (SM_TEMPLATE *tmp, DB_DOMAIN *domain) |
static int | get_domain_internal (SM_TEMPLATE *tmp, const char *domain_string, DB_DOMAIN **domainp, int check_internal) |
static int | get_domain (SM_TEMPLATE *tmp, const char *domain_string, DB_DOMAIN **domain) |
static int | check_domain_class_type (SM_TEMPLATE *template_, DB_OBJECT *domain_classobj) |
static SM_TEMPLATE * | def_class_internal (const char *name, int class_type) |
static int | smt_add_constraint_to_property (SM_TEMPLATE *template_, SM_CONSTRAINT_TYPE type, const char *constraint_name, SM_ATTRIBUTE **atts, const int *asc_desc, const int *attr_prefix_length, SM_FOREIGN_KEY_INFO *fk_info, char *shared_cons_name, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status) |
static int | smt_set_attribute_orig_default_value (SM_ATTRIBUTE *att, DB_VALUE *new_orig_value, DB_DEFAULT_EXPR *default_expr) |
static int | smt_drop_constraint_from_property (SM_TEMPLATE *template_, const char *constraint_name, SM_ATTRIBUTE_FLAG constraint) |
static int | smt_check_foreign_key (SM_TEMPLATE *template_, const char *constraint_name, SM_ATTRIBUTE **atts, int n_atts, SM_FOREIGN_KEY_INFO *fk_info) |
static int | check_alias_delete (SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE name_space, int error) |
static int | check_resolution_name (MOP classmop, const char *name, int class_name) |
static int | check_local_definition (SM_TEMPLATE *template_, const char *name, const char *alias, SM_NAME_SPACE name_space) |
static int | add_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias, SM_NAME_SPACE name_space) |
static int | delete_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, SM_NAME_SPACE name_space) |
static int | smt_add_attribute_to_list (SM_ATTRIBUTE **att_list, SM_ATTRIBUTE *att, const bool add_first, const char *add_after_attribute) |
static int | smt_change_attribute (SM_TEMPLATE *template_, const char *name, const char *new_name, const char *new_domain_string, DB_DOMAIN *new_domain, const SM_NAME_SPACE name_space, const bool change_first, const char *change_after_attribute, SM_ATTRIBUTE **found_att) |
static int | smt_change_attribute_pos_in_list (SM_ATTRIBUTE **att_list, SM_ATTRIBUTE *att, const bool change_first, const char *change_after_attribute) |
static int | smt_change_class_shared_attribute_domain (SM_ATTRIBUTE *att, DB_DOMAIN *new_domain) |
static int | change_constraints_comment_partitioned_class (MOP obj, const char *index_name, const char *comment) |
static MOP | smt_find_owner_of_constraint (SM_TEMPLATE *ctemplate, const char *constraint_name) |
static int | change_constraints_status_partitioned_class (MOP obj, const char *index_name, SM_INDEX_STATUS index_status) |
static SM_CLASS_CONSTRAINT * | smt_find_constraint (SM_TEMPLATE *ctemplate, const char *constraint_name) |
int | smt_find_attribute (SM_TEMPLATE *template_, const char *name, int class_attribute, SM_ATTRIBUTE **attp) |
SM_TEMPLATE * | smt_def_class (const char *name) |
SM_TEMPLATE * | smt_edit_class_mop (MOP op, DB_AUTH db_auth_type) |
SM_TEMPLATE * | smt_copy_class_mop (const char *name, MOP op, SM_CLASS **class_) |
SM_TEMPLATE * | smt_copy_class (const char *new_name, const char *existing_name, SM_CLASS **class_) |
int | smt_quit (SM_TEMPLATE *template_) |
int | smt_add_attribute_w_dflt_w_order (DB_CTMPL *def, const char *name, const char *domain_string, DB_DOMAIN *domain, DB_VALUE *default_value, const SM_NAME_SPACE name_space, const bool add_first, const char *add_after_attribute, DB_DEFAULT_EXPR *default_expr, DB_DEFAULT_EXPR_TYPE *on_update, const char *comment) |
int | smt_add_attribute_w_dflt (DB_CTMPL *def, const char *name, const char *domain_string, DB_DOMAIN *domain, DB_VALUE *default_value, const SM_NAME_SPACE name_space, DB_DEFAULT_EXPR *default_expr, DB_DEFAULT_EXPR_TYPE *on_update, const char *comment) |
int | smt_add_attribute_any (SM_TEMPLATE *template_, const char *name, const char *domain_string, DB_DOMAIN *domain, const SM_NAME_SPACE name_space, const bool add_first, const char *add_after_attribute, const char *comment) |
int | smt_add_attribute (SM_TEMPLATE *template_, const char *name, const char *domain_string, DB_DOMAIN *domain) |
int | smt_add_set_attribute_domain (SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain) |
int | smt_delete_set_attribute_domain (SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain) |
int | smt_set_attribute_default (SM_TEMPLATE *template_, const char *name, int class_attribute, DB_VALUE *proposed_value, DB_DEFAULT_EXPR *default_expr) |
int | smt_set_attribute_on_update (SM_TEMPLATE *template_, const char *name, int class_attribute, DB_DEFAULT_EXPR_TYPE on_update) |
int | smt_drop_constraint (SM_TEMPLATE *template_, const char **att_names, const char *constraint_name, int class_attribute, SM_ATTRIBUTE_FLAG constraint) |
int | smt_check_index_exist (SM_TEMPLATE *template_, char **out_shared_cons_name, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const SM_PREDICATE_INFO *filter_index, const SM_FUNCTION_INFO *function_index) |
int | smt_add_constraint (SM_TEMPLATE *template_, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const int *attrs_prefix_length, int class_attribute, SM_FOREIGN_KEY_INFO *fk_info, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status) |
int | smt_add_method_any (SM_TEMPLATE *template_, const char *name, const char *function, SM_NAME_SPACE name_space) |
int | smt_add_method (SM_TEMPLATE *template_, const char *name, const char *function) |
int | smt_add_class_method (SM_TEMPLATE *template_, const char *name, const char *function) |
int | smt_change_method_implementation (SM_TEMPLATE *template_, const char *name, int class_method, const char *function) |
int | smt_assign_argument_domain (SM_TEMPLATE *template_, const char *name, int class_method, const char *implementation, int index, const char *domain_string, DB_DOMAIN *domain) |
int | smt_add_set_argument_domain (SM_TEMPLATE *template_, const char *name, int class_method, const char *implementation, int index, const char *domain_string, DB_DOMAIN *domain) |
int | smt_rename_any (SM_TEMPLATE *template_, const char *name, const bool class_namespace, const char *new_name) |
int | smt_change_constraint_comment (SM_TEMPLATE *ctemplate, const char *index_name, const char *comment) |
int | smt_delete_any (SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE name_space) |
int | smt_add_super (SM_TEMPLATE *template_, MOP super_class) |
int | smt_delete_super (SM_TEMPLATE *template_, MOP super_class) |
int | smt_delete_super_connect (SM_TEMPLATE *template_, MOP super_class) |
int | smt_add_method_file (SM_TEMPLATE *template_, const char *filename) |
int | smt_reset_method_files (SM_TEMPLATE *template_) |
int | smt_drop_method_file (SM_TEMPLATE *template_, const char *name) |
int | smt_rename_method_file (SM_TEMPLATE *template_, const char *old_name, const char *new_name) |
int | smt_set_loader_commands (SM_TEMPLATE *template_, const char *commands) |
int | smt_add_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias) |
int | smt_add_class_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias) |
int | smt_delete_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name) |
int | smt_delete_class_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name) |
int | smt_add_query_spec (SM_TEMPLATE *template_, const char *specification) |
int | smt_reset_query_spec (SM_TEMPLATE *template_) |
int | smt_drop_query_spec (SM_TEMPLATE *def, const int index) |
SM_TEMPLATE * | smt_def_typed_class (const char *name, SM_CLASS_TYPE ct) |
SM_CLASS_TYPE | smt_get_class_type (SM_TEMPLATE *template_) |
SM_CLASS_TYPE | sm_get_class_type (SM_CLASS *class_) |
int | smt_change_query_spec (SM_TEMPLATE *def, const char *query, const int index) |
int | smt_change_attribute_w_dflt_w_order (DB_CTMPL *def, const char *name, const char *new_name, const char *new_domain_string, DB_DOMAIN *new_domain, const SM_NAME_SPACE name_space, DB_VALUE *new_default_value, DB_DEFAULT_EXPR *new_default_expr, DB_DEFAULT_EXPR_TYPE on_update_expr, const bool change_first, const char *change_after_attribute, SM_ATTRIBUTE **found_att) |
static int | smt_is_change_status_allowed (SM_TEMPLATE *ctemplate, const char *index_name) |
int | smt_change_constraint_status (SM_TEMPLATE *ctemplate, const char *index_name, SM_INDEX_STATUS index_status) |
#define DOWNCASE_NAME | ( | a, | |
b | |||
) |
Definition at line 55 of file schema_template.c.
Referenced by smt_change_query_spec().
|
static |
Definition at line 3698 of file schema_template.c.
References sm_resolution::alias, assert, check_local_definition(), check_resolution_name(), sm_resolution::class_mop, classobj_free_resolution(), classobj_make_resolution(), db_ws_free(), er_errid(), ER_OBJ_INVALID_ARGUMENTS, ER_SM_ATTRIBUTE_NOT_FOUND, error(), ERROR0, ERROR1, ID_CLASS, ID_INSTANCE, sm_resolution::name, sm_resolution::next, NO_ERROR, NULL, sm_check_name(), SM_COMPARE_NAMES, sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, ws_copy_string(), WS_LIST_APPEND, and WS_LIST_REMOVE.
Referenced by smt_add_class_resolution(), and smt_add_resolution().
|
static |
Definition at line 2960 of file schema_template.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, AU_INDEX, classobj_change_constraint_comment(), DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, er_errid(), ER_ERROR_SEVERITY, ER_NOT_ALLOWED_ACCESS_TO_PARTITION, er_set(), error(), free_and_init, i, NO_ERROR, NULL, sm_template::properties, sm_partitioned_class_type(), sm_update_class(), smt_edit_class_mop(), smt_find_constraint(), and smt_quit().
Referenced by smt_change_constraint_comment().
|
static |
Definition at line 4628 of file schema_template.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, AU_INDEX, classobj_change_constraint_status(), DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, ER_ERROR_SEVERITY, ER_NOT_ALLOWED_ACCESS_TO_PARTITION, er_set(), error(), free_and_init, i, NO_ERROR, NULL, sm_template::properties, sm_partitioned_class_type(), sm_update_class(), smt_edit_class_mop(), smt_find_constraint(), and smt_quit().
Referenced by smt_change_constraint_status().
|
static |
Definition at line 3097 of file schema_template.c.
References classobj_free_resolution(), error(), find_alias(), ID_INSTANCE, NO_ERROR, NULL, and WS_LIST_REMOVE.
Referenced by smt_delete_any().
|
static |
Definition at line 666 of file schema_template.c.
References au_fetch_class_force(), AU_FETCH_READ, sm_class::class_type, sm_template::class_type, ER_SM_INCOMPATIBLE_DOMAIN_CLASS_TYPE, error(), ERROR1, NO_ERROR, NULL, sm_ch_name(), and SM_CLASS_CT.
Referenced by smt_add_attribute_any(), and smt_change_attribute().
|
static |
Definition at line 3652 of file schema_template.c.
References ER_SM_ALIAS_COMPONENT_EXISTS, ER_SM_RESOLUTION_COMPONENT_EXISTS, error(), ERROR1, ERROR2, find_component(), ID_CLASS, NO_ERROR, NULL, and sm_resolution_space().
Referenced by add_resolution().
|
static |
Definition at line 485 of file schema_template.c.
References sm_template::attributes, sm_template::class_attributes, sm_template::class_methods, ER_SM_NAME_RESERVED_BY_ATT, ER_SM_NAME_RESERVED_BY_METHOD, error(), ERROR1, sm_template::methods, NO_ERROR, NULL, and SM_FIND_NAME_IN_COMPONENT_LIST.
Referenced by smt_add_attribute_any(), smt_add_method_any(), smt_change_attribute(), and smt_rename_any().
Definition at line 3621 of file schema_template.c.
References au_fetch_class(), AU_FETCH_READ, AU_SELECT, classobj_find_component(), NO_ERROR, and NULL.
Referenced by add_resolution().
|
static |
Definition at line 697 of file schema_template.c.
References ARG_FILE_LINE, classobj_make_template(), ER_ERROR_SEVERITY, er_set(), ER_SM_CLASS_WITH_PRIM_NAME, NULL, pr_find_type(), sm_check_name(), sm_downcase_name(), and SM_MAX_IDENTIFIER_LENGTH.
Referenced by smt_def_class(), and smt_def_typed_class().
|
static |
Definition at line 3866 of file schema_template.c.
References classobj_find_resolution(), classobj_free_resolution(), ER_SM_RESOLUTION_NOT_FOUND, error(), ERROR1, ID_INSTANCE, NO_ERROR, NULL, and WS_LIST_REMOVE.
Referenced by smt_delete_class_resolution(), and smt_delete_resolution().
|
static |
Definition at line 525 of file schema_template.c.
References sm_resolution::alias, sm_resolution::name_space, sm_resolution::next, NULL, and SM_COMPARE_NAMES.
Referenced by check_alias_delete().
|
static |
Definition at line 294 of file schema_template.c.
References ASSERT_ERROR_AND_SET, sm_attribute::class_mop, sm_method::class_mop, classobj_find_attribute(), classobj_find_method(), sm_template::current, ER_SM_ATTMETH_NOT_FOUND, ER_SM_INHERITED_ATTRIBUTE, ER_SM_INHERITED_METHOD, error(), ERROR1, ERROR2, find_component(), NO_ERROR, NULL, sm_check_name(), and sm_get_ch_name().
Referenced by smt_delete_any(), and smt_rename_any().
|
static |
Definition at line 421 of file schema_template.c.
References sm_method_signature::args, assert, classobj_find_method_arg(), classobj_make_method_arg(), er_errid(), ER_SM_METHOD_ARG_NOT_FOUND, error(), ERROR2, find_signature(), NO_ERROR, NULL, sm_method_signature::num_args, and sm_method_signature::value.
Referenced by smt_add_set_argument_domain(), and smt_assign_argument_domain().
|
static |
Definition at line 254 of file schema_template.c.
References NULL, and SM_FIND_NAME_IN_COMPONENT_LIST.
Referenced by check_local_definition(), and find_any().
|
static |
Definition at line 197 of file schema_template.c.
References ASSERT_ERROR_AND_SET, classobj_find_method(), sm_template::current, ER_SM_INHERITED_METHOD, ER_SM_METHOD_NOT_FOUND, error(), ERROR1, ERROR2, NO_ERROR, NULL, sm_check_name(), SM_FIND_NAME_IN_COMPONENT_LIST, and sm_get_ch_name().
Referenced by find_signature(), and smt_delete_any().
|
static |
Definition at line 375 of file schema_template.c.
References ER_SM_SIGNATURE_NOT_FOUND, error(), ERROR2, find_method(), NO_ERROR, NULL, and sm_method::signatures.
Referenced by find_argument().
|
static |
Definition at line 651 of file schema_template.c.
References get_domain_internal().
Referenced by smt_add_attribute_any(), smt_add_set_argument_domain(), smt_add_set_attribute_domain(), smt_assign_argument_domain(), smt_change_attribute(), and smt_delete_set_attribute_domain().
|
static |
Definition at line 590 of file schema_template.c.
References assert, er_errid(), ER_SM_DOMAIN_NOT_A_CLASS, ER_SM_INVALID_ARGUMENTS, error(), ERROR0, ERROR1, pr_type::id, sm_template::name, NO_ERROR, NULL, pr_find_type(), pt_string_to_db_domain(), resolve_class_domain(), and tp_domain_construct().
Referenced by get_domain().
|
static |
Definition at line 548 of file schema_template.c.
References tp_domain::class_mop, DB_TYPE_MULTISET, DB_TYPE_OBJECT, DB_TYPE_SEQUENCE, DB_TYPE_SET, error(), tp_domain::next, NO_ERROR, tp_domain::self_ref, tp_domain::setdomain, TP_DOMAIN_TYPE, tp_Type_null, and tp_domain::type.
Referenced by get_domain_internal().
SM_CLASS_TYPE sm_get_class_type | ( | SM_CLASS * | class_ | ) |
Definition at line 4083 of file schema_template.c.
References sm_class::class_type.
Referenced by db_is_class(), db_is_vclass(), is_vclass_object(), pt_check_show_index(), pt_check_table_in_show_heap(), pt_has_modified_class_helper(), sm_fetch_all_objects_internal(), and vid_getall_mops().
int smt_add_attribute | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain | ||
) |
Definition at line 1181 of file schema_template.c.
References ID_ATTRIBUTE, NULL, and smt_add_attribute_any().
Referenced by au_install(), boot_define_attribute(), boot_define_charsets(), boot_define_class(), boot_define_class_authorization(), boot_define_collations(), boot_define_data_type(), boot_define_domain(), boot_define_dual(), 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(), and boot_define_stored_procedure_arguments().
int smt_add_attribute_any | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain, | ||
const SM_NAME_SPACE | name_space, | ||
const bool | add_first, | ||
const char * | add_after_attribute, | ||
const char * | comment | ||
) |
Definition at line 1002 of file schema_template.c.
References assert, sm_attribute::auto_increment, check_domain_class_type(), check_namespace(), tp_domain::class_mop, sm_attribute::class_mop, classobj_free_attribute(), classobj_make_attribute(), sm_attribute::comment, DB_TYPE_OBJECT, sm_attribute::domain, er_errid(), ER_SM_INVALID_ARGUMENTS, ERROR0, sm_attribute::flags, get_domain(), ID_ATTRIBUTE, ID_CLASS, ID_CLASS_ATTRIBUTE, ID_INSTANCE, ID_SHARED_ATTRIBUTE, NO_ERROR, NULL, SM_ATTFLAG_NEW, sm_check_name(), sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, smt_add_attribute_to_list(), TP_DOMAIN_TYPE, tp_domain::type, and ws_copy_string().
Referenced by db_add_attribute_internal(), smt_add_attribute(), and smt_add_attribute_w_dflt_w_order().
|
static |
Definition at line 1123 of file schema_template.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_QPROC_INVALID_COLNAME, er_set(), sm_attribute::header, intl_identifier_casecmp(), sm_component::name, sm_component::next, NO_ERROR, NULL, WS_LIST_APPEND, and WS_LIST_NCONC.
Referenced by smt_add_attribute_any(), and smt_change_attribute_pos_in_list().
int smt_add_attribute_w_dflt | ( | DB_CTMPL * | def, |
const char * | name, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain, | ||
DB_VALUE * | default_value, | ||
const SM_NAME_SPACE | name_space, | ||
DB_DEFAULT_EXPR * | default_expr, | ||
DB_DEFAULT_EXPR_TYPE * | on_update, | ||
const char * | comment | ||
) |
Definition at line 974 of file schema_template.c.
References NULL, and smt_add_attribute_w_dflt_w_order().
Referenced by classobj_copy_attribute_like(), dbt_add_attribute(), dbt_add_class_attribute(), dbt_add_shared_attribute(), and do_add_attribute_from_select_column().
int smt_add_attribute_w_dflt_w_order | ( | DB_CTMPL * | def, |
const char * | name, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain, | ||
DB_VALUE * | default_value, | ||
const SM_NAME_SPACE | name_space, | ||
const bool | add_first, | ||
const char * | add_after_attribute, | ||
DB_DEFAULT_EXPR * | default_expr, | ||
DB_DEFAULT_EXPR_TYPE * | on_update, | ||
const char * | comment | ||
) |
Definition at line 927 of file schema_template.c.
References error(), ID_CLASS_ATTRIBUTE, NO_ERROR, NULL, smt_add_attribute_any(), smt_set_attribute_default(), and smt_set_attribute_on_update().
Referenced by do_add_attribute(), and smt_add_attribute_w_dflt().
int smt_add_class_method | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const char * | function | ||
) |
Definition at line 2373 of file schema_template.c.
References ID_CLASS_METHOD, and smt_add_method_any().
Referenced by au_add_method_check_authorization(), au_install(), and boot_define_serial().
int smt_add_class_resolution | ( | SM_TEMPLATE * | template_, |
MOP | super_class, | ||
const char * | name, | ||
const char * | alias | ||
) |
Definition at line 3912 of file schema_template.c.
References add_resolution(), and ID_CLASS.
Referenced by db_add_class_resolution(), and dbt_add_class_resolution().
int smt_add_constraint | ( | SM_TEMPLATE * | template_, |
DB_CONSTRAINT_TYPE | constraint_type, | ||
const char * | constraint_name, | ||
const char ** | att_names, | ||
const int * | asc_desc, | ||
const int * | attrs_prefix_length, | ||
int | class_attribute, | ||
SM_FOREIGN_KEY_INFO * | fk_info, | ||
SM_PREDICATE_INFO * | filter_index, | ||
SM_FUNCTION_INFO * | function_index, | ||
const char * | comment, | ||
SM_INDEX_STATUS | index_status | ||
) |
Definition at line 1936 of file schema_template.c.
References ARG_FILE_LINE, assert, sm_template::class_type, DB_CONSTRAINT_INDEX, DB_CONSTRAINT_PRIMARY_KEY, DB_CONSTRAINT_REVERSE_INDEX, DB_IS_NULL, DB_TYPE_BLOB, DB_TYPE_CLOB, default_value, do_check_rows_for_null(), er_clear(), ER_ERROR_SEVERITY, ER_FK_CANT_ON_SHARED_ATTRIBUTE, ER_OBJ_INVALID_ARGUMENTS, ER_OUT_OF_VIRTUAL_MEMORY, ER_REGU_NOT_IMPLEMENTED, er_set(), ER_SM_ATTR_NOT_NULL, ER_SM_CONSTRAINT_EXISTS, ER_SM_INDEX_ATTR_DUPLICATED, ER_SM_INDEX_ON_SHARED, ER_SM_INHERITED_ATTRIBUTE, ER_SM_INVALID_ARGUMENTS, ER_SM_INVALID_CONSTRAINT, ER_SM_INVALID_INDEX_TYPE, ER_SM_INVALID_INDEX_WITH_PREFIX_TYPE, ER_SM_INVALID_PREFIX_LENGTH, ER_SM_INVALID_UNIQUE_TYPE, ER_SM_NOT_NULL_NOT_ALLOWED, ER_SM_NOT_NULL_ON_VCLASS, ER_SM_NOT_NULL_WRONG_NUM_ATTS, ER_SM_UNIQUE_ON_VCLASS, error(), ERROR0, ERROR1, ERROR2, sm_attribute::flags, free_and_init, sm_attribute::header, i, pr_type::id, sm_attribute::id, ID_ATTRIBUTE, ID_SHARED_ATTRIBUTE, intl_identifier_casecmp(), sm_component::name, sm_component::name_space, NO_ERROR, NULL, sm_template::op, pr_type_name(), rel_major_release_string(), SM_ATTFLAG_FOREIGN_KEY, SM_ATTFLAG_INDEX, SM_ATTFLAG_NON_NULL, SM_ATTFLAG_PRIMARY_KEY, SM_ATTFLAG_REVERSE_INDEX, SM_CLASS_CT, SM_GET_CONSTRAINT_STRING, SM_IS_ATTFLAG_INDEX_FAMILY, SM_IS_ATTFLAG_UNIQUE_FAMILY, SM_MAP_CONSTRAINT_TO_ATTFLAG, SM_MAP_INDEX_ATTFLAG_TO_CONSTRAINT, smt_add_constraint_to_property(), smt_check_foreign_key(), smt_check_index_exist(), smt_find_attribute(), TEXT_CONSTRAINT_PREFIX, TP_IS_BIT_TYPE, TP_IS_CHAR_TYPE, tp_valid_indextype(), and sm_attribute::type.
Referenced by classobj_copy_constraint_like(), dbt_add_constraint(), dbt_add_foreign_key(), do_add_constraints(), and sm_add_constraint().
|
static |
Definition at line 1541 of file schema_template.c.
References ASSERT_ERROR_AND_SET, classobj_find_prop_constraint(), classobj_map_constraint_to_property(), classobj_put_index(), db_make_null(), ER_SM_CONSTRAINT_EXISTS, error(), ERROR1, NO_ERROR, NULL, pr_clear_value(), and sm_template::properties.
Referenced by smt_add_constraint().
int smt_add_method | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const char * | function | ||
) |
Definition at line 2367 of file schema_template.c.
References ID_METHOD, and smt_add_method_any().
Referenced by au_install().
int smt_add_method_any | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const char * | function, | ||
SM_NAME_SPACE | name_space | ||
) |
Definition at line 2255 of file schema_template.c.
References ASSERT_ERROR_AND_SET, check_namespace(), sm_method::class_mop, classobj_make_method(), classobj_make_method_signature(), ER_SM_SIGNATURE_EXISTS, error(), ERROR2, ID_CLASS, ID_CLASS_METHOD, sm_template::name, NLIST_FIND, NO_ERROR, NULL, sm_template::op, sm_method::signatures, sm_check_name(), sm_downcase_name(), SM_FIND_NAME_IN_COMPONENT_LIST, sm_get_ch_name(), SM_MAX_IDENTIFIER_LENGTH, and WS_LIST_APPEND.
Referenced by add_method_internal(), dbt_add_class_method(), dbt_add_method(), smt_add_class_method(), and smt_add_method().
int smt_add_method_file | ( | SM_TEMPLATE * | template_, |
const char * | filename | ||
) |
Definition at line 3457 of file schema_template.c.
References assert, sm_method_file::class_mop, classobj_make_method_file(), er_errid(), error(), sm_template::method_files, NLIST_FIND, NO_ERROR, NULL, and WS_LIST_APPEND.
Referenced by db_add_method_file(), and dbt_add_method_file().
int smt_add_query_spec | ( | SM_TEMPLATE * | template_, |
const char * | specification | ||
) |
Definition at line 3950 of file schema_template.c.
References ARG_FILE_LINE, assert, classobj_make_query_spec(), db_ws_free(), er_errid(), er_set(), ER_SM_INVALID_CLASS, ER_WARNING_SEVERITY, error(), NO_ERROR, NULL, sm_template::query_spec, SM_VCLASS_CT, and WS_LIST_APPEND.
Referenced by db_add_query_spec(), and dbt_add_query_spec().
int smt_add_resolution | ( | SM_TEMPLATE * | template_, |
MOP | super_class, | ||
const char * | name, | ||
const char * | alias | ||
) |
Definition at line 3906 of file schema_template.c.
References add_resolution(), and ID_INSTANCE.
Referenced by db_add_resolution(), and dbt_add_resolution().
int smt_add_set_argument_domain | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_method, | ||
const char * | implementation, | ||
int | index, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain | ||
) |
Definition at line 2509 of file schema_template.c.
References sm_method_argument::domain, ER_SM_ARG_DOMAIN_NOT_A_SET, ER_SM_DOMAIN_NOT_FOUND, error(), ERROR2, find_argument(), get_domain(), NO_ERROR, NULL, pr_is_set_type(), tp_domain::setdomain, tp_domain_add(), and TP_DOMAIN_TYPE.
Referenced by add_arg_domain(), dbt_add_set_argument_domain(), and do_add_methods().
int smt_add_set_attribute_domain | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_attribute, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain | ||
) |
Definition at line 1198 of file schema_template.c.
References assert, sm_attribute::domain, er_errid(), ER_SM_DOMAIN_NOT_A_SET, ER_SM_NO_NESTED_SETS, error(), ERROR1, get_domain(), tp_domain::is_cached, NO_ERROR, NULL, pr_is_set_type(), tp_domain::setdomain, smt_find_attribute(), tp_domain_add(), tp_domain_cache(), tp_domain_copy(), tp_domain_free(), and TP_DOMAIN_TYPE.
Referenced by db_add_set_attribute_domain(), and dbt_add_set_attribute_domain().
int smt_add_super | ( | SM_TEMPLATE * | template_, |
MOP | super_class | ||
) |
Definition at line 3330 of file schema_template.c.
References sm_template::class_type, db_get_class_name(), db_is_class(), db_is_vclass(), ER_SM_INCOMPATIBLE_SUPER_CLASS, ER_SM_SUPER_CAUSES_CYCLES, ER_SM_SUPER_CLASS_EXISTS, error(), ERROR0, ERROR2, sm_template::inheritance, is_class(), ml_append(), ml_find(), sm_template::name, NO_ERROR, NULL, sm_template::op, SM_CLASS_CT, and SM_VCLASS_CT.
Referenced by db_add_super_internal(), and dbt_add_super().
int smt_assign_argument_domain | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_method, | ||
const char * | implementation, | ||
int | index, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain | ||
) |
Definition at line 2453 of file schema_template.c.
References sm_method_argument::domain, error(), find_argument(), get_domain(), NO_ERROR, NULL, tp_domain::type, and sm_method_argument::type.
Referenced by add_arg_domain(), au_add_method_check_authorization(), au_install(), dbt_add_argument(), and do_add_methods().
|
static |
Definition at line 4232 of file schema_template.c.
References assert, check_domain_class_type(), check_namespace(), tp_domain::class_mop, DB_TYPE_OBJECT, sm_attribute::domain, er_errid(), ER_SM_INVALID_ARGUMENTS, ERROR0, get_domain(), sm_attribute::header, ID_ATTRIBUTE, ID_CLASS_ATTRIBUTE, ID_SHARED_ATTRIBUTE, sm_component::name, NO_ERROR, NULL, sm_check_name(), sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, smt_change_attribute_pos_in_list(), smt_change_class_shared_attribute_domain(), smt_find_attribute(), TP_DOMAIN_TYPE, tp_domain::type, sm_attribute::type, ws_copy_string(), and ws_free_string().
Referenced by smt_change_attribute_w_dflt_w_order().
|
static |
Definition at line 4488 of file schema_template.c.
References assert, ER_SM_ATTRIBUTE_NOT_FOUND, sm_attribute::header, sm_component::next, NO_ERROR, NULL, smt_add_attribute_to_list(), and WS_LIST_REMOVE.
Referenced by smt_change_attribute().
int smt_change_attribute_w_dflt_w_order | ( | DB_CTMPL * | def, |
const char * | name, | ||
const char * | new_name, | ||
const char * | new_domain_string, | ||
DB_DOMAIN * | new_domain, | ||
const SM_NAME_SPACE | name_space, | ||
DB_VALUE * | new_default_value, | ||
DB_DEFAULT_EXPR * | new_default_expr, | ||
DB_DEFAULT_EXPR_TYPE | on_update_expr, | ||
const bool | change_first, | ||
const char * | change_after_attribute, | ||
SM_ATTRIBUTE ** | found_att | ||
) |
Definition at line 4387 of file schema_template.c.
References assert, DB_DEFAULT_NONE, DB_IS_NULL, db_value_coerce(), db_default_expr::default_expr_type, db_value::domain, DOMAIN_COMPATIBLE, ER_OBJ_DOMAIN_CONFLICT, ER_UNEXPECTED, error(), ERROR1, ID_ATTRIBUTE, ID_CLASS_ATTRIBUTE, ID_SHARED_ATTRIBUTE, NO_ERROR, NULL, pr_free_ext_value(), pr_make_ext_value(), SM_ATTFLAG_NEW, smt_change_attribute(), smt_set_attribute_default(), smt_set_attribute_on_update(), smt_set_attribute_orig_default_value(), tp_domain_check(), and TP_EXACT_MATCH.
Referenced by do_change_att_schema_only().
|
static |
Definition at line 4522 of file schema_template.c.
References assert, DB_IS_NULL, sm_attribute::default_value, sm_attribute::domain, DOMAIN_COMPATIBLE, ER_OBJ_DOMAIN_CONFLICT, error(), ERROR1, sm_attribute::header, sm_component::name, NO_ERROR, NULL, pr_clear_value(), pr_clone_value(), pr_free_ext_value(), pr_make_ext_value(), tp_domain_check(), TP_EXACT_MATCH, tp_value_cast(), tp_domain::type, sm_attribute::type, and sm_default_value::value.
Referenced by smt_change_attribute().
int smt_change_constraint_comment | ( | SM_TEMPLATE * | ctemplate, |
const char * | index_name, | ||
const char * | comment | ||
) |
Definition at line 3044 of file schema_template.c.
References assert, ASSERT_ERROR_AND_SET, change_constraints_comment_partitioned_class(), classobj_change_constraint_comment(), error(), NO_ERROR, NULL, sm_template::op, sm_template::properties, and smt_find_constraint().
Referenced by do_alter_index_comment(), and do_alter_index_rebuild().
int smt_change_constraint_status | ( | SM_TEMPLATE * | ctemplate, |
const char * | index_name, | ||
SM_INDEX_STATUS | index_status | ||
) |
Definition at line 4786 of file schema_template.c.
References assert, ASSERT_ERROR_AND_SET, change_constraints_status_partitioned_class(), classobj_change_constraint_status(), error(), NO_ERROR, NULL, sm_template::op, sm_template::properties, smt_find_constraint(), and smt_is_change_status_allowed().
Referenced by do_alter_index_status(), and sm_add_constraint().
int smt_change_method_implementation | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_method, | ||
const char * | function | ||
) |
Definition at line 2393 of file schema_template.c.
References ASSERT_ERROR_AND_SET, ER_SM_METHOD_NOT_FOUND, ER_SM_MULTIPLE_SIGNATURES, ER_SM_SIGNATURE_NOT_FOUND, error(), ERROR1, ERROR2, sm_method_signature::function, sm_method::function, sm_method_signature::function_name, sm_method_signature::next, NO_ERROR, NULL, sm_method::signatures, SM_FIND_NAME_IN_COMPONENT_LIST, ws_copy_string(), and ws_free_string().
Referenced by db_change_method_implementation(), and dbt_change_method_implementation().
int smt_change_query_spec | ( | SM_TEMPLATE * | def, |
const char * | query, | ||
const int | index | ||
) |
Definition at line 4097 of file schema_template.c.
References sm_resolution::alias, ARG_FILE_LINE, assert, sm_class::attributes, sm_class::class_attributes, sm_class::class_methods, classobj_free_query_spec(), classobj_make_query_spec(), DB_FETCH_QUERY_WRITE, DB_FETCH_WRITE, DOWNCASE_NAME, er_errid(), er_set(), ER_SM_QUERY_SPEC_NOT_FOUND, ER_WARNING_SEVERITY, error(), parser_context::file, sm_attribute::header, sm_method::header, i, locator_fetch_class(), locator_free_list_mops(), locator_get_all_mops(), sm_class::methods, list_mops::mops, sm_component::name, sm_resolution::name, sm_resolution::next, sm_query_spec::next, NO_ERROR, NULL, list_mops::num, sm_template::query_spec, sm_class::resolutions, sm_class::shared, SM_MAX_IDENTIFIER_LENGTH, sm_Root_class_mop, and ws_dirty().
Referenced by db_change_query_spec(), and dbt_change_query_spec().
|
static |
Definition at line 1584 of file schema_template.c.
References sm_class_constraint::attributes, sm_template::attributes, au_fetch_class(), AU_FETCH_READ, AU_SELECT, BTID_SET_NULL, classobj_find_attribute(), classobj_find_class_primary_key(), classobj_find_cons_primary_key(), classobj_free_class_constraints(), classobj_make_class_constraints(), sm_attribute::domain, ER_FK_HAS_DEFFERENT_TYPE_WITH_PK, ER_FK_NOT_HAVE_PK_MEMBER, ER_FK_NOT_MATCH_KEY_COUNT, ER_FK_REF_CLASS_HAS_NOT_PK, ER_FK_UNKNOWN_REF_CLASSNAME, ER_SM_ATTRIBUTE_NOT_FOUND, err, error(), ERROR1, ERROR2, sm_attribute::header, i, pr_type::id, sm_attribute::id, sm_class_constraint::index_btid, intl_identifier_casecmp(), sm_component::name, sm_foreign_key_info::name, sm_class_constraint::name, sm_template::name, NO_ERROR, NULL, OID_SET_NULL, sm_template::op, sm_template::properties, sm_foreign_key_info::ref_attrs, sm_foreign_key_info::ref_class, sm_foreign_key_info::ref_class_oid, sm_foreign_key_info::ref_class_pk_btid, sm_ch_name(), sm_find_class(), smt_find_attribute(), TP_DOMAIN_COLLATION, TP_TYPE_HAS_COLLATION, sm_attribute::type, and ws_oid().
Referenced by smt_add_constraint().
int smt_check_index_exist | ( | SM_TEMPLATE * | template_, |
char ** | out_shared_cons_name, | ||
DB_CONSTRAINT_TYPE | constraint_type, | ||
const char * | constraint_name, | ||
const char ** | att_names, | ||
const int * | asc_desc, | ||
const SM_PREDICATE_INFO * | filter_index, | ||
const SM_FUNCTION_INFO * | function_index | ||
) |
Definition at line 1872 of file schema_template.c.
References sm_template::attributes, au_fetch_class(), AU_FETCH_READ, AU_INDEX, classobj_check_index_exist(), classobj_free_class_constraints(), classobj_make_class_constraints(), sm_class::constraints, DB_IS_CONSTRAINT_INDEX_FAMILY, error(), sm_template::name, NO_ERROR, NULL, sm_template::op, and sm_template::properties.
Referenced by sm_add_constraint(), and smt_add_constraint().
SM_TEMPLATE* smt_copy_class | ( | const char * | new_name, |
const char * | existing_name, | ||
SM_CLASS ** | class_ | ||
) |
Definition at line 871 of file schema_template.c.
References NULL, sm_check_name(), sm_find_class(), and smt_copy_class_mop().
Referenced by dbt_copy_class().
SM_TEMPLATE* smt_copy_class_mop | ( | const char * | name, |
MOP | op, | ||
SM_CLASS ** | class_ | ||
) |
Definition at line 825 of file schema_template.c.
References ARG_FILE_LINE, assert, au_fetch_class(), AU_FETCH_READ, classobj_make_template_like(), DB_AUTH_SELECT, DB_FETCH_READ, ER_ERROR_SEVERITY, ER_OBJ_NOT_A_CLASS, er_set(), is_class(), locator_is_class(), NO_ERROR, NULL, and SM_CLASS_CT.
Referenced by smt_copy_class().
SM_TEMPLATE* smt_def_class | ( | const char * | name | ) |
Definition at line 733 of file schema_template.c.
References def_class_internal(), and SM_CLASS_CT.
Referenced by classobj_make_template_like(), db_create_class(), and dbt_create_class().
SM_TEMPLATE* smt_def_typed_class | ( | const char * | name, |
SM_CLASS_TYPE | ct | ||
) |
Definition at line 4058 of file schema_template.c.
References def_class_internal().
Referenced by db_create_vclass(), and dbt_create_vclass().
int smt_delete_any | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
SM_NAME_SPACE | name_space | ||
) |
Definition at line 3137 of file schema_template.c.
References sm_template::attributes, check_alias_delete(), sm_template::class_attributes, sm_template::class_methods, classobj_free_attribute(), classobj_free_method(), ER_SM_ATTRIBUTE_NOT_FOUND, ER_SM_ATTRIBUTE_PRIMARY_KEY_MEMBER, ER_SM_INVALID_ARGUMENTS, error(), ERROR0, ERROR1, find_any(), find_method(), sm_attribute::flags, sm_attribute::header, ID_ATTRIBUTE, ID_CLASS, ID_CLASS_ATTRIBUTE, ID_CLASS_METHOD, ID_INSTANCE, ID_METHOD, ID_SHARED_ATTRIBUTE, sm_template::methods, sm_component::name_space, NO_ERROR, SM_ATTFLAG_PRIMARY_KEY, smt_delete_any(), smt_find_attribute(), and WS_LIST_REMOVE.
Referenced by dbt_drop_attribute(), dbt_drop_class_attribute(), dbt_drop_class_method(), dbt_drop_method(), dbt_drop_shared_attribute(), drop_internal(), and smt_delete_any().
int smt_delete_class_resolution | ( | SM_TEMPLATE * | template_, |
MOP | super_class, | ||
const char * | name | ||
) |
Definition at line 3936 of file schema_template.c.
References delete_resolution(), and ID_CLASS.
Referenced by db_drop_class_resolution(), and dbt_drop_class_resolution().
int smt_delete_resolution | ( | SM_TEMPLATE * | template_, |
MOP | super_class, | ||
const char * | name | ||
) |
Definition at line 3930 of file schema_template.c.
References delete_resolution(), and ID_INSTANCE.
Referenced by db_drop_resolution(), and dbt_drop_resolution().
int smt_delete_set_attribute_domain | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_attribute, | ||
const char * | domain_string, | ||
DB_DOMAIN * | domain | ||
) |
Definition at line 1273 of file schema_template.c.
References assert, sm_attribute::domain, ER_SM_DOMAIN_NOT_A_SET, ER_SM_DOMAIN_NOT_FOUND, error(), ERROR1, ERROR2, get_domain(), NO_ERROR, NULL, pr_is_set_type(), tp_domain::setdomain, smt_find_attribute(), tp_domain_drop(), and TP_DOMAIN_TYPE.
Referenced by db_drop_set_attribute_domain(), and dbt_drop_set_attribute_domain().
int smt_delete_super | ( | SM_TEMPLATE * | template_, |
MOP | super_class | ||
) |
Definition at line 3394 of file schema_template.c.
References ER_SM_SUPER_NOT_FOUND, error(), ERROR0, sm_template::inheritance, ml_remove(), and NO_ERROR.
Referenced by db_drop_super(), and dbt_drop_super().
int smt_delete_super_connect | ( | SM_TEMPLATE * | template_, |
MOP | super_class | ||
) |
Definition at line 3416 of file schema_template.c.
References au_fetch_class(), AU_FETCH_WRITE, AU_SELECT, ER_SM_SUPER_NOT_FOUND, error(), ERROR0, sm_class::inheritance, sm_template::inheritance, ml_append(), ml_remove(), db_objlist::next, NO_ERROR, NULL, and db_objlist::op.
Referenced by db_drop_super_connect(), and dbt_drop_super_connect().
int smt_drop_constraint | ( | SM_TEMPLATE * | template_, |
const char ** | att_names, | ||
const char * | constraint_name, | ||
int | class_attribute, | ||
SM_ATTRIBUTE_FLAG | constraint | ||
) |
Definition at line 1764 of file schema_template.c.
References assert, sm_template::attributes, classobj_find_cons_primary_key(), classobj_is_pk_referred(), sm_class::constraints, sm_template::current, er_errid(), ER_FK_CANT_DROP_PK_REFERRED, ER_SM_CONSTRAINT_NOT_FOUND, ER_SM_INHERITED, ER_SM_INVALID_ARGUMENTS, ER_SM_NOT_NULL_WRONG_NUM_ATTS, error(), ERROR0, ERROR1, ERROR2, sm_class_constraint::fk_info, sm_attribute::flags, sm_attribute::header, sm_class_constraint::name, sm_component::next, NO_ERROR, NULL, sm_template::op, sm_template::partition, SM_ATTFLAG_NON_NULL, SM_ATTFLAG_PRIMARY_KEY, sm_get_ch_name(), SM_IS_ATTFLAG_UNIQUE_FAMILY_OR_FOREIGN_KEY, smt_drop_constraint_from_property(), smt_find_attribute(), and smt_find_owner_of_constraint().
Referenced by dbt_drop_constraint(), and sm_drop_constraint().
|
static |
Definition at line 1484 of file schema_template.c.
References classobj_drop_prop(), classobj_get_prop(), classobj_put_prop(), db_get_set(), db_make_null(), db_make_sequence(), ER_SM_CONSTRAINT_NOT_FOUND, error(), ERROR1, NO_ERROR, NULL, pr_clear_value(), sm_template::properties, SM_IS_ATTFLAG_UNIQUE_FAMILY_OR_FOREIGN_KEY, and SM_MAP_CONSTRAINT_ATTFLAG_TO_PROPERTY.
Referenced by smt_drop_constraint().
int smt_drop_method_file | ( | SM_TEMPLATE * | template_, |
const char * | name | ||
) |
Definition at line 3506 of file schema_template.c.
References ARG_FILE_LINE, classobj_free_method_file(), er_set(), ER_SM_METHOD_FILE_NOT_FOUND, ER_WARNING_SEVERITY, error(), parser_context::file, sm_template::method_files, sm_method_file::name, sm_method_file::next, NO_ERROR, and NULL.
Referenced by db_drop_method_file(), and dbt_drop_method_file().
int smt_drop_query_spec | ( | SM_TEMPLATE * | def, |
const int | index | ||
) |
Definition at line 4006 of file schema_template.c.
References ARG_FILE_LINE, classobj_free_query_spec(), er_set(), ER_SM_QUERY_SPEC_NOT_FOUND, ER_WARNING_SEVERITY, error(), parser_context::file, i, sm_query_spec::next, NO_ERROR, NULL, and sm_template::query_spec.
Referenced by db_drop_query_spec(), and dbt_drop_query_spec().
SM_TEMPLATE* smt_edit_class_mop | ( | MOP | op, |
DB_AUTH | db_auth_type | ||
) |
Definition at line 751 of file schema_template.c.
References ARG_FILE_LINE, au_fetch_class(), AU_FETCH_WRITE, classobj_make_template(), DB_FETCH_WRITE, ER_OBJ_NOT_A_CLASS, er_set(), ER_WARNING_SEVERITY, is_class(), locator_is_class(), NO_ERROR, NULL, sm_check_name(), sm_clean_class(), sm_find_class(), sm_get_ch_name(), and smt_edit_class_mop().
Referenced by add_arg_domain(), add_method_internal(), au_add_method_check_authorization(), au_install(), boot_define_attribute(), boot_define_charsets(), boot_define_class(), boot_define_class_authorization(), boot_define_collations(), boot_define_data_type(), boot_define_domain(), boot_define_dual(), 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(), change_constraints_comment_partitioned_class(), change_constraints_status_partitioned_class(), db_add_attribute_internal(), db_add_class_resolution(), db_add_method_file(), db_add_query_spec(), db_add_resolution(), db_add_set_attribute_domain(), db_add_super_internal(), db_change_default(), db_change_method_implementation(), db_change_query_spec(), db_drop_class_resolution(), db_drop_method_file(), db_drop_method_files(), db_drop_query_spec(), db_drop_resolution(), db_drop_set_attribute_domain(), db_drop_super(), db_drop_super_connect(), db_rename_internal(), db_set_loader_commands(), dbt_edit_class(), do_alter_index_comment(), do_alter_index_rebuild(), do_alter_index_status(), drop_internal(), sm_add_constraint(), sm_drop_constraint(), smt_edit_class_mop(), smt_rename_any(), and update_fk_ref_partitioned_class().
int smt_find_attribute | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_attribute, | ||
SM_ATTRIBUTE ** | attp | ||
) |
Definition at line 140 of file schema_template.c.
References ASSERT_ERROR_AND_SET, classobj_find_attribute(), sm_template::current, ER_SM_ATTRIBUTE_NOT_FOUND, ER_SM_INHERITED_ATTRIBUTE, error(), ERROR1, ERROR2, NO_ERROR, NULL, sm_check_name(), SM_FIND_NAME_IN_COMPONENT_LIST, and sm_get_ch_name().
Referenced by build_attr_change_map(), dbt_drop_attribute(), do_add_attribute(), do_alter_change_col_comment(), do_check_fk_constraints_internal(), smt_add_constraint(), smt_add_set_attribute_domain(), smt_change_attribute(), smt_check_foreign_key(), smt_delete_any(), smt_delete_set_attribute_domain(), smt_drop_constraint(), smt_rename_any(), smt_set_attribute_default(), and smt_set_attribute_on_update().
|
static |
Definition at line 4704 of file schema_template.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR, au_fetch_class(), AU_FETCH_READ, AU_INDEX, classobj_find_constraint_by_name(), sm_class::constraints, ER_ERROR_SEVERITY, er_set(), ER_SM_CONSTRAINT_NOT_FOUND, NO_ERROR, NULL, and sm_template::op.
Referenced by change_constraints_comment_partitioned_class(), change_constraints_status_partitioned_class(), smt_change_constraint_comment(), smt_change_constraint_status(), and smt_is_change_status_allowed().
|
static |
Definition at line 4579 of file schema_template.c.
References sm_class::attributes, au_fetch_class_force(), AU_FETCH_READ, classobj_free_class_constraints(), classobj_make_class_constraints(), error(), sm_template::inheritance, sm_class_constraint::name, db_objlist::next, sm_class_constraint::next, NO_ERROR, NULL, db_objlist::op, sm_template::op, sm_class::properties, and SM_COMPARE_NAMES.
Referenced by smt_drop_constraint(), and smt_rename_any().
SM_CLASS_TYPE smt_get_class_type | ( | SM_TEMPLATE * | template_ | ) |
Definition at line 4070 of file schema_template.c.
Referenced by do_add_attribute(), and do_change_att_schema_only().
|
static |
Definition at line 4735 of file schema_template.c.
References ARG_FILE_LINE, ASSERT_ERROR_AND_SET, sm_template::current, DB_PARTITION_CLASS, ER_ERROR_SEVERITY, er_set(), ER_SM_INDEX_STATUS_CHANGE_NOT_ALLOWED, error(), sm_class_constraint::name, NO_ERROR, NULL, sm_template::op, sm_ch_name(), SM_CONSTRAINT_FOREIGN_KEY, SM_CONSTRAINT_NOT_NULL, SM_CONSTRAINT_PRIMARY_KEY, sm_partitioned_class_type(), smt_find_constraint(), and sm_class_constraint::type.
Referenced by smt_change_constraint_status().
int smt_quit | ( | SM_TEMPLATE * | template_ | ) |
Definition at line 897 of file schema_template.c.
References classobj_free_template(), error(), NO_ERROR, and NULL.
Referenced by add_arg_domain(), add_method_internal(), change_constraints_comment_partitioned_class(), change_constraints_status_partitioned_class(), db_add_attribute_internal(), db_add_class_resolution(), db_add_method_file(), db_add_query_spec(), db_add_resolution(), db_add_set_attribute_domain(), db_add_super_internal(), db_change_default(), db_change_method_implementation(), db_change_query_spec(), db_create_class(), db_create_vclass(), db_drop_class_resolution(), db_drop_method_file(), db_drop_method_files(), db_drop_query_spec(), db_drop_resolution(), db_drop_set_attribute_domain(), db_drop_super(), db_drop_super_connect(), db_rename_internal(), db_set_loader_commands(), dbt_abort_class(), dbt_reserve_name(), do_alter_index_comment(), do_alter_index_rebuild(), do_alter_index_status(), drop_internal(), sm_add_constraint(), sm_drop_constraint(), smt_rename_any(), and update_fk_ref_partitioned_class().
int smt_rename_any | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
const bool | class_namespace, | ||
const char * | new_name | ||
) |
Definition at line 2561 of file schema_template.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, sm_template::attributes, AU_INDEX, check_namespace(), classobj_find_constraint_by_name(), classobj_free_class_constraints(), classobj_make_class_constraints(), classobj_map_constraint_to_property(), db_constraint_type(), DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, er_errid(), ER_ERROR_SEVERITY, ER_NOT_ALLOWED_ACCESS_TO_PARTITION, ER_REGU_NOT_IMPLEMENTED, er_set(), ER_SM_CONSTRAINT_HAS_DIFFERENT_TYPE, ER_SM_CONSTRAINT_NOT_FOUND, ER_SM_INDEX_EXISTS, ER_SM_INHERITED, error(), ERROR1, ERROR2, find_any(), sm_class_constraint::fk_info, free_and_init, i, ID_ATTRIBUTE, ID_CLASS_ATTRIBUTE, ID_SHARED_ATTRIBUTE, sm_class_constraint::index_btid, is_global, sm_component::name, sm_class_constraint::name, sm_template::name, sm_component::name_space, NO_ERROR, NULL, sm_template::op, sm_template::properties, sm_foreign_key_info::ref_class_oid, rel_major_release_string(), sm_check_name(), SM_CONSTRAINT_FOREIGN_KEY, SM_CONSTRAINT_NAME, sm_downcase_name(), sm_exist_index(), sm_get_ch_name(), SM_INDEX_NAME, SM_IS_CONSTRAINT_EXCEPT_INDEX_FAMILY, sm_is_global_only_constraint(), SM_IS_INDEX_FAMILY, SM_MAX_IDENTIFIER_LENGTH, sm_partitioned_class_type(), sm_produce_constraint_name(), sm_update_class(), smt_edit_class_mop(), smt_find_attribute(), smt_find_owner_of_constraint(), smt_quit(), sm_class_constraint::type, ws_copy_string(), ws_free_string(), and ws_mop().
Referenced by db_rename_internal(), and dbt_rename().
int smt_rename_method_file | ( | SM_TEMPLATE * | template_, |
const char * | old_name, | ||
const char * | new_name | ||
) |
Definition at line 3553 of file schema_template.c.
References ARG_FILE_LINE, assert, er_errid(), er_set(), ER_SM_METHOD_FILE_NOT_FOUND, ER_WARNING_SEVERITY, error(), parser_context::file, sm_template::method_files, sm_method_file::name, sm_method_file::next, NO_ERROR, NULL, ws_copy_string(), and ws_free_string().
Referenced by dbt_rename_method_file().
int smt_reset_method_files | ( | SM_TEMPLATE * | template_ | ) |
Definition at line 3488 of file schema_template.c.
References classobj_free_method_file(), error(), sm_template::method_files, NO_ERROR, NULL, and WS_LIST_FREE.
Referenced by db_drop_method_files(), and dbt_drop_method_files().
int smt_reset_query_spec | ( | SM_TEMPLATE * | template_ | ) |
Definition at line 3988 of file schema_template.c.
References classobj_free_query_spec(), error(), NO_ERROR, NULL, sm_template::query_spec, and WS_LIST_FREE.
Referenced by dbt_reset_query_spec().
int smt_set_attribute_default | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_attribute, | ||
DB_VALUE * | proposed_value, | ||
DB_DEFAULT_EXPR * | default_expr | ||
) |
Definition at line 1319 of file schema_template.c.
References assert, classobj_copy_default_expr(), classobj_initialize_default_expr(), DB_DEFAULT_NONE, DB_IS_NULL, DB_TYPE_BLOB, DB_TYPE_CLOB, sm_default_value::default_expr, db_default_expr::default_expr_type, sm_attribute::default_value, sm_attribute::domain, DOMAIN_COMPATIBLE, ER_CANNOT_HAVE_PK_DEFAULT_NULL, er_errid(), ER_OBJ_DOMAIN_CONFLICT, ER_OBJ_STRING_OVERFLOW, ER_SM_DEFAULT_NOT_ALLOWED, error(), ERROR1, ERROR2, sm_attribute::flags, sm_attribute::header, pr_type::id, pr_type::name, sm_component::name, NO_ERROR, NULL, pr_clear_value(), pr_clone_value(), pr_free_ext_value(), pr_make_ext_value(), tp_domain::precision, SM_ATTFLAG_NEW, SM_ATTFLAG_PRIMARY_KEY, sm_downcase_name(), SM_MAX_IDENTIFIER_LENGTH, smt_find_attribute(), smt_set_attribute_orig_default_value(), tp_check_value_size(), tp_domain_check(), TP_EXACT_MATCH, tp_value_cast(), sm_attribute::type, and sm_default_value::value.
Referenced by boot_define_index_key(), boot_define_serial(), db_add_attribute_internal(), db_change_default(), dbt_change_default(), do_alter_one_clause_with_template(), smt_add_attribute_w_dflt_w_order(), and smt_change_attribute_w_dflt_w_order().
int smt_set_attribute_on_update | ( | SM_TEMPLATE * | template_, |
const char * | name, | ||
int | class_attribute, | ||
DB_DEFAULT_EXPR_TYPE | on_update | ||
) |
Definition at line 1458 of file schema_template.c.
References error(), NO_ERROR, sm_attribute::on_update_default_expr, and smt_find_attribute().
Referenced by smt_add_attribute_w_dflt_w_order(), and smt_change_attribute_w_dflt_w_order().
|
static |
Definition at line 1431 of file schema_template.c.
References assert, classobj_copy_default_expr(), classobj_initialize_default_expr(), sm_default_value::default_expr, sm_attribute::default_value, NO_ERROR, NULL, sm_default_value::original_value, pr_clear_value(), and pr_clone_value().
Referenced by smt_change_attribute_w_dflt_w_order(), and smt_set_attribute_default().
int smt_set_loader_commands | ( | SM_TEMPLATE * | template_, |
const char * | commands | ||
) |
Definition at line 3601 of file schema_template.c.
References sm_template::loader_commands, NO_ERROR, ws_copy_string(), and ws_free_string().
Referenced by db_set_loader_commands(), and dbt_set_loader_commands().