55 #define DOWNCASE_NAME(a, b) \ 57 sm_downcase_name(a, b, SM_MAX_IDENTIFIER_LENGTH); \ 59 a = ws_copy_string(b); \ 77 const char *constraint_name,
SM_ATTRIBUTE ** atts,
const int *asc_desc,
96 const char *add_after_attribute);
99 const bool change_first,
const char *change_after_attribute,
102 const char *change_after_attribute);
106 #if defined (ENABLE_RENAME_CONSTRAINT) 110 static int rename_constraints_partitioned_class (
SM_TEMPLATE * ctemplate,
const char *old_name,
const char *new_name,
153 attr_list = class_attribute ?
template_->class_attributes :
template_->attributes;
210 method_list = (class_method ?
template_->class_methods :
template_->methods);
214 if (*methodp !=
NULL)
228 if (*methodp !=
NULL)
263 attr_list = (class_stuff ?
template_->class_attributes :
template_->attributes);
271 method_list = (class_stuff ?
template_->class_methods :
template_->methods);
382 error =
find_method (template_, name, class_method, &method);
428 error =
find_signature (template_, name, class_method, signame, methodp, &sig);
434 if (arg ==
NULL && create)
442 if (create && (index > sig->
num_args))
451 if (arg ==
NULL && create)
529 for (res = reslist, found =
NULL; res !=
NULL && found ==
NULL; res = res->
next)
568 tmp_domain = tmp_domain->
next;
603 if (domain_string ==
NULL)
609 if (domain_string[0] ==
'*')
715 if (template_ !=
NULL)
784 #if defined(ENABLE_UNUSED_FUNCTION) 794 smt_edit_class (
const char *name)
901 if (template_ !=
NULL)
937 error =
smt_add_attribute_any (def, name, domain_string, domain, name_space, add_first, add_after_attribute, comment);
943 if (default_value !=
NULL)
952 if (on_update !=
NULL)
979 default_expr, on_update, comment);
1003 const SM_NAME_SPACE name_space,
const bool add_first,
const char *add_after_attribute,
1004 const char *comment)
1009 bool class_namespace =
false;
1020 att_list = &
template_->attributes;
1021 class_namespace =
false;
1026 att_list = &
template_->class_attributes;
1027 class_namespace =
true;
1045 if (add_after_attribute !=
NULL)
1048 add_after_attribute = add_after_attribute_real_name;
1057 error_code =
get_domain (template_, domain_string, &domain);
1124 const char *add_after_attribute)
1139 if (add_after_attribute ==
NULL)
1152 if (crt_att ==
NULL)
1217 error =
get_domain (template_, domain_string, &domain);
1274 const char *domain_string,
DB_DOMAIN * domain)
1288 error =
get_domain (template_, domain_string, &domain);
1340 else if (proposed_value &&
DB_IS_NULL (proposed_value)
1348 value = proposed_value;
1381 if (default_expr ==
NULL)
1403 if (value != proposed_value)
1439 if (default_expr ==
NULL)
1489 const char *prop_type;
1542 SM_ATTRIBUTE ** atts,
const int *asc_desc,
const int *attr_prefix_length,
1562 filter_index, fk_info, shared_cons_name, function_index, comment, index_status,
true)
1592 int n_ref_atts,
i, j;
1594 const char *tmp, *ref_cls_name =
NULL;
1613 ref_cls_name =
template_->name;
1619 if (ref_clsop ==
NULL)
1664 if (n_ref_atts != n_atts)
1679 if (template_->
op ==
NULL && temp_cons)
1690 if (ref_attr ==
NULL)
1742 fk_info->
name = (
char *) constraint_name;
1781 char *fk_name =
NULL;
1793 if (att_names !=
NULL)
1795 while (att_names[n_atts] !=
NULL)
1840 error =
smt_find_attribute (template_, att_names[0], class_attribute, ¬_null_attr[0]);
1844 if (not_null_attr[0]->flags & constraint)
1846 not_null_attr[0]->
flags &= ~constraint;
1873 const char *constraint_name,
const char **att_names,
const int *asc_desc,
1886 if (template_->
op !=
NULL)
1904 temp_cons = check_cons;
1909 att_names, asc_desc, filter_index, function_index);
1911 if (temp_cons !=
NULL)
1937 const char **att_names,
const int *asc_desc,
const int *attrs_prefix_length,
int class_attribute,
1943 int i, j, n_atts, atts_size;
1944 char *shared_cons_name =
NULL;
1946 bool has_nulls =
false;
1947 bool is_secondary_index =
false;
1951 error =
smt_check_index_exist (template_, &shared_cons_name, constraint_type, constraint_name, att_names,
1952 asc_desc, filter_index, function_index);
1962 if (att_names !=
NULL)
1964 while (att_names[n_atts] !=
NULL)
1983 for (i = 0; att_names[
i] !=
NULL; i++)
2001 atts_size = (n_atts + 1) * (
int)
sizeof (
SM_ATTRIBUTE *);
2011 for (i = 0; i < n_atts && error ==
NO_ERROR; i++)
2016 if (is_secondary_index)
2025 #if defined (ENABLE_UNUSED_FUNCTION) 2029 if (sm_has_text_domain (atts[i], 0))
2047 for (i = 0; i < n_atts && error ==
NO_ERROR; i++)
2049 for (j = i + 1; j < n_atts; j++)
2064 if (is_secondary_index)
2066 for (i = 0; atts[
i] !=
NULL; i++)
2076 else if (attrs_prefix_length && attrs_prefix_length[i] >= 0)
2084 else if (((
long) atts[i]->domain->precision) < attrs_prefix_length[i])
2115 for (i = 0; i < n_atts; i++)
2162 constraint_name, atts, asc_desc, attrs_prefix_length, fk_info,
2163 shared_cons_name, filter_index, function_index, comment, index_status);
2171 for (i = 0; i < n_atts; i++)
2204 if (atts[0]->flags & constraint)
2210 atts[0]->
flags |= constraint;
2226 if (shared_cons_name !=
NULL)
2275 methlist = &
template_->class_methods;
2280 methlist = &
template_->methods;
2289 if (methlist !=
NULL)
2314 if (
function !=
NULL)
2316 sprintf (iname,
"%s",
function);
2322 sprintf (iname,
"%s_%s", template_->
name, name);
2324 else if (template_->
op !=
NULL)
2331 sprintf (iname,
"%s_%s",
"unknown_class", name);
2397 const char *current;
2399 method_list = (class_method ?
template_->class_methods :
template_->methods);
2461 error =
find_argument (template_, name, class_method, implementation, index,
true, &method, &sig, &arg);
2467 if (domain_string ==
NULL && domain ==
NULL)
2474 error =
get_domain (template_, domain_string, &domain);
2517 error =
get_domain (template_, domain_string, &domain);
2529 error =
find_argument (template_, name, class_method, implementation, index,
false, &method, &sig, &arg);
2574 new_name = real_new_name;
2577 error =
find_any (template_, name, class_namespace, &comp);
2587 #if defined (ENABLE_UNUSED_FUNCTION) 2591 if (sm_has_text_domain (att, 0))
2624 #if defined (ENABLE_RENAME_CONSTRAINT) 2643 const char *property_type =
NULL;
2644 char *norm_new_name =
NULL;
2652 if (sm_constraint ==
NULL)
2660 switch (element_type)
2688 if (norm_new_name ==
NULL)
2706 error = classobj_rename_constraint (ctemplate->
properties, property_type, old_name, norm_new_name);
2716 if (ctemplate->
op == ref_clsop)
2719 error = classobj_rename_foreign_key_ref (&(ctemplate->
properties), btid, old_name, new_name);
2725 error = sm_rename_foreign_key_ref (ref_clsop, btid, old_name, new_name);
2755 rename_constraints_partitioned_class (
SM_TEMPLATE * ctemplate,
const char *old_name,
const char *new_name,
2759 int i, is_partition = 0;
2785 for (i = 0; sub_partitions[
i]; i++)
2793 if (sub_ctemplate ==
NULL)
2808 if (sm_cons ==
NULL)
2815 error = rename_constraint (sub_ctemplate, sm_cons, old_name, new_name, element_type);
2832 sub_ctemplate =
NULL;
2838 if (sub_partitions !=
NULL)
2849 if (sub_ctemplate !=
NULL)
2868 smt_rename_constraint (
SM_TEMPLATE * ctemplate,
const char *old_name,
const char *new_name,
2887 if (owner != ctemplate->
op)
2900 if (sm_cons ==
NULL)
2908 if (sm_constraint ==
NULL)
2924 error = rename_constraints_partitioned_class (ctemplate, old_name, new_name, element_type);
2931 error = rename_constraint (ctemplate, sm_cons, old_name, new_name, element_type);
2963 int i, is_partition = 0;
2987 for (i = 0; sub_partitions[
i]; i++)
2990 if (ctemplate ==
NULL)
3021 if (sub_partitions !=
NULL)
3028 if (ctemplate !=
NULL)
3103 reslist = &
template_->resolutions;
3107 reslist = &
template_->class_resolutions;
3110 res =
find_alias (*reslist, name, name_space);
3207 error =
find_method (template_, name,
false, &method);
3220 error =
find_method (template_, name,
true, &method);
3234 error =
find_any (template_, name,
false, &thing);
3265 error =
find_any (template_, name,
true, &thing);
3295 #if defined(ENABLE_UNUSED_FUNCTION) 3306 smt_delete (
SM_TEMPLATE * template_,
const char *name)
3312 smt_class_delete (
SM_TEMPLATE * template_,
const char *name)
3338 else if ((template_->
op !=
NULL) && (template_->
op == super_class))
3493 template_->method_files =
NULL;
3513 if (strcmp (file->
name, name) == 0)
3532 template_->method_files = found->
next;
3560 if (strcmp (file->
name, old_name) == 0)
3632 return ((thing ==
NULL) ? 0 : 1);
3660 class_stuff = (rspace ==
ID_CLASS) ? 1 : 0;
3748 reslist = &
template_->resolutions;
3752 reslist = &
template_->class_resolutions;
3759 for (res = *reslist; res !=
NULL; res = res->
next)
3787 else if (prev_alias !=
NULL)
3817 if (prev_alias ==
NULL)
3840 if (prev_alias !=
NULL)
3873 reslist = &
template_->resolutions;
3877 reslist = &
template_->class_resolutions;
3958 if (query_spec ==
NULL)
3965 ct =
template_->class_type;
3993 template_->query_spec =
NULL;
4028 sprintf (indexname,
"%d", index);
4072 return template_->class_type;
4119 sprintf (indexname,
"%d", index);
4151 #if defined(ENABLE_UNUSED_FUNCTION) 4158 smt_downcase_all_class_info (
void)
4172 for (c = 0; c < lmops->
num; c++)
4234 const char *change_after_attribute,
SM_ATTRIBUTE ** found_att)
4247 att_list = &
template_->class_attributes;
4251 att_list = &
template_->attributes;
4263 if (new_name !=
NULL)
4266 new_name = real_new_name;
4276 if (change_after_attribute !=
NULL)
4279 change_after_attribute = change_after_attribute_real_name;
4282 if (new_name !=
NULL)
4291 error_code =
get_domain (template_, new_domain_string, &new_domain);
4297 if (new_domain ==
NULL)
4337 att->
domain = new_domain;
4340 if (new_name !=
NULL)
4358 if (change_first || change_after_attribute !=
NULL)
4388 const char *new_domain_string,
DB_DOMAIN * new_domain,
4391 const bool change_first,
const char *change_after_attribute,
4401 error =
smt_change_attribute (def, name, new_name, new_domain_string, new_domain, name_space, change_first,
4402 change_after_attribute, found_att);
4407 if (*found_att ==
NULL)
4441 orig_value = &((*found_att)->default_value.original_value);
4489 const char *change_after_attribute)
4494 assert ((change_first && change_after_attribute ==
NULL) || (!change_first && change_after_attribute !=
NULL));
4549 cast_status =
tp_value_cast (current_value, new_value, new_domain,
false);
4556 att->
domain = new_domain;
4589 return ctemplate->
op;
4606 for (cons = super_cons; cons !=
NULL; cons = cons->
next)
4617 if (super_cons !=
NULL)
4624 return ctemplate->
op;
4631 int i, is_partition = 0;
4655 for (i = 0; sub_partitions[
i]; i++)
4658 if (ctemplate ==
NULL)
4688 if (sub_partitions !=
NULL)
4695 if (ctemplate !=
NULL)
4718 if (cons_list ==
NULL)
4747 "local index on a partition");
4752 if (constraint ==
NULL)
4758 switch (constraint->
type)
4775 "NOT NULL constraint");
static int check_namespace(SM_TEMPLATE *temp, const char *name, const bool class_namespace)
#define ER_SM_INCOMPATIBLE_SUPER_CLASS
#define ER_SM_ATTRIBUTE_NOT_FOUND
int ml_append(DB_OBJLIST **list, MOP mop, int *added_ptr)
static MOP smt_find_owner_of_constraint(SM_TEMPLATE *ctemplate, const char *constraint_name)
int db_value_coerce(const DB_VALUE *src, DB_VALUE *dest, const DB_DOMAIN *desired_domain)
#define SM_MAP_CONSTRAINT_ATTFLAG_TO_PROPERTY(c)
#define ER_FK_HAS_DEFFERENT_TYPE_WITH_PK
int smt_set_loader_commands(SM_TEMPLATE *template_, const char *commands)
int smt_add_super(SM_TEMPLATE *template_, MOP super_class)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
#define SM_IS_CONSTRAINT_EXCEPT_INDEX_FAMILY(c)
#define ER_SM_RESOLUTION_COMPONENT_EXISTS
TP_DOMAIN_STATUS tp_domain_check(const TP_DOMAIN *domain, const DB_VALUE *value, TP_MATCH exact_match)
#define WS_LIST_FREE(lst, func)
void classobj_free_query_spec(SM_QUERY_SPEC *query_spec)
#define SM_MAP_CONSTRAINT_TO_ATTFLAG(c)
SM_FOREIGN_KEY_INFO * fk_info
#define ER_SM_QUERY_SPEC_NOT_FOUND
static int smt_add_attribute_to_list(SM_ATTRIBUTE **att_list, SM_ATTRIBUTE *att, const bool add_first, const char *add_after_attribute)
#define ER_SM_DEFAULT_NOT_ALLOWED
void classobj_free_method(SM_METHOD *meth)
const char * db_get_class_name(DB_OBJECT *class_)
#define ER_SM_ATTR_NOT_NULL
MOP ws_mop(const OID *oid, MOP class_mop)
int smt_delete_any(SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE name_space)
int smt_quit(SM_TEMPLATE *template_)
int smt_rename_method_file(SM_TEMPLATE *template_, const char *old_name, const char *new_name)
#define ER_SM_INVALID_ARGUMENTS
int classobj_put_index(DB_SEQ **properties, SM_CONSTRAINT_TYPE type, const char *constraint_name, SM_ATTRIBUTE **atts, const int *asc_desc, const int *attr_prefix_length, const BTID *id, SM_PREDICATE_INFO *filter_index_info, SM_FOREIGN_KEY_INFO *fk_info, char *shared_cons_name, SM_FUNCTION_INFO *func_index_info, const char *comment, SM_INDEX_STATUS index_status, bool attr_name_instead_of_id)
static int find_method(SM_TEMPLATE *template_, const char *name, int class_method, SM_METHOD **methodp)
int db_is_vclass(DB_OBJECT *op)
SM_METHOD * class_methods
SM_CLASS_CONSTRAINT * classobj_find_class_primary_key(SM_CLASS *class_)
int smt_drop_method_file(SM_TEMPLATE *template_, const char *name)
SM_CLASS_CONSTRAINT * classobj_find_cons_primary_key(SM_CLASS_CONSTRAINT *cons_list)
int tp_domain_drop(TP_DOMAIN **dlist, TP_DOMAIN *domain)
#define DOWNCASE_NAME(a, b)
struct tp_domain * setdomain
#define SM_MAP_INDEX_ATTFLAG_TO_CONSTRAINT(c)
int classobj_get_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
static int smt_drop_constraint_from_property(SM_TEMPLATE *template_, const char *constraint_name, SM_ATTRIBUTE_FLAG constraint)
static int change_constraints_comment_partitioned_class(MOP obj, const char *index_name, const char *comment)
int classobj_copy_default_expr(DB_DEFAULT_EXPR *dest, const DB_DEFAULT_EXPR *src)
SM_ATTRIBUTE * attributes
SM_COMPONENT * classobj_find_component(SM_CLASS *class_, const char *name, int class_component)
#define ASSERT_ERROR_AND_SET(error_code)
SM_RESOLUTION * resolutions
int classobj_change_constraint_status(DB_SEQ *properties, SM_CLASS_CONSTRAINT *cons, SM_INDEX_STATUS index_status)
void classobj_free_template(SM_TEMPLATE *template_ptr)
#define SM_MAX_IDENTIFIER_LENGTH
#define ER_SM_DOMAIN_NOT_A_CLASS
static int class_type(DB_OBJECT *class_obj)
#define ER_SM_CONSTRAINT_HAS_DIFFERENT_TYPE
static int find_any(SM_TEMPLATE *template_, const char *name, int class_stuff, SM_COMPONENT **thing)
static int smt_is_change_status_allowed(SM_TEMPLATE *ctemplate, const char *index_name)
SM_DEFAULT_VALUE default_value
#define ER_SM_SIGNATURE_NOT_FOUND
int smt_delete_set_attribute_domain(SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain)
SM_CLASS_CONSTRAINT * classobj_find_constraint_by_name(SM_CLASS_CONSTRAINT *cons_list, const char *name)
struct sm_component * next
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)
#define OID_SET_NULL(oidp)
void sm_downcase_name(const char *name, char *buf, int maxlen)
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)
#define ER_CANNOT_HAVE_PK_DEFAULT_NULL
#define ER_SM_SUPER_NOT_FOUND
int db_make_sequence(DB_VALUE *value, DB_C_SET *set)
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)
TP_DOMAIN * tp_domain_copy(const TP_DOMAIN *domain, bool check_cache)
SM_ATTRIBUTE * classobj_find_attribute(SM_CLASS *class_, const char *name, int class_attribute)
SM_METHOD_ARGUMENT * value
#define ER_SM_ATTMETH_NOT_FOUND
struct sm_class_constraint * next
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)
#define ER_SM_INCOMPATIBLE_DOMAIN_CLASS_TYPE
#define ER_SM_CONSTRAINT_NOT_FOUND
static int get_domain_internal(SM_TEMPLATE *tmp, const char *domain_string, DB_DOMAIN **domainp, int check_internal)
#define ER_SM_SIGNATURE_EXISTS
static int find_signature(SM_TEMPLATE *template_, const char *name, int class_method, const char *signame, SM_METHOD **methodp, SM_METHOD_SIGNATURE **sigp)
void locator_free_list_mops(LIST_MOPS *mops)
enum tp_domain_status TP_DOMAIN_STATUS
LIST_MOPS * locator_get_all_mops(MOP class_mop, DB_FETCH_MODE purpose, LC_FETCH_VERSION_TYPE *force_fetch_version_type)
SM_METHOD_ARGUMENT * classobj_make_method_arg(int index)
void db_ws_free(void *ptr)
int ml_find(DB_OBJLIST *list, MOP mop)
#define ER_SM_NOT_NULL_ON_VCLASS
#define ER_SM_SUPER_CAUSES_CYCLES
void ws_free_string(const char *str)
int smt_reset_query_spec(SM_TEMPLATE *template_)
#define ER_FK_REF_CLASS_HAS_NOT_PK
#define ER_SM_MULTIPLE_SIGNATURES
#define ERROR0(error, code)
int smt_add_method_any(SM_TEMPLATE *template_, const char *name, const char *function, SM_NAME_SPACE name_space)
int smt_reset_method_files(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)
#define ER_SM_DOMAIN_NOT_FOUND
int smt_delete_super_connect(SM_TEMPLATE *template_, MOP super_class)
DB_DEFAULT_EXPR_TYPE default_expr_type
int smt_change_constraint_comment(SM_TEMPLATE *ctemplate, const char *index_name, const char *comment)
static DB_OBJECT * is_class(OID *obj_oid, OID *class_oid)
int pr_free_ext_value(DB_VALUE *value)
MOBJ locator_fetch_class(MOP class_mop, DB_FETCH_MODE purpose)
#define ER_SM_NOT_NULL_WRONG_NUM_ATTS
bool pr_is_set_type(DB_TYPE type)
const char TEXT_CONSTRAINT_PREFIX[]
DB_DEFAULT_EXPR default_expr
#define ER_SM_NOT_NULL_NOT_ALLOWED
#define ER_SM_CONSTRAINT_EXISTS
static int smt_change_class_shared_attribute_domain(SM_ATTRIBUTE *att, DB_DOMAIN *new_domain)
void classobj_initialize_default_expr(DB_DEFAULT_EXPR *default_expr)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
bool classobj_is_pk_referred(MOP clsop, SM_FOREIGN_KEY_INFO *fk_info, bool include_self_ref, char **fk_name)
#define ER_SM_ATTRIBUTE_PRIMARY_KEY_MEMBER
const char * sm_ch_name(const MOBJ clobj)
int smt_delete_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name)
SM_METHOD_SIGNATURE * classobj_make_method_signature(const char *name)
int smt_drop_query_spec(SM_TEMPLATE *def, const int index)
#define ER_SM_METHOD_NOT_FOUND
int classobj_change_constraint_comment(DB_SEQ *properties, SM_CLASS_CONSTRAINT *cons, const char *comment)
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)
int smt_change_constraint_status(SM_TEMPLATE *ctemplate, const char *index_name, SM_INDEX_STATUS index_status)
#define ER_SM_RESOLUTION_NOT_FOUND
#define ER_SM_METHOD_FILE_NOT_FOUND
int au_fetch_class(MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
#define ERROR1(error, code, arg1)
int sm_clean_class(MOP classmop, SM_CLASS *class_)
#define ER_FK_CANT_ON_SHARED_ATTRIBUTE
#define ER_OUT_OF_VIRTUAL_MEMORY
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)
struct sm_query_spec * next
static int get_domain(SM_TEMPLATE *tmp, const char *domain_string, DB_DOMAIN **domain)
#define ER_SM_INHERITED_METHOD
SM_QUERY_SPEC * classobj_make_query_spec(const char *specification)
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)
SM_ATTRIBUTE * class_attributes
void classobj_free_method_file(SM_METHOD_FILE *file)
SM_TEMPLATE * smt_copy_class(const char *new_name, const char *existing_name, SM_CLASS **class_)
int intl_identifier_casecmp(const char *str1, const char *str2)
int classobj_make_class_constraints(DB_SET *class_props, SM_ATTRIBUTE *attributes, SM_CLASS_CONSTRAINT **con_ptr)
static int check_resolution_name(MOP classmop, const char *name, int class_name)
#define TP_DOMAIN_COLLATION(dom)
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)
#define ER_SM_INVALID_UNIQUE_TYPE
SM_QUERY_SPEC * query_spec
#define ER_SM_INVALID_PREFIX_LENGTH
const char * sm_get_ch_name(MOP op)
static SM_TEMPLATE * def_class_internal(const char *name, int class_type)
void classobj_free_attribute(SM_ATTRIBUTE *att)
int smt_change_query_spec(SM_TEMPLATE *def, const char *query, const int index)
const char * function_name
TP_DOMAIN_STATUS tp_value_cast(const DB_VALUE *src, DB_VALUE *dest, const TP_DOMAIN *desired_domain, bool implicit_coercion)
#define TP_DOMAIN_TYPE(dom)
static int smt_change_attribute_pos_in_list(SM_ATTRIBUTE **att_list, SM_ATTRIBUTE *att, const bool change_first, const char *change_after_attribute)
#define ER_SM_INDEX_ATTR_DUPLICATED
int tp_valid_indextype(DB_TYPE type)
SM_METHOD_SIGNATURE * signatures
const char * pr_type_name(DB_TYPE id)
#define ER_REGU_NOT_IMPLEMENTED
int sm_check_name(const char *name)
#define BTID_SET_NULL(btid)
DB_VALUE * pr_make_ext_value(void)
SM_TEMPLATE * smt_copy_class_mop(const char *name, MOP op, SM_CLASS **class_)
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
int ml_remove(DB_OBJLIST **list, MOP mop)
static int delete_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name, SM_NAME_SPACE name_space)
const char * loader_commands
SM_METHOD * classobj_make_method(const char *name, SM_NAME_SPACE name_space)
SM_ATTRIBUTE * classobj_make_attribute(const char *name, struct pr_type *type, SM_NAME_SPACE name_space)
SM_TEMPLATE * smt_edit_class_mop(MOP op, DB_AUTH db_auth_type)
int smt_add_method(SM_TEMPLATE *template_, const char *name, const char *function)
int smt_add_set_attribute_domain(SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain)
int smt_add_class_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias)
int tp_domain_add(TP_DOMAIN **dlist, TP_DOMAIN *domain)
SM_ATTRIBUTE * class_attributes
int sm_exist_index(MOP classop, const char *idxname, BTID *btid)
const char * classobj_map_constraint_to_property(SM_CONSTRAINT_TYPE constraint)
DB_DOMAIN * pt_string_to_db_domain(const char *s, const char *class_name)
int pr_clear_value(DB_VALUE *value)
static int resolve_class_domain(SM_TEMPLATE *tmp, DB_DOMAIN *domain)
#define ER_FK_CANT_DROP_PK_REFERRED
static int check_alias_delete(SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE name_space, int error)
SM_METHOD * class_methods
TP_DOMAIN_STATUS tp_check_value_size(TP_DOMAIN *domain, DB_VALUE *value)
#define WS_LIST_APPEND(lst, element)
#define WS_LIST_NCONC(lst1, lst2)
SM_CLASS_CONSTRAINT * constraints
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)
void classobj_free_class_constraints(SM_CLASS_CONSTRAINT *constraints)
#define TP_IS_CHAR_TYPE(typeid)
static void error(const char *msg)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
void classobj_free_resolution(SM_RESOLUTION *res)
SM_TEMPLATE * classobj_make_template(const char *name, MOP op, SM_CLASS *class_)
int sm_is_global_only_constraint(MOP classmop, SM_CLASS_CONSTRAINT *constraint, int *is_global, SM_TEMPLATE *template_)
TP_DOMAIN * tp_domain_construct(DB_TYPE domain_type, DB_OBJECT *class_obj, int precision, int scale, TP_DOMAIN *setdomain)
struct sm_method_signature * next
int smt_delete_class_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name)
#define WS_LIST_REMOVE(lst, element)
SM_TEMPLATE * classobj_make_template_like(const char *name, SM_CLASS *class_)
#define ER_FK_NOT_MATCH_KEY_COUNT
#define TP_TYPE_HAS_COLLATION(typeid)
PR_TYPE * pr_find_type(const char *name)
#define SM_IS_INDEX_FAMILY(c)
#define ER_FK_UNKNOWN_REF_CLASSNAME
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)
SM_METHOD_FILE * method_files
int sm_partitioned_class_type(DB_OBJECT *classop, int *partition_type, char *keyattr, MOP **partitions)
int pr_clone_value(const DB_VALUE *src, DB_VALUE *dest)
#define NLIST_FIND(lst, name)
char * sm_produce_constraint_name(const char *class_name, DB_CONSTRAINT_TYPE constraint_type, const char **att_names, const int *asc_desc, const char *given_name)
SM_METHOD_FILE * classobj_make_method_file(const char *name)
static int check_local_definition(SM_TEMPLATE *template_, const char *name, const char *alias, SM_NAME_SPACE name_space)
#define ER_FK_NOT_HAVE_PK_MEMBER
static SM_CLASS_CONSTRAINT * smt_find_constraint(SM_TEMPLATE *ctemplate, const char *constraint_name)
static int check_domain_class_type(SM_TEMPLATE *template_, DB_OBJECT *domain_classobj)
#define free_and_init(ptr)
#define ER_SM_CLASS_WITH_PRIM_NAME
int smt_change_method_implementation(SM_TEMPLATE *template_, const char *name, int class_method, const char *function)
#define ER_SM_NAME_RESERVED_BY_ATT
int classobj_check_index_exist(SM_CLASS_CONSTRAINT *constraints, char **out_shared_cons_name, const char *class_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 *func_index_info)
DB_CONSTRAINT_TYPE db_constraint_type(const DB_CONSTRAINT *constraint)
#define ER_SM_INVALID_INDEX_TYPE
#define ERROR2(error, code, arg1, arg2)
int smt_drop_constraint(SM_TEMPLATE *template_, const char **att_names, const char *constraint_name, int class_attribute, SM_ATTRIBUTE_FLAG constraint)
#define ER_OBJ_INVALID_ARGUMENTS
#define ER_SM_DOMAIN_NOT_A_SET
SM_RESOLUTION * classobj_make_resolution(MOP class_mop, const char *name, const char *alias, SM_NAME_SPACE name_space)
#define ER_SM_INHERITED_ATTRIBUTE
SM_TEMPLATE * smt_def_class(const char *name)
SM_ATTRIBUTE ** attributes
int smt_add_query_spec(SM_TEMPLATE *template_, const char *specification)
#define ER_SM_SUPER_CLASS_EXISTS
SM_METHOD_ARGUMENT * args
#define ER_OBJ_STRING_OVERFLOW
#define ER_SM_INDEX_STATUS_CHANGE_NOT_ALLOWED
#define ER_QPROC_INVALID_COLNAME
int db_make_null(DB_VALUE *value)
static SM_COMPONENT * find_component(SM_TEMPLATE *template_, const char *name, int class_stuff)
int smt_add_method_file(SM_TEMPLATE *template_, const char *filename)
#define DB_IS_NULL(value)
SM_TEMPLATE * smt_def_typed_class(const char *name, SM_CLASS_TYPE ct)
#define ER_OBJ_DOMAIN_CONFLICT
int smt_add_attribute(SM_TEMPLATE *template_, const char *name, const char *domain_string, DB_DOMAIN *domain)
#define ER_NOT_ALLOWED_ACCESS_TO_PARTITION
#define ER_SM_INVALID_CONSTRAINT
int smt_set_attribute_on_update(SM_TEMPLATE *template_, const char *name, int class_attribute, DB_DEFAULT_EXPR_TYPE on_update)
#define DB_IS_CONSTRAINT_INDEX_FAMILY(c)
#define ER_SM_METHOD_ARG_NOT_FOUND
#define SM_IS_ATTFLAG_INDEX_FAMILY(c)
#define SM_GET_CONSTRAINT_STRING(c)
#define SM_IS_ATTFLAG_UNIQUE_FAMILY(c)
#define ER_SM_INDEX_EXISTS
struct db_object * class_mop
#define ER_SM_ALIAS_COMPONENT_EXISTS
MOP sm_find_class(const char *name)
int smt_find_attribute(SM_TEMPLATE *template_, const char *name, int class_attribute, SM_ATTRIBUTE **attp)
SM_CLASS_TYPE smt_get_class_type(SM_TEMPLATE *template_)
int locator_is_class(MOP mop, DB_FETCH_MODE hint_purpose)
int smt_set_attribute_default(SM_TEMPLATE *template_, const char *name, int class_attribute, DB_VALUE *proposed_value, DB_DEFAULT_EXPR *default_expr)
#define ER_SM_INVALID_INDEX_WITH_PREFIX_TYPE
#define SM_IS_ATTFLAG_UNIQUE_FAMILY_OR_FOREIGN_KEY(c)
#define ER_SM_NAME_RESERVED_BY_METHOD
char * ws_copy_string(const char *str)
struct sm_resolution * next
int do_check_rows_for_null(MOP class_mop, const char *att_name, bool *has_nulls)
#define SM_FIND_NAME_IN_COMPONENT_LIST(complist, name)
SM_CLASS_TYPE sm_get_class_type(SM_CLASS *class_)
int smt_add_class_method(SM_TEMPLATE *template_, const char *name, const char *function)
#define ER_SM_UNIQUE_ON_VCLASS
static int add_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias, SM_NAME_SPACE name_space)
#define TP_IS_BIT_TYPE(typeid)
#define ER_SM_INVALID_CLASS
static SM_RESOLUTION * find_alias(SM_RESOLUTION *reslist, const char *name, SM_NAME_SPACE name_space)
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)
SM_ATTRIBUTE * attributes
#define ER_SM_ARG_DOMAIN_NOT_A_SET
#define ER_OBJ_NOT_A_CLASS
#define ER_SM_INDEX_ON_SHARED
int au_fetch_class_force(MOP op, SM_CLASS **class_, AU_FETCHMODE fetchmode)
struct sm_method_file * next
void tp_domain_free(TP_DOMAIN *dom)
SM_METHOD_ARGUMENT * classobj_find_method_arg(SM_METHOD_ARGUMENT **arglist, int index, int create)
static int smt_set_attribute_orig_default_value(SM_ATTRIBUTE *att, DB_VALUE *new_orig_value, DB_DEFAULT_EXPR *default_expr)
SM_RESOLUTION * classobj_find_resolution(SM_RESOLUTION *reslist, MOP class_mop, const char *name, SM_NAME_SPACE name_space)
static int change_constraints_status_partitioned_class(MOP obj, const char *index_name, SM_INDEX_STATUS index_status)
const char * rel_major_release_string(void)
int smt_delete_super(SM_TEMPLATE *template_, MOP super_class)
int classobj_drop_prop(DB_SEQ *properties, const char *name)
SM_NAME_SPACE sm_resolution_space(SM_NAME_SPACE name_space)
int classobj_find_prop_constraint(DB_SEQ *properties, const char *prop_name, const char *cnstr_name, DB_VALUE *cnstr_val)
int classobj_put_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
#define ER_SM_NO_NESTED_SETS
SM_METHOD * classobj_find_method(SM_CLASS *class_, const char *name, int class_method)
int sm_update_class(SM_TEMPLATE *template_, MOP *classmop)
int smt_add_resolution(SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias)