62 #if defined (SUPPRESS_STRLEN_WARNING) 63 #define strlen(s1) ((int) strlen(s1)) 66 #define UNIQUE_SAVEPOINT_ADD_ATTR_MTHD "aDDaTTRmTHD" 67 #define UNIQUE_SAVEPOINT_CREATE_ENTITY "cREATEeNTITY" 68 #define UNIQUE_SAVEPOINT_DROP_ENTITY "dROPeNTITY" 69 #define UNIQUE_SAVEPOINT_REPLACE_VIEW "rEPlACE" 70 #define UNIQUE_SAVEPOINT_RENAME "rENAME" 71 #define UNIQUE_SAVEPOINT_MULTIPLE_ALTER "mULTIPLEaLTER" 72 #define UNIQUE_SAVEPOINT_TRUNCATE "tRUnCATE" 73 #define UNIQUE_SAVEPOINT_CHANGE_ATTR "cHANGEaTTR" 74 #define UNIQUE_SAVEPOINT_ALTER_INDEX "aLTERiNDEX" 75 #define UNIQUE_SAVEPOINT_CHANGE_DEF_COLL "cHANGEdEFAULTcOLL" 76 #define UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT "cHANGEtBLcOMMENT" 77 #define UNIQUE_SAVEPOINT_CHANGE_COLUMN_COMMENT "cHANGEcOLUMNcOMMENT" 78 #define UNIQUE_SAVEPOINT_CREATE_USER_ENTITY "cREATEuSEReNTITY" 79 #define UNIQUE_SAVEPOINT_DROP_USER_ENTITY "dROPuSEReNTITY" 80 #define UNIQUE_SAVEPOINT_ALTER_USER_ENTITY "aLTERuSEReNTITY" 81 #define UNIQUE_SAVEPOINT_GRANT_USER "gRANTuSER" 82 #define UNIQUE_SAVEPOINT_REVOKE_USER "rEVOKEuSER" 84 #define QUERY_MAX_SIZE 1024 * 1024 85 #define MAX_FILTER_PREDICATE_STRING_LENGTH 255 226 static int drop_class_name (
const char *name,
bool is_cascade_constraints);
234 static int do_rename_internal (
const char *
const old_name,
const char *
const new_name);
237 const bool is_reverse,
const bool is_unique,
PT_NODE * spec,
239 PT_NODE * filter_predicate,
int func_index_pos,
int func_index_args_count,
243 char **name_set,
bool error_on_misssing_class);
255 const char *
const class_name);
295 const char *classname);
302 int attr_count,
MOP class_mop);
319 bool * need_update,
int *collation_id);
343 #if defined (ENABLE_UNUSED_FUNCTION) 347 int promoted_count,
PT_ALTER_CODE alter_op,
bool should_update,
359 bool error_on_not_normal);
375 char *class_name,
char *partition_name,
DB_VALUE * minval);
406 const char *entity_name, *new_query;
407 const char *attr_name, *mthd_name, *mthd_file, *attr_mthd_name;
408 const char *new_name, *old_name, *domain;
417 int query_no, class_attr;
423 PT_NODE *temp_val, *def_val, *initial_def_val =
NULL;
428 bool partition_savepoint =
false;
430 #if defined (ENABLE_RENAME_CONSTRAINT) 433 unsigned int save_custom;
439 if (entity_name ==
NULL)
456 if (ctemplate ==
NULL)
494 for (; slist; slist = slist->
next)
578 if (ctemplate ==
NULL)
642 goto reset_query_error;
651 goto reset_query_error;
660 goto reset_query_error;
667 goto reset_query_error;
677 goto reset_query_error;
739 mthd_file = (
char *) path->info.value.data_value.str->bytes;
771 for (node = nodelist; node !=
NULL; node = node->
next)
859 if (super_class ==
NULL)
880 super_node = super_node->
next;
890 if (sup_class ==
NULL)
925 for (; n && d; n = n->
next, d = d->
next)
961 if (data_type ==
NULL)
972 if (initial_def_val ==
NULL)
1002 pt_evaluate_tree (parser, d->info.data_default.default_value, &src_val, 1);
1045 if (temp_val ==
NULL)
1131 error =
dbt_rename (ctemplate, old_name, class_attr, new_name);
1146 PT_NODE *old_name_node, *new_name_node;
1170 const char *constraint_name =
NULL;
1179 constraint_name = cons->
name;
1184 constraint_name =
"primary key";
1248 partition_savepoint =
true;
1253 #if defined (ENABLE_RENAME_CONSTRAINT) 1254 case PT_RENAME_CONSTRAINT:
1255 case PT_RENAME_INDEX:
1269 error = smt_rename_constraint (ctemplate, old_name, new_name, constraint_family);
1279 if (initial_def_val !=
NULL)
1296 if (partition_savepoint)
1298 goto alter_partition_fail;
1311 if (partition_savepoint)
1313 goto alter_partition_fail;
1378 goto alter_partition_fail;
1387 alter_partition_fail:
1430 for (tmp_clause = alter->
next; tmp_clause !=
NULL; tmp_clause = tmp_clause->
next)
1472 for (; create_index !=
NULL; create_index = create_index->
next)
1539 is_unique,
NULL,
NULL,
NULL,
NULL, -1, 0,
NULL,
NULL, obj,
1556 const char *entity_name =
NULL;
1564 if (entity_name ==
NULL)
1567 goto change_ai_error;
1571 if (class_obj ==
NULL)
1575 goto change_ai_error;
1587 if (ai_serial !=
NULL)
1591 goto change_ai_error;
1599 if (ai_serial ==
NULL)
1603 goto change_ai_error;
1630 bool do_semantic_checks =
false;
1643 for (crt_clause = alter; crt_clause !=
NULL; crt_clause = crt_clause->
next)
1649 if (do_semantic_checks)
1654 crt_result =
pt_compile (parser, crt_clause);
1655 crt_clause->
next = save_next;
1662 assert (crt_result == crt_clause);
1701 crt_clause->
next = save_next;
1708 do_semantic_checks =
true;
1731 #define IS_NAME(n) ((n)->node_type == PT_NAME) 1732 #define IS_STRING(n) ((n)->node_type == PT_VALUE && \ 1733 ((n)->type_enum == PT_TYPE_VARCHAR || \ 1734 (n)->type_enum == PT_TYPE_CHAR || \ 1735 (n)->type_enum == PT_TYPE_VARNCHAR || \ 1736 (n)->type_enum == PT_TYPE_NCHAR)) 1737 #define GET_NAME(n) ((char *) (n)->info.name.original) 1738 #define GET_STRING(n) ((char *) (n)->info.value.data_value.str->bytes) 1752 PT_NODE *auth_cmd_list, *auth_list, *auth;
1754 PT_NODE *spec_list, *s_list, *spec;
1755 PT_NODE *entity_list, *entity;
1757 bool set_savepoint =
false;
1767 grant_option =
true;
1771 grant_option =
false;
1779 set_savepoint =
true;
1781 for (user = user_list; user !=
NULL; user = user->
next)
1784 if (user_obj ==
NULL)
1791 auth_list = auth_cmd_list;
1792 for (auth = auth_list; auth !=
NULL; auth = auth->
next)
1797 for (spec = s_list; spec !=
NULL; spec = spec->
next)
1800 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
1803 if (class_mop ==
NULL)
1810 error =
db_grant (user_obj, class_mop, db_auth, grant_option);
1842 PT_NODE *auth_cmd_list, *auth_list, *auth;
1844 PT_NODE *spec_list, *s_list, *spec;
1845 PT_NODE *entity_list, *entity;
1846 bool set_savepoint =
false;
1859 set_savepoint =
true;
1861 for (user = user_list; user !=
NULL; user = user->
next)
1864 if (user_obj ==
NULL)
1871 auth_list = auth_cmd_list;
1872 for (auth = auth_list; auth !=
NULL; auth = auth->
next)
1877 for (spec = s_list; spec !=
NULL; spec = spec->
next)
1880 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
1883 if (class_mop ==
NULL)
1890 error =
db_revoke (user_obj, class_mop, db_auth);
1922 const char *user_name, *password, *comment;
1923 const char *group_name, *member_name;
1924 bool set_savepoint =
false;
1928 if (parser ==
NULL || statement ==
NULL)
1942 if (user_name ==
NULL)
1969 if (member_name ==
NULL)
1987 if (group_name ==
NULL)
1996 if (member_name ==
NULL)
2015 set_savepoint =
true;
2037 if (password !=
NULL)
2049 if (group_name !=
NULL)
2073 while (group_name !=
NULL);
2079 if (member_name !=
NULL)
2103 while (member_name !=
NULL);
2141 const char *user_name;
2142 bool set_savepoint =
false;
2146 if (parser ==
NULL || statement ==
NULL)
2155 if (user_name ==
NULL)
2175 set_savepoint =
true;
2199 const char *user_name, *password, *comment;
2200 bool set_savepoint =
false;
2204 if (parser ==
NULL || statement ==
NULL)
2213 if (user_name ==
NULL)
2233 set_savepoint =
true;
2317 PT_NODE *entity_spec_list, *entity_spec;
2325 for (entity_spec = entity_spec_list; entity_spec !=
NULL; entity_spec = entity_spec->
next)
2328 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
2345 for (entity_spec = entity_spec_list; entity_spec !=
NULL; entity_spec = entity_spec->
next)
2348 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
2384 char **name_set,
bool error_on_misssing_class)
2393 if (class_mop ==
NULL && error_on_misssing_class)
2399 if (class_mop !=
NULL)
2403 mop_set[*num_mops] = class_mop;
2409 for (i = 0; i < *num_names; ++
i)
2417 name_set[*num_names] =
strdup (realname);
2418 if (name_set[*num_names] ==
NULL)
2421 (
strlen (realname) + 1) *
sizeof (
char));
2452 char **name_set =
NULL;
2460 mop_set = (
MOP *) malloc (2 * num_rename *
sizeof (
MOP));
2461 if (mop_set ==
NULL)
2469 name_set = (
char **) malloc (2 * num_rename *
sizeof (
char *));
2470 if (name_set ==
NULL)
2478 for (current_rename = statement; current_rename !=
NULL; current_rename = current_rename->
next)
2480 const bool is_first_rename = current_rename == statement ?
true :
false;
2486 for (i = 0; i < num_names; i++)
2488 if (strcmp (name_set[i], old_name) == 0)
2503 if (is_first_rename)
2515 if (is_first_rename && num_names != 1)
2524 assert (num_mops != 0 && num_names != 0);
2527 if (fetch_result ==
NULL)
2534 oid_set = (
OID *) malloc (num_names *
sizeof (
OID));
2535 if (oid_set ==
NULL)
2542 for (i = 0; i < num_names; ++
i)
2559 if (oid_set !=
NULL)
2564 if (name_set !=
NULL)
2566 for (i = 0; i < num_names; ++
i)
2573 if (mop_set !=
NULL)
2610 for (current_rename = statement; current_rename !=
NULL; current_rename = current_rename->
next)
2651 if (old_class ==
NULL)
2701 PT_NODE * column_prefix_length,
PT_NODE * where_predicate,
int func_index_pos,
2702 int func_index_args_count,
PT_NODE * function_expr,
PT_NODE * comment,
2706 int i = 0, nnames = 0;
2709 char **attnames =
NULL;
2710 int *asc_desc =
NULL;
2711 int *attrs_prefix_length =
NULL;
2713 char const *colname =
NULL;
2714 const char *comment_str =
NULL;
2715 bool mysql_index_name =
false;
2716 bool free_packing_buff =
false;
2734 if (comment !=
NULL)
2742 if (do_index ==
DO_INDEX_CREATE && nnames == 1 && column_prefix_length)
2758 attnames = (
char **) malloc ((nnames + 1) *
sizeof (
const char *));
2759 if (attnames ==
NULL)
2765 asc_desc = (
int *) malloc ((nnames) *
sizeof (int));
2766 if (asc_desc ==
NULL)
2775 attrs_prefix_length = (
int *) malloc ((nnames) *
sizeof (int));
2776 if (attrs_prefix_length ==
NULL)
2785 for (c = column_names, i = 0; c !=
NULL; c = c->
next, i++)
2793 attrs_prefix_length[
i] = -1;
2798 if (do_index ==
DO_INDEX_CREATE && nnames == 1 && attrs_prefix_length && column_prefix_length)
2806 && constraint_name !=
NULL && nnames == 0)
2808 mysql_index_name =
true;
2814 free_packing_buff =
true;
2816 if (func_index_info ==
NULL)
2824 func_index_info->
col_id = func_index_pos;
2839 if (where_predicate)
2842 unsigned int save_custom;
2864 free_packing_buff =
true;
2867 if (filter_predicate)
2880 p_pred_index_info = &pred_index_info;
2892 error =
sm_add_constraint (obj, ctype, cname, (
const char **) attnames, asc_desc, attrs_prefix_length,
false,
2893 p_pred_index_info, func_index_info, comment_str, index_status);
2898 error =
sm_drop_constraint (obj, ctype, cname, (
const char **) attnames,
false, mysql_index_name);
2905 if (func_index_info)
2909 func_index_info =
NULL;
2918 if (free_packing_buff)
2926 if (attrs_prefix_length)
2950 const char *index_name =
NULL;
2995 const char *index_name =
NULL;
2997 const char *class_name =
NULL;
3006 if (index_name ==
NULL)
3076 char **attnames =
NULL;
3077 int *asc_desc =
NULL;
3078 int *attrs_prefix_length =
NULL;
3082 const char *index_name =
NULL;
3083 bool free_pred_string =
false;
3084 bool free_packing_buff =
false;
3088 const char *class_name =
NULL;
3089 const char *comment_str =
NULL;
3145 if (ctype != original_ctype)
3165 attnames = (
char **) malloc ((nnames + 1) *
sizeof (
const char *));
3166 if (attnames ==
NULL)
3173 for (i = 0, attp = idx->
attributes; *attp; i++, attp++)
3175 attnames[
i] =
strdup ((*attp)->header.name);
3176 if (attnames[i] ==
NULL)
3179 for (j = 0; j <
i; ++j)
3185 (
strlen ((*attp)->header.name) + 1) * sizeof (
char));
3194 asc_desc = (
int *) malloc ((nnames) *
sizeof (int));
3195 if (asc_desc ==
NULL)
3202 for (i = 0; i < nnames; i++)
3212 attrs_prefix_length = (
int *) malloc ((nnames) *
sizeof (int));
3213 if (attrs_prefix_length ==
NULL)
3220 for (i = 0; i < nnames; i++)
3241 free_pred_string =
true;
3276 p_pred_index_info = &pred_index_info;
3282 if (func_index_info ==
NULL)
3316 error =
sm_drop_constraint (obj, original_ctype, index_name, (
const char **) attnames,
false,
false);
3323 sm_add_constraint (obj, original_ctype, index_name, (
const char **) attnames, asc_desc, attrs_prefix_length,
false,
3324 p_pred_index_info, func_index_info, comment_str, saved_index_status);
3331 if (func_index_info)
3335 func_index_info =
NULL;
3343 if (free_pred_string)
3353 if (free_packing_buff)
3361 for (i = 0; attnames[
i]; i++)
3373 if (attrs_prefix_length)
3382 if (do_rollback ==
true)
3394 #if defined (ENABLE_RENAME_CONSTRAINT) 3408 const char *class_name =
NULL;
3409 const char *index_name =
NULL;
3410 const char *new_index_name =
NULL;
3411 const char *comment =
NULL;
3416 new_index_name = statement->
info.
index.new_name ? statement->
info.
index.new_name->info.name.original :
NULL;
3418 if (index_name ==
NULL || new_index_name ==
NULL)
3456 if (ctemplate ==
NULL)
3464 error = smt_rename_constraint (ctemplate, index_name, new_index_name,
SM_INDEX_NAME);
3470 if (comment !=
NULL)
3493 if (ctemplate !=
NULL)
3499 if (do_rollback ==
true)
3525 const char *class_name =
NULL;
3526 const char *index_name =
NULL;
3527 const char *comment =
NULL;
3532 if (index_name ==
NULL)
3569 if (ctemplate ==
NULL)
3596 if (ctemplate !=
NULL)
3602 if (do_rollback ==
true)
3631 #if defined (ENABLE_RENAME_CONSTRAINT) 3634 error = do_alter_index_rename (parser, statement);
3666 PT_NODE *alter_info, *hash_parts, *newparts, *hashtail;
3667 PT_NODE *parts, *parts_save, *fmin;
3672 DB_VALUE *minval, *parts_val, *fmin_val, partsize;
3673 int part_cnt = 0, part_add = -1;
3676 bool reuse_oid =
false;
3681 alter_info = hash_parts = newparts = hashtail =
NULL;
3682 parts = parts_save = fmin =
NULL;
3722 if (parttemp == NULL)
3765 int pi, org_hashsize, new_hashsize;
3768 if (hash_parts == NULL)
3786 if (org_hashsize < 0)
3788 error = org_hashsize;
3799 for (pi = 0; pi < new_hashsize; pi++)
3814 buf_size =
strlen (class_name) + 5 + 13;
3815 newpci->
pname = (
char *) malloc (buf_size);
3816 if (newpci->
pname == NULL)
3831 if (newpci->
temp == NULL)
3864 if (newpci->
obj == NULL)
3912 if (hashtail != NULL)
3914 hashtail->
next = newparts;
3918 hashtail = newparts;
3935 for (; parts; parts = parts->
next, part_cnt++)
3951 buf_size =
strlen (class_name) + 5 + 1 +
strlen (part_name);
3953 newpci->
pname = (
char *) malloc (buf_size);
3954 if (newpci->
pname == NULL)
3972 if (newpci->
obj == NULL)
3980 if (newpci->
temp == NULL)
3997 if (newpci->
obj == NULL)
4009 if (newpci->
temp == NULL)
4034 for (fmin = parts_save; fmin; fmin = fmin->
next)
4045 if (fmin_val == NULL)
4081 if (newpci->
obj == NULL)
4167 bool abort_template =
false;
4178 if (root_tmpl == NULL)
4183 abort_template =
true;
4191 if (abort_template ==
true)
4198 if (abort_template ==
true)
4210 for (wpci = pci.
next; wpci;)
4220 if (parttemp != NULL)
4297 int is_partition = 0;
4300 if (classop ==
NULL)
4313 if (is_partition > 0)
4351 if (classop ==
NULL)
4357 if (parentop ==
NULL || *parentop !=
NULL)
4428 *is_partitioned = 0;
4432 if (classop ==
NULL)
4450 *is_partitioned = 1;
4455 const char *
p =
NULL;
4520 for (objs = smclass->
users; objs;)
4569 if (!old_class || !newname)
4574 newlen =
strlen (newname);
4582 for (objs = smclass->
users; objs; objs = objs->
next)
4605 sprintf (new_subname,
"%s%s", newname, ptr);
4634 PT_ALTER_CODE alter_op,
bool should_update,
bool should_insert)
4642 MOP subclass_mop, class_mop;
4650 query_size +=
strlen (classname) + 2;
4652 query_size +=
strlen (keyname) * 2 + 6;
4653 query_buf = (
char *) malloc (query_size + 1);
4654 if (query_buf ==
NULL)
4659 sprintf (query_buf,
"UPDATE [%s] SET [%s]=[%s];", classname, keyname, keyname);
4677 if (class_mop ==
NULL)
4699 partitions = (
OID *) malloc (promoted_count *
sizeof (
OID));
4700 if (partitions ==
NULL)
4707 for (i = 0; i < promoted_count; i++)
4710 if (subclass_mop ==
NULL)
4732 if (partitions !=
NULL)
4736 if (index_save_info !=
NULL)
4757 char *serial_name =
NULL;
4758 size_t serial_name_size;
4764 *auto_increment_obj =
NULL;
4767 if (serial_class ==
NULL)
4776 serial_name = (
char *) malloc (serial_name_size);
4777 if (serial_name ==
NULL)
4787 if (*auto_increment_obj ==
NULL)
4795 if (serial_name !=
NULL)
4815 DB_VALUE minval, maxval, seqval, *wrtval;
4817 char check_flag = 1;
4825 for (subs = objs; subs; subs = subs->
next)
4866 new_range->partition = subclass->
partition;
4867 new_range->class_obj = subs->
op;
4870 new_range->next =
NULL;
4878 for (rfind = ranges, prev_range =
NULL; rfind; rfind = rfind->next)
4882 if (prev_range ==
NULL)
4884 new_range->
next = ranges;
4889 new_range->
next = prev_range->
next;
4890 prev_range->
next = new_range;
4899 prev_range->
next = new_range;
4904 for (rfind = ranges, prev_range =
NULL; rfind; rfind = rfind->next)
4907 if (prev_range ==
NULL)
4919 wrtval = prev_range->max;
4973 for (rfind = ranges; rfind;)
4977 prev_range = rfind->next;
5024 for (subs = smclass->
users, partcnt = 0; subs; subs = subs->
next)
5044 if (psize.
data.
i != partcnt)
5046 psize.
data.
i = partcnt;
5095 error = psize.
data.
i;
5118 const char *keyname_str;
5120 if (class_ ==
NULL || keycol ==
NULL)
5180 int no_partitions = 0;
5183 if (class_ ==
NULL || name_list ==
NULL)
5201 for (names = name_list; names; names = names->
next)
5206 partitions = (
OID *) malloc (no_partitions *
sizeof (
OID));
5207 if (partitions ==
NULL)
5214 for (names = name_list, i = 0; names; names = names->
next, i++)
5219 if (classcata ==
NULL)
5229 for (names = name_list, i = 0; names; names = names->
next, i++)
5233 if (classcata ==
NULL)
5278 if (partitions !=
NULL)
5309 if (smclass ==
NULL)
5345 char **namep =
NULL, **attrnames =
NULL;
5346 int *asc_desc =
NULL;
5372 namep = (
char **) malloc ((i + 1) *
sizeof (
char *));
5379 asc_desc = (
int *) malloc (i *
sizeof (
int));
5380 if (asc_desc ==
NULL)
5390 if (key_type ==
NULL)
5402 while (*attp && key_type)
5404 *attrnames = (
char *) (*attp)->header.name;
5413 key_type = key_type->
next;
5422 for (; parts; parts = parts->
next)
5463 new_func_index_info =
NULL;
5475 if (new_func_index_info)
5484 for (objs = root_class->
users; objs; objs = objs->
next)
5517 new_func_index_info =
NULL;
5529 if (new_func_index_info)
5542 if (asc_desc !=
NULL)
5546 if (new_func_index_info)
5591 const char *entity_name =
NULL;
5599 if (entity_name ==
NULL)
5643 const char *key_col_name =
NULL;
5657 while (attr !=
NULL)
5739 const char *entity_name =
NULL;
5750 if (entity_name ==
NULL)
5834 char **names =
NULL;
5835 int names_count = 0, allocated = 0,
i = 0;
5838 assert (parser && alter && pinfo);
5855 names = (
char **) malloc (10 *
sizeof (
char *));
5864 obj = class_->
users;
5868 obj_next = obj->
next;
5874 if (subclass->partition ==
NULL)
5881 if (names_count >= allocated - 1)
5884 char **buf = (
char **) realloc (names, (allocated + 10) *
sizeof (
char *));
5888 ((allocated + 10) *
sizeof (
char *)));
5896 if (names[names_count] ==
NULL)
5923 for (
i = 0;
i < names_count;
i++)
5949 const char *root_name =
NULL;
5953 assert (parser && alter && pinfo);
5971 if (subclass_mop ==
NULL)
6008 char **names =
NULL;
6009 int names_count = 0,
i = 0;
6010 int coalesce_count = 0, partitions_count = 0;
6014 assert (parser && alter && pinfo);
6015 assert (parser && alter && pinfo);
6020 if (partitions_count < 0)
6024 else if (partitions_count == 0)
6032 if (coalesce_count >= partitions_count)
6052 names = (
char **) malloc (coalesce_count *
sizeof (
char *));
6059 partitions = (
OID *) malloc (partitions_count *
sizeof (
OID));
6060 if (partitions ==
NULL)
6066 for (
i = partitions_count - 1, names_count = 0;
i >= partitions_count - coalesce_count;
i--)
6069 if (names[names_count] ==
NULL)
6078 if (subclass_op ==
NULL)
6110 if (partitions !=
NULL)
6120 for (
i = 0;
i < names_count;
i++)
6126 if (partitions !=
NULL)
6150 const char *root_name =
NULL;
6157 assert (parser && alter && pinfo);
6195 if (partitions ==
NULL)
6205 if (subclass_mop ==
NULL)
6217 if (subclass_mop ==
NULL)
6231 if (partitions !=
NULL)
6257 char **names =
NULL;
6258 int names_count = 0, allocated = 0,
i;
6259 const char *old_name =
NULL, *new_name =
NULL, *class_name =
NULL;
6263 assert (parser && alter && pinfo);
6274 while (old_part !=
NULL)
6279 while (new_part !=
NULL)
6281 new_name = new_part->info.parts.name->info.name.original;
6287 new_part = new_part->next;
6296 names = (
char **) malloc (10 *
sizeof (
char *));
6305 else if (names_count >= allocated - 1)
6308 char **new_buf = (
char **) realloc (names, 10 *
sizeof (
char *));
6309 if (new_buf ==
NULL)
6326 old_part = old_part->
next;
6343 for (
i = 0;
i < names_count;
i++)
6369 const char *root_name =
NULL;
6372 bool insert =
false, update =
false;
6375 assert (parser && alter && pinfo);
6413 if (subclass_mop ==
NULL)
6429 #if defined (ENABLE_UNUSED_FUNCTION) 6485 if (subclass->partition ==
NULL)
6523 int promoted_count = 0, partitions_count = 0;
6531 if (name_list ==
NULL)
6557 partitions_count = 0;
6565 if (!smsubclass->partition)
6572 partitions = (
OID *) malloc (partitions_count *
sizeof (
OID));
6573 if (partitions ==
NULL)
6580 for (name = name_list; name !=
NULL; name = name->
next)
6594 if (subclass ==
NULL)
6614 assert (partitions_count >= promoted_count);
6616 if (partitions_count - promoted_count == 0)
6647 if (partitions !=
NULL)
6674 if (subclass ==
NULL)
6690 if (partition_name !=
NULL)
6692 *partition_name =
strdup (name);
6693 if (*partition_name ==
NULL)
6716 bool has_pk =
false;
6727 if (subclass_mop ==
NULL)
6734 if (ctemplate ==
NULL)
6843 if (attribute ==
NULL)
6852 "system error - attribute type not set",
NULL);
6869 DB_MAX_NUMERIC_PRECISION);
6875 && (p < 0 || (p == 0 && check_zero_precision) || p > DB_MAX_NUMERIC_PRECISION))
6878 DB_MAX_NUMERIC_PRECISION);
6941 for (elem = dtyp; elem !=
NULL; elem = elem->
next)
6999 bool error_on_not_normal)
7001 const char *attr_name =
NULL;
7008 MOP auto_increment_obj =
NULL;
7011 bool add_first =
false;
7012 const char *add_after_attr =
NULL;
7013 PT_NODE *cnstr, *pk_attr, *comment;
7042 assert (default_value == &stack_value);
7049 if (default_value &&
DB_IS_NULL (default_value))
7060 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
7082 if (attr_db_domain ==
NULL)
7116 default_value = &stack_value;
7119 add_first, add_after_attr, &default_expr, &on_update_expr,
NULL);
7133 if (error ==
NO_ERROR && !meta && !shared)
7194 const char *attr_name;
7236 if (class_obj ==
NULL)
7242 &on_update_default_expr);
7250 default_expr, on_update_default_expr,
NULL);
7256 if (class_obj !=
NULL)
7278 if (query_columns ==
NULL)
7308 for (crt_attr = atts; crt_attr !=
NULL; crt_attr = crt_attr->
next)
7345 error =
do_add_attribute (parser, ctemplate, crt_attr, constraints,
false);
7351 crt_attr = crt_attr->
next;
7358 if (crt_attr !=
NULL)
7424 const char *constraint_name =
NULL;
7425 char **ref_attrs =
NULL;
7426 int i, n_atts, n_ref_atts;
7429 const char *comment =
NULL;
7436 for (p = fk_info->
attrs; p; p = p->
next)
7440 att_names[
i] =
NULL;
7446 buf_size = (n_ref_atts + 1) *
sizeof (
char *);
7447 ref_attrs = (
char **) malloc (buf_size);
7448 if (ref_attrs ==
NULL)
7460 ref_attrs[
i] =
NULL;
7499 char **att_names =
NULL;
7503 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
7521 buf_size = (max_attrs + 1) *
sizeof (
char *);
7522 att_names = (
char **) malloc (buf_size);
7524 if (att_names ==
NULL)
7531 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
7537 int class_attributes = 0;
7538 char *constraint_name =
NULL;
7540 int *asc_desc =
NULL;
7541 char *comment =
NULL;
7545 asc_desc = (
int *) malloc (n_atts *
sizeof (
int));
7546 if (asc_desc ==
NULL)
7550 goto constraint_error;
7569 class_attributes = 1;
7578 att_names[
i] =
NULL;
7589 if (constraint_name ==
NULL)
7594 goto constraint_error;
7603 error =
smt_add_constraint (ctemplate, constraint_type, constraint_name, (
const char **) att_names,
7611 goto constraint_error;
7618 int class_attributes = 0;
7619 char *constraint_name =
NULL;
7620 int *asc_desc =
NULL;
7621 char *comment =
NULL;
7625 asc_desc = (
int *) malloc (n_atts *
sizeof (
int));
7626 if (asc_desc ==
NULL)
7630 goto constraint_error;
7644 class_attributes = 1;
7647 att_names[
i] =
NULL;
7657 asc_desc, constraint_name);
7658 if (constraint_name ==
NULL)
7663 goto constraint_error;
7673 (
const char **) att_names, asc_desc,
NULL, class_attributes,
NULL,
NULL,
7681 goto constraint_error;
7686 error =
add_foreign_key (ctemplate, cnstr, (
const char **) att_names);
7689 goto constraint_error;
7742 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
7760 for (attr = fk_info->
attrs; attr; attr = attr->
next)
7813 for (attribute_p = c->
attributes; *attribute_p; ++attribute_p)
7815 const char *
const att_name = (*attribute_p)->header.name;
7846 bool is_partitioned =
false;
7847 if (ctemplate ==
NULL)
7855 is_partitioned =
true;
7874 const char *method_name, *method_impl;
7875 PT_NODE *args_list, *type, *type_list;
7884 while (methods && (error ==
NO_ERROR))
7920 if (arg_db_domain ==
NULL)
7933 for (type = type_list; type !=
NULL; type = type->
next)
7936 if (arg_db_domain ==
NULL)
7957 if (arg_db_domain ==
NULL)
7974 for (data_type = args_list; data_type !=
NULL; data_type = data_type->
next)
7981 if (arg_db_domain ==
NULL)
7994 for (type = type_list; type !=
NULL; type = type->
next)
7997 if (arg_db_domain ==
NULL)
8018 if (arg_db_domain ==
NULL)
8032 methods = methods->
next;
8049 const char *method_file_name;
8055 for (mf = method_files; mf && error ==
NO_ERROR; mf = mf->
next)
8092 while (supers && (error ==
NO_ERROR))
8095 if (super_class ==
NULL)
8105 supers = supers->
next;
8125 const char *resolution_attr_mthd_name, *resolution_as_attr_mthd_name;
8129 while (resolution && (error ==
NO_ERROR))
8133 if (resolution_super_mop ==
NULL)
8143 resolution_as_attr_mthd_name =
NULL;
8154 resolution_as_attr_mthd_name);
8160 resolution_as_attr_mthd_name);
8163 resolution = resolution->
next;
8183 unsigned int save_custom;
8246 while (queries && (error ==
NO_ERROR))
8250 queries = queries->
next;
8272 const char *att_name;
8274 object_id = object_id_list;
8283 object_id = object_id->
next;
8384 while (attr !=
NULL)
8453 name =
pt_name (parser, real_name);
8497 if (create_select_copy ==
NULL)
8504 if (insert_into ==
NULL)
8511 create_select_copy =
NULL;
8513 insert_into =
pt_compile (parser, insert_into);
8546 if (create_select_copy !=
NULL)
8549 create_select_copy =
NULL;
8551 if (insert_into !=
NULL)
8571 const char *class_name =
NULL;
8572 const char *create_like =
NULL;
8578 bool found_reuse_oid_option =
false, reuse_oid =
false;
8579 bool do_rollback_on_error =
false;
8580 bool do_abort_class_on_error =
false;
8581 bool do_flush_class_mop =
false;
8585 PT_NODE *tbl_opt_charset, *tbl_opt_coll, *cs_node, *coll_node;
8586 PT_NODE *tbl_opt_comment, *comment_node, *super_node;
8587 PT_NODE *tbl_opt_encrypt, *encrypt_node;
8588 const char *comment_str =
NULL;
8590 int tde_algo_opt = -1;
8595 tbl_opt_charset = tbl_opt_coll = cs_node = coll_node =
NULL;
8596 tbl_opt_comment = comment_node =
NULL;
8597 tbl_opt_encrypt = encrypt_node =
NULL;
8607 if (create_select !=
NULL)
8661 if (super_class ==
NULL)
8682 super_node = super_node->
next;
8691 found_reuse_oid_option =
true;
8695 tbl_opt_encrypt = tbl_opt;
8698 found_reuse_oid_option =
true;
8702 tbl_opt_charset = tbl_opt;
8705 tbl_opt_coll = tbl_opt;
8708 tbl_opt_comment = tbl_opt;
8716 if (!found_reuse_oid_option)
8726 if (cs_node !=
NULL || coll_node !=
NULL)
8740 do_rollback_on_error =
true;
8744 ctemplate =
dbt_copy_class (class_name, create_like, &source_class);
8758 do_rollback_on_error =
true;
8793 if (ctemplate ==
NULL)
8802 do_abort_class_on_error =
true;
8804 if (create_like !=
NULL)
8821 if (class_obj ==
NULL)
8836 do_abort_class_on_error =
false;
8852 if (comment_node !=
NULL)
8859 do_flush_class_mop =
true;
8882 do_flush_class_mop =
true;
8907 do_flush_class_mop =
true;
8910 if (tbl_opt_encrypt)
8920 if (tde_algo_opt == -1)
8933 do_flush_class_mop =
true;
8940 if (tbl_opt_comment)
8948 do_flush_class_mop =
true;
8957 if (do_flush_class_mop ==
true)
8985 do_rollback_on_error =
false;
9003 query_columns, node);
9010 query_columns =
NULL;
9026 save_next = create_index->
next;
9035 create_index->
next = save_next;
9056 if (query_columns !=
NULL)
9059 query_columns =
NULL;
9061 if (do_abort_class_on_error)
9087 const char *
const class_name)
9098 if (classmop ==
NULL)
9136 saved = index_save_info;
9139 saved = saved->
next;
9168 for (saved = index_save_info; saved !=
NULL; saved = saved->next)
9173 sm_drop_constraint (classmop, saved->constraint_type, saved->name, (
const char **) saved->att_names,
false,
9191 for (saved = index_save_info; saved !=
NULL; saved = saved->next)
9193 error =
sm_add_constraint (classmop, saved->constraint_type, saved->name, (
const char **) saved->att_names,
9194 saved->asc_desc, saved->prefix_length,
false, saved->filter_predicate,
9195 saved->func_index_info, saved->comment, saved->index_status);
9203 if (index_save_info !=
NULL)
9212 if (index_save_info !=
NULL)
9232 const char **att_names =
NULL;
9234 char *new_cons_name =
NULL;
9237 int free_constraint = 0;
9238 const char *class_name =
NULL;
9256 if (att_names ==
NULL)
9263 new_cons_name = (
char *) c->
name;
9274 free_constraint = 1;
9276 if (class_name ==
NULL)
9323 if (new_cons_name !=
NULL && new_cons_name != c->
name)
9328 if (free_constraint)
9332 free_constraint = 0;
9341 if (new_cons_name !=
NULL && new_cons_name != c->
name)
9346 if (free_constraint)
9407 if (entity_spec ==
NULL)
9413 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
9430 for (entity = entity_list; entity !=
NULL; entity = entity->
next)
9461 const char *entity_name =
NULL;
9466 bool tran_saved =
false;
9471 bool has_partitions =
false;
9472 bool is_srv_update_needed =
false;
9483 if (entity_name ==
NULL)
9491 if (class_obj ==
NULL)
9513 if (ctemplate ==
NULL)
9548 usr_oid_array = (
OID *) calloc (user_count,
sizeof (
OID));
9549 if (usr_oid_array ==
NULL)
9556 for (i = 0, user_list = ctemplate->
current->
users; i < user_count && user_list !=
NULL;
9557 i++, user_list = user_list->
next)
9569 has_partitions =
true;
9590 class_mop = ctemplate->
op;
9601 if (is_srv_update_needed)
9604 att_id = attr_chg_prop.
att_id;
9609 if (class_obj ==
NULL)
9622 for (saved_constr = attr_chg_prop.
constr_info; saved_constr !=
NULL; saved_constr = saved_constr->
next)
9643 if (!is_srv_update_needed)
9645 const char *att_names[2];
9648 if (att_old_name !=
NULL)
9652 att_names[1] =
NULL;
9688 if (is_srv_update_needed)
9698 for (i = 0; i < user_count; i++)
9752 const char *att_name = *(ci->
att_names);
9761 const char *class_name =
NULL;
9762 const char *hard_default =
9764 int update_rows_count = 0;
9767 if (class_name ==
NULL)
9777 class_name, att_name, hard_default, att_name);
9784 if (update_rows_count > 0)
9815 if (ctemplate !=
NULL)
9836 if (usr_oid_array !=
NULL)
9855 DB_VALUE returnval, class_val, user_val;
9895 const char *entity_name =
NULL;
9899 bool tran_saved =
false;
9902 bool is_chg_needed =
false;
9903 int i, collation_id = -1, is_partition = -1;
9912 if (entity_name ==
NULL)
9927 if (class_obj ==
NULL)
9949 if (ctemplate ==
NULL)
9971 class_mop = ctemplate->
op;
9988 for (i = 0; sub_partitions[
i]; i++)
10005 if (class_obj ==
NULL)
10016 if (ctemplate !=
NULL)
10022 if (sub_partitions)
10045 const char *entity_name =
NULL;
10049 bool tran_saved =
false;
10075 if (entity_name ==
NULL)
10090 if (class_obj ==
NULL)
10111 if (ctemplate ==
NULL)
10121 class_mop = ctemplate->
op;
10131 if (class_obj ==
NULL)
10140 if (ctemplate !=
NULL)
10163 int meta = 0, shared = 0;
10167 const char *entity_name =
NULL;
10169 const char *attr_name =
NULL;
10176 bool tran_saved =
false;
10183 if (entity_name ==
NULL)
10191 if (class_obj ==
NULL)
10213 if (ctemplate ==
NULL)
10232 while (attr_node !=
NULL)
10265 attr_node = attr_node->
next;
10269 class_mop = ctemplate->
op;
10273 if (class_obj ==
NULL)
10284 if (ctemplate !=
NULL)
10314 bool change_first =
false;
10315 const char *change_after_attr =
NULL;
10316 const char *old_name =
NULL;
10317 const char *new_name =
NULL;
10318 const char *attr_name =
NULL;
10333 if (old_name_node !=
NULL)
10343 new_name = attr_name;
10344 attr_name = old_name;
10348 attr_name = old_name;
10401 assert (default_value ==
NULL || default_value == &stack_value);
10406 if (attr_db_domain ==
NULL)
10420 attr_chg_prop->
name_space, new_default, &new_default_expr,
10427 if (found_att ==
NULL)
10437 attr_name = new_name;
10441 attr_chg_prop->
att_id = found_att->
id;
10493 OID *oidp, serial_obj_id;
10507 MOP serial_class_mop, serial_mop;
10551 MOP auto_increment_obj =
NULL;
10558 if (found_att !=
NULL)
10584 MOP serial_class_mop, serial_mop;
10608 MOP auto_increment_obj =
NULL;
10618 if (found_att !=
NULL)
10678 const char *attr_name =
NULL;
10679 const char *old_name =
NULL;
10680 const char *new_name =
NULL;
10687 attr_chg_properties->
p[
P_NAME] = 0;
10689 if (attr_old_name !=
NULL)
10697 new_name = attr_name;
10698 attr_name = old_name;
10774 attr_chg_properties->
p[
P_ORDER] = 0;
10825 const char *attr_name_to_check = attr_name;
10834 int nb_att_in_constr = 0;
10835 int attr_name_found_at = -1;
10837 while (*sm_constr_attr !=
NULL)
10839 if ((*sm_constr_attr)->header.name !=
NULL 10843 attr_name_found_at = nb_att_in_constr;
10846 nb_att_in_constr++;
10849 if (attr_name_found_at != -1)
10851 bool save_constr =
false;
10863 assert (nb_att_in_constr >= 1);
10864 if (nb_att_in_constr >= 2)
10873 save_constr =
true;
10878 assert (nb_att_in_constr >= 1);
10880 save_constr =
true;
10892 assert (nb_att_in_constr >= 1);
10893 if (nb_att_in_constr >= 2)
10901 save_constr =
true;
10931 for (saved_constr = attr_chg_properties->
constr_info; saved_constr !=
NULL; saved_constr = saved_constr->
next)
10933 char **c_name =
NULL;
10934 for (c_name = saved_constr->
att_names; *c_name !=
NULL; ++c_name)
10939 *c_name =
strdup (new_name);
10940 if (*c_name ==
NULL)
10943 (
strlen (new_name) + 1) *
sizeof (
char));
10952 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
10956 bool save_pt_costraint =
false;
10958 const char *attr_name_to_check = attr_name;
10962 attr_name_to_check = new_name;
10975 save_pt_costraint =
true;
10980 save_pt_costraint =
true;
10985 save_pt_costraint =
true;
10996 for (constr_att = constr_att_list; constr_att !=
NULL; constr_att = constr_att->
next)
11007 assert (chg_prop_idx >= 0);
11010 if (save_pt_costraint
11047 if (attr_db_domain ==
NULL)
11052 attr_chg_properties->
p[
P_TYPE] = 0;
11062 int *
const p = &(attr_chg_properties->
p[
i]);
11219 if (comment !=
NULL)
11260 int req_scale = req_domain->
scale;
11262 int cur_scale = curr_domain->
scale;
11264 bool is_req_max_prec =
false;
11271 is_req_max_prec =
true;
11276 is_req_max_prec =
true;
11287 is_req_max_prec =
true;
11292 is_req_max_prec =
true;
11301 assert (is_req_max_prec ==
false);
11304 switch (current_type)
11317 if (req_prec - req_scale >= MIN_DIGITS_FOR_SHORT)
11330 if (req_prec >= MIN_DIGITS_FOR_SHORT + 1)
11362 if (req_prec - req_scale >= MIN_DIGITS_FOR_INTEGER)
11375 if (req_prec >= MIN_DIGITS_FOR_INTEGER + 1)
11402 if (req_prec - req_scale >= MIN_DIGITS_FOR_BIGINT)
11415 if (req_prec >= MIN_DIGITS_FOR_BIGINT + 1)
11434 if ((cur_prec < MIN_DIGITS_FOR_SHORT) && (cur_scale == 0))
11444 if ((cur_prec < MIN_DIGITS_FOR_INTEGER) && (cur_scale == 0))
11454 if ((cur_prec < MIN_DIGITS_FOR_BIGINT) && (cur_scale == 0))
11473 if (req_prec >= cur_prec + 2)
11502 if (is_req_max_prec)
11536 if (is_req_max_prec)
11569 if (is_req_max_prec)
11594 if (req_prec >= MIN_CHARS_FOR_TIME)
11627 if (req_prec >= MIN_CHARS_FOR_DATE)
11663 if (req_prec >= MIN_CHARS_FOR_DATETIME)
11699 if (req_prec >= MIN_CHARS_FOR_DATETIMETZ)
11735 if (req_prec >= MIN_CHARS_FOR_DATETIMETZ)
11771 if (req_prec >= MIN_CHARS_FOR_TIMESTAMP)
11807 if (req_prec >= MIN_CHARS_FOR_TIMESTAMPTZ)
11843 if (req_prec >= MIN_CHARS_FOR_TIMESTAMPTZ)
11883 if (req_prec >= cur_prec)
11928 if (req_prec >= cur_prec)
11965 if (req_prec >= cur_prec)
12009 if (req_prec >= cur_prec)
12029 if (req_prec >= cur_prec)
12056 if (req_prec >= cur_prec)
12163 if (curr_coll_id != req_coll_id)
12192 assert (curr_cs == req_cs);
12237 *new_attempt =
true;
12244 *new_attempt =
false;
12252 *new_attempt =
false;
12260 *new_attempt =
false;
12276 *new_attempt =
false;
12282 *new_attempt =
false;
12292 *new_attempt =
false;
12306 *new_attempt =
false;
12324 *new_attempt =
false;
12330 *new_attempt =
false;
12400 *new_attempt =
false;
12410 error = ER_ALTER_CHANGE_TYPE_WITH_S_UNIQUE;
12416 error = ER_ALTER_CHANGE_TYPE_WITH_M_UNIQUE;
12424 error = ER_ALTER_CHANGE_TYPE_WITH_PK;
12432 error = ER_ALTER_CHANGE_TYPE_WITH_NON_UNIQUE;
12451 *new_attempt =
false;
12469 *new_attempt =
false;
12476 if (log_error_allowed || !(*new_attempt))
12555 return ((prop & value) == value);
12581 attr_chg_properties->
att_id = -1;
12606 if (ordering_info !=
NULL)
12618 assert (*ord_first ==
false);
12622 *ord_after_name =
NULL;
12627 assert (*ord_first ==
true);
12632 *ord_first =
false;
12633 *ord_after_name =
NULL;
12655 if (on_update_default_expr ==
NULL)
12662 if (on_update_default_expr ==
NULL)
12668 if (on_update_default_expr ==
NULL)
12682 if (temp_ptval ==
NULL)
12688 if (on_update_default_expr !=
NULL)
12696 on_update_expr_type);
12706 const char *data_type_print;
12719 pt_short_print (parser, on_update_default_expr), data_type_print);
12724 pt_short_print (parser, on_update_default_expr), data_type_print);
12729 if (temp_ptval !=
NULL)
12733 if (on_update_default_expr !=
NULL)
12760 const char *classname)
12766 bool has_self_ref =
false;
12767 const char *data_type_print;
12773 *default_value =
NULL;
12796 has_self_ref =
true;
12803 if (initial_def_val ==
NULL)
12867 goto exit_on_coerce_error;
12894 if (temp_val ==
NULL)
12909 goto exit_on_coerce_error;
12919 *default_value =
NULL;
12931 if (initial_def_val !=
NULL)
12937 exit_on_coerce_error:
12964 if (initial_def_val !=
NULL)
12983 static const char *
12986 static const char *zero =
"0";
12987 static const char *empty_str =
"''";
12988 static const char *empty_n_str =
"N''";
12989 static const char *empty_bit =
"b'0'";
12990 static const char *empty_date =
"DATE '01/01/0001'";
12991 static const char *empty_time =
"TIME '00:00'";
12992 static const char *empty_datetime =
"DATETIME '01/01/0001 00:00'";
12993 static const char *empty_dt_tz =
"DATETIMETZ '01/01/0001 00:00 +00:00'";
12994 static const char *empty_dt_ltz =
"DATETIMELTZ '01/01/0001 00:00 +00:00'";
12995 static const char *empty_json =
"null";
13002 static const char *empty_timestamp =
"1";
13003 static const char *empty_set =
"{}";
13019 return empty_timestamp;
13028 return empty_datetime;
13030 return empty_dt_ltz;
13032 return empty_dt_tz;
13040 return empty_n_str;
13080 int attr_count,
MOP class_mop)
13083 int query_len, remaining, n;
13090 assert (parser && alter && attr_list);
13091 assert (attr_count > 0);
13104 q = query = (
char *) malloc (query_len + 1);
13124 for (attr = attr_list; attr !=
NULL; attr = attr->
next)
13126 const char *sep = first ?
"" :
", ";
13170 int attr_count,
MOP class_mop)
13173 int query_len, remaining, n;
13179 assert (parser && alter && attr_list);
13180 assert (attr_count > 0);
13193 q = query = (
char *) malloc (query_len + 1);
13212 for (attr = attr_list; attr !=
NULL; attr = attr->
next)
13214 const char *sep = first ?
"" :
", ";
13215 char *data_default;
13218 if (data_default ==
NULL)
13262 if (class_name ==
NULL || attr_name ==
NULL)
13310 int attr_count = 0;
13332 if (!is_not_null && !is_pri_key)
13370 if (relevant_attrs ==
NULL)
13386 if (relevant_attrs !=
NULL)
13411 int attr_count = 0;
13425 if (pt_data_default ==
NULL)
13459 if (relevant_attrs ==
NULL)
13473 if (relevant_attrs !=
NULL)
13520 for (constr = constr_info_list; constr !=
NULL; constr = constr->
next)
13561 for (constr = constr_info_list; constr !=
NULL; constr = constr->
next)
13595 int meta = 0, shared = 0;
13597 const char *old_name =
NULL;
13598 const char *attr_name =
NULL;
13599 bool new_attempt =
true;
13604 PT_NODE *constraints = *pointer_constraints;
13640 assert (ptr_def ==
NULL || ptr_def == &def_value);
13645 for (cnstr = constraints; cnstr !=
NULL; cnstr = cnstr->
next)
13665 for (cnstr = constraints; cnstr !=
NULL; tmp_node = cnstr, cnstr = cnstr->
next)
13669 not_null_node = cnstr;
13670 previous_node = tmp_node;
13677 if (not_null_node !=
NULL && pk_node !=
NULL)
13684 if (not_null_node !=
NULL && pk_node !=
NULL)
13686 if (previous_node ==
NULL)
13689 constraints = not_null_node->
next;
13690 *pointer_constraints = constraints;
13694 previous_node->
next = not_null_node->
next;
13701 error =
build_attr_change_map (parser, ctemplate, attribute, old_name_node, constraints, attr_chg_prop);
13716 if (old_name_node !=
NULL)
13726 attr_name = old_name;
13730 attr_name = old_name;
13765 if (error !=
NO_ERROR && new_attempt)
13769 if (error !=
NO_ERROR && new_attempt)
13799 int cs = -1, coll_id = -1;
13803 *need_update =
false;
13813 *need_update =
true;
13817 *need_update =
false;
13819 *collation_id = coll_id;
13831 *need_update =
true;
13854 int constr_order[7] = { 0 };
13858 if (*orig_list ==
NULL)
13876 for (constr = *orig_list, next =
NULL; constr !=
NULL; constr =
next)
13878 next = constr->
next;
13899 constr->
next = found;
13906 prev->
next = constr;
13909 *orig_list = sorted;
13939 if (new_constraint ==
NULL)
13967 if (constr_att_name->
next !=
NULL)
13974 new_constraint->
att_names = (
char **) calloc (1 + 1,
sizeof (
char *));
13996 while ((*save_info) !=
NULL)
13998 save_info = &((*save_info)->next);
14000 *save_info = new_constraint;
14005 if (new_constraint !=
NULL)
14029 const char *class_name =
NULL;
14037 *has_nulls =
false;
14041 if (class_name ==
NULL)
14049 snprintf (query,
sizeof (query) /
sizeof (
char),
"SELECT count(*) FROM [%s] WHERE [%s] IS NULL", class_name,
14051 if (n < 0 || (n ==
sizeof (query) /
sizeof (
char)))
14060 if (session ==
NULL)
14088 if (result ==
NULL)
14124 if (result !=
NULL)
14128 if (session !=
NULL)
14154 bool check_tr_state =
false;
14164 if (session ==
NULL)
14193 assert (check_tr_state == save_tr_state);
14216 if (session !=
NULL)
14242 char *expr_str =
NULL;
14244 unsigned int save_custom;
14257 if (func_index_info ==
NULL)
14311 return func_index_info;
14314 if (func_index_info !=
NULL)
14336 PT_NODE * alter,
const char *src_cls_name,
const char *new_cls_name)
14343 const char *class_name =
NULL;
14344 char *query_str =
NULL;
14345 size_t query_str_len = 0;
14346 int saved_func_index_pos = -1, saved_attr_index_start = -1;
14347 bool free_packing_buff =
false;
14348 bool free_parser =
false;
14357 fi_info = func_index_info;
14360 if (parser ==
NULL)
14363 if (parser ==
NULL)
14368 free_parser =
true;
14383 class_name = src_cls_name;
14386 if (class_name ==
NULL)
14396 query_str = (
char *) malloc (query_str_len);
14397 if (query_str ==
NULL)
14402 snprintf (query_str, query_str_len,
"SELECT %s FROM [%s]", fi_info->
expr_str, class_name);
14430 (*stmt)->info.query.q.select.from->info.spec.entity_name = new_node;
14460 saved_func_index_pos = fi_info->
col_id;
14474 free_packing_buff =
true;
14476 if (fi_info_ws ==
NULL)
14487 if (fi_info ==
NULL)
14499 fi_info->
col_id = saved_func_index_pos;
14508 if (free_packing_buff)
14537 const char *src_cls_name,
const char *new_cls_name)
14545 const char *class_name =
NULL;
14546 char *query_str =
NULL;
14547 size_t query_str_len = 0;
14548 char *pred_str =
NULL;
14549 int pred_str_len = 0;
14550 bool free_packing_buff =
false;
14552 bool free_parser =
false;
14553 unsigned int save_custom;
14555 if (parser ==
NULL)
14558 if (parser ==
NULL)
14563 free_parser =
true;
14578 class_name = src_cls_name;
14581 if (class_name ==
NULL)
14592 query_str = (
char *) malloc (query_str_len);
14593 if (query_str ==
NULL)
14598 snprintf (query_str, query_str_len,
"SELECT * FROM [%s] WHERE %s", class_name, filter_index_info->
pred_string);
14626 (*stmt)->info.query.q.select.from->info.spec.entity_name = new_node;
14656 pred_str = (
char *) filter_expr->
bytes;
14657 pred_str_len =
strlen (pred_str);
14658 new_pred.
pred_string = (
char *) calloc (pred_str_len + 1,
sizeof (
char));
14665 memcpy (new_pred.
pred_string, pred_str, pred_str_len);
14677 free_packing_buff =
true;
14679 if (filter_predicate)
14726 if (filter_index_info->
att_ids)
14770 if (free_packing_buff)
14794 const char *new_name =
NULL;
14803 if (old_name ==
NULL || new_name ==
NULL)
14817 new_node =
pt_name (parser, new_name);
14854 const char *new_name = (
char *) void_arg;
14906 if (sm_all_constraints ==
NULL || sm_constraint ==
NULL)
14920 switch (sm_constraint->
type)
14923 *is_reverse =
false;
14924 *is_unique =
false;
14927 *is_reverse =
false;
14931 *is_reverse =
true;
14932 *is_unique =
false;
14935 *is_reverse =
true;
14959 char *partition_name,
DB_VALUE * minval)
14963 char *query, *query_str =
NULL, *
p;
14969 if (partition ==
NULL)
15001 unsigned int save_custom;
15022 query_str = (
char *) malloc (buf_size);
15023 if (query_str ==
NULL)
15028 sprintf (query_str,
"SELECT %s FROM [%s]", query, class_name);
15070 if (part_expr ==
NULL)
15093 if (minval ==
NULL)
15148 if (query_str !=
NULL)
15175 *saved_index_info_listpp =
NULL;
15206 saved = index_save_info;
15207 while (saved->next)
15209 saved = saved->
next;
15218 *saved_index_info_listpp = index_save_info;
15234 for (saved = index_save_info; saved !=
NULL; saved = saved->
next)
15272 for (saved = index_save_info; saved !=
NULL; saved = saved->
next)
15297 const char *class_name =
NULL;
15298 const char *index_name =
NULL;
15304 if (index_name ==
NULL)
15331 do_rollback =
true;
15334 if (ctemplate ==
NULL)
15360 if (ctemplate !=
NULL)
15366 if (do_rollback ==
true)
char * sm_produce_constraint_name_tmpl(SM_TEMPLATE *tmpl, DB_CONSTRAINT_TYPE constraint_type, const char **att_names, const int *asc_desc, const char *given_name)
int dbt_constrain_non_null(DB_CTMPL *def, const char *name, int class_attribute, int on_or_off)
DB_OBJECT * db_find_class(const char *name)
int au_check_serial_authorization(MOP serial_object)
PT_NODE * pt_name(PARSER_CONTEXT *parser_ptr, const char *name)
#define ER_LK_UNILATERALLY_ABORTED
PT_NODE * pt_compile(PARSER_CONTEXT *parser, PT_NODE *volatile statement)
int db_execute_statement_local(DB_SESSION *session, int stmt, DB_QUERY_RESULT **result)
FUNC_PRED * pt_to_func_pred(PARSER_CONTEXT *parser, PT_NODE *spec, PT_NODE *expr)
static bool is_att_property_structure_checked(const SM_ATTR_PROP_CHG *attr_chg_properties)
DB_CONSTRAINT_TYPE constraint_type
int tran_system_savepoint(const char *savept_name)
PT_MISC_TYPE delete_action
static int check_att_chg_allowed(const char *att_name, const PT_TYPE_ENUM t, const SM_ATTR_PROP_CHG *attr_chg_prop, SM_ATTR_CHG_SOL chg_how, bool log_error_allowed, bool *new_attempt)
struct pt_alter_info::@111::@115 rename
static int add_foreign_key(DB_CTMPL *ctemplate, const PT_NODE *cnstr, const char **att_names)
#define CHECK_MODIFICATION_ERROR()
static int do_run_upgrade_instances_domain(PARSER_CONTEXT *parser, OID *p_class_oid, int att_id)
int do_statement(PARSER_CONTEXT *parser, PT_NODE *statement)
int sm_touch_class(MOP classmop)
const char ** classobj_point_at_att_names(SM_CLASS_CONSTRAINT *constraint, int *count_ref)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
#define UNIQUE_SAVEPOINT_RENAME
#define ws_free_string_and_init(str)
#define UNIQUE_SAVEPOINT_REVOKE_USER
PT_NODE * resolution_list
#define DB_MAX_BIT_PRECISION
PT_METHOD_DEF_INFO method_def
int dbt_add_foreign_key(DB_CTMPL *def, const char *constraint_name, const char **attnames, const char *ref_class, const char **ref_attrs, int del_action, int upd_action, const char *comment)
#define LANG_SYS_COLLATION
#define LANG_GET_BINARY_COLLATION(c)
#define ER_AU_MEMBER_CAUSES_CYCLES
#define SM_IS_CONSTRAINT_EXCEPT_INDEX_FAMILY(c)
int do_get_partition_size(MOP class_)
int sm_add_constraint(MOP classop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const int *attrs_prefix_length, int class_attributes, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status)
int dbt_reset_query_spec(DB_CTMPL *def)
int dbt_drop_class_method(DB_CTMPL *def, const char *name)
const char * pt_node_to_db_domain_name(PT_NODE *node)
#define ER_OBJ_TEMPLATE_INTERNAL
SM_FOREIGN_KEY_INFO * fk_info
PT_NODE ** parser_parse_string_use_sys_charset(PARSER_CONTEXT *parser, const char *buffer)
#define PT_ERRORm(parser, node, setNo, msgNo)
static int acquire_locks_for_multiple_rename(const PT_NODE *statement)
int dbt_drop_attribute(DB_CTMPL *def, const char *name)
TP_DOMAIN * classobj_find_cons_index2_col_type_list(SM_CLASS_CONSTRAINT *cons, OID *root_oid)
int tp_domain_compatible(const TP_DOMAIN *src, const TP_DOMAIN *dest)
const char * db_get_class_name(DB_OBJECT *class_)
#define ER_SM_ATTR_NOT_NULL
#define ER_ALTER_CHANGE_CLASS_HIERARCHY
#define ER_INVALID_PARTITION_REQUEST
PT_NODE * table_option_list
static int do_recreate_att_constraints(MOP class_mop, SM_CONSTRAINT_INFO *constr_info_list)
static int get_index_type_qualifiers(MOP obj, bool *is_reverse, bool *is_unique, const char *index_name)
static int check_default_on_update_clause(PARSER_CONTEXT *parser, PT_NODE *attribute)
int smt_quit(SM_TEMPLATE *template_)
DB_ATTRIBUTE * db_get_attributes(DB_OBJECT *obj)
#define CHECK_2ARGS_ERROR(obj1, obj2)
#define MSGCAT_SEMANTIC_INVALID_SET_ELEMENT
PT_ATTR_ORDERING_INFO attr_ordering
int pt_check_enum_data_type(PARSER_CONTEXT *parser, PT_NODE *dt)
SM_PREDICATE_INFO * filter_predicate
int dbt_drop_constraint(DB_CTMPL *def, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **attnames, int class_attributes)
int classobj_copy_attlist(SM_ATTRIBUTE *attlist, MOP filter_class, int ordered, SM_ATTRIBUTE **copy_ptr)
bool tr_get_execution_state(void)
#define CHECK_PARTITION_PARENT
static int do_change_att_schema_only(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *attribute, PT_NODE *old_name_node, PT_NODE *constraints, SM_ATTR_PROP_CHG *attr_chg_prop, SM_ATTR_CHG_SOL *change_mode)
#define ER_FK_CANT_ON_PARTITION
DB_ATTRIBUTE * db_get_class_attribute(DB_OBJECT *obj, const char *name)
MOBJ locator_fetch_set(int num_mops, MOP *mop_set, DB_FETCH_MODE inst_purpose, DB_FETCH_MODE class_purpose, int quit_on_errors)
DB_ATTRIBUTE * partition_parent_atts
#define TP_IS_SET_TYPE(typenum)
#define ER_SM_NO_PARTITION_ON_HIERARCHIES
void set_free(DB_COLLECTION *set)
struct pt_alter_info::@111::@119 auto_increment
DB_DOMAIN * pt_type_enum_to_db_domain(const PT_TYPE_ENUM t)
#define PARTITIONED_SUB_CLASS_TAG
static DB_QUERY_TYPE * query_get_column_with_name(DB_QUERY_TYPE *query_columns, const char *name)
void pt_report_to_ersys_with_statement(PARSER_CONTEXT *parser, const PT_ERROR_TYPE error_type, PT_NODE *statement)
int db_get_int(const DB_VALUE *value)
int do_add_supers(const PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, const PT_NODE *supers)
#define ER_QPROC_DB_SERIAL_NOT_FOUND
#define ER_INHERIT_FROM_PARTITION_TABLE
MOBJ locator_create_heap_if_needed(MOP class_mop, bool reuse_oid)
#define ER_INTERFACE_NOT_SUPPORTED_OPERATION
int do_rename(const PARSER_CONTEXT *parser, const PT_NODE *statement)
int db_make_varchar(DB_VALUE *value, const int max_char_length, DB_CONST_C_CHAR str, const int char_str_byte_size, const int codeset, const int collation_id)
int pt_get_select_query_columns(PARSER_CONTEXT *parser, PT_NODE *create_select, DB_QUERY_TYPE **query_columns)
int locator_redistribute_partition_data(OID *class_oid, int no_oids, OID *oid_list)
SM_METHOD * class_methods
#define MSGCAT_SEMANTIC_OUT_OF_MEMORY
SM_CLASS_CONSTRAINT * classobj_find_class_primary_key(SM_CLASS *class_)
static PT_NODE * create_select_to_insert_into(PARSER_CONTEXT *parser, const char *class_name, PT_NODE *create_select, PT_CREATE_SELECT_ACTION create_select_action, DB_QUERY_TYPE *query_columns)
SM_CLASS_CONSTRAINT * classobj_find_cons_primary_key(SM_CLASS_CONSTRAINT *cons_list)
#define ER_ALTER_CHANGE_HARD_DEFAULT_NOT_EXIST
static int drop_class_name(const char *name, bool is_cascade_constraints)
#define ER_AU_USER_EXISTS
struct tp_domain * setdomain
#define UNIQUE_SAVEPOINT_GRANT_USER
#define ER_FK_MUST_NOT_BE_NOT_NULL
int dbt_drop_resolution(DB_CTMPL *def, MOP super, const char *name)
static int do_alter_clause_rename_entity(PARSER_CONTEXT *const parser, PT_NODE *const alter)
static const char * attribute_name(PARSER_CONTEXT *parser, PT_NODE *att)
int dbt_change_default(DB_CTMPL *def, const char *name, int class_attribute, DB_VALUE *value)
void db_namelist_free(DB_NAMELIST *list)
DB_CTMPL * dbt_copy_class(const char *new_name, const char *existing_name, SM_CLASS **class_)
static int do_promote_partition(SM_CLASS *class_)
void pt_reset_error(PARSER_CONTEXT *parser)
static int get_att_order_from_def(PT_NODE *attribute, bool *ord_first, const char **ord_after_name)
SM_ATTRIBUTE * attributes
PT_TABLE_OPTION_INFO table_option
enum pt_type_enum PT_TYPE_ENUM
int do_check_partitioned_class(DB_OBJECT *classop, int check_map, char *keyattr)
#define ASSERT_ERROR_AND_SET(error_code)
int db_query_end(DB_QUERY_RESULT *result)
void pt_record_error(PARSER_CONTEXT *parser, int stmt_no, int line_no, int col_no, const char *msg, const char *context)
#define UNIQUE_SAVEPOINT_CHANGE_COLUMN_COMMENT
#define assert_release(e)
#define DB_MAX_NCHAR_PRECISION
#define SM_MAX_IDENTIFIER_LENGTH
static int do_recreate_saved_indexes(MOP classmop, SM_CONSTRAINT_INFO *index_save_info)
DB_COLLECTION * set_create_sequence(int size)
int do_drop_index(PARSER_CONTEXT *parser, const PT_NODE *statement)
#define PARTITION_VARCHAR_LEN
int db_truncate_class(DB_OBJECT *class_)
PARSER_CONTEXT * parser_create_parser(void)
int do_set_object_id(const PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *object_id_list)
static bool is_attribute_primary_key(const char *class_name, const char *attr_name)
PT_NODE * pt_entity(PARSER_CONTEXT *parser, const PT_NODE *entity_name, const PT_NODE *range_var, const PT_NODE *flat_list)
int db_value_compare(const DB_VALUE *value1, const DB_VALUE *value2)
#define ER_PARTITION_EXPRESSION_TOO_LONG
static int add_query_to_virtual_class(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, const PT_NODE *queries)
static int truncate_class_name(const char *name)
int do_rollback(PARSER_CONTEXT *parser, PT_NODE *statement)
PT_TYPE_ENUM pt_db_to_type_enum(const DB_TYPE t)
#define ER_SM_CONSTRAINT_HAS_DIFFERENT_TYPE
const char * pt_type_enum_to_db_domain_name(const PT_TYPE_ENUM t)
PARSER_CONTEXT * db_get_parser(DB_SESSION *session)
#define ER_PARTITION_NOT_EXIST
#define PT_IS_LOB_TYPE(t)
DB_OBJECT * dbt_finish_class(DB_CTMPL *def)
SM_DEFAULT_VALUE default_value
#define ER_ALTER_CHANGE_WARN_NO_CHANGE
void sm_free_constraint_info(SM_CONSTRAINT_INFO **save_info)
static int do_remove_partition_post(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
DB_OBJECT * db_find_user(const char *name)
#define SM_IS_CONSTRAINT_UNIQUE_FAMILY(c)
static int do_create_partition_constraints(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
SM_CLASS_CONSTRAINT * classobj_find_constraint_by_name(SM_CLASS_CONSTRAINT *cons_list, const char *name)
OID * ws_identifier(MOP mop)
struct sm_component * next
union pt_query_info::@124 q
#define OID_SET_NULL(oidp)
static int do_reorganize_partition_post(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
void pt_exit_packing_buf(void)
int do_alter(PARSER_CONTEXT *parser, PT_NODE *alter)
void sm_downcase_name(const char *name, char *buf, int maxlen)
#define ER_CANNOT_HAVE_PK_DEFAULT_NULL
int do_update_auto_increment_serial_on_rename(MOP serial_obj, const char *class_name, const char *att_name)
PT_NODE * as_attr_mthd_name
DB_OBJLIST * db_get_superclasses(DB_OBJECT *obj)
int db_make_sequence(DB_VALUE *value, DB_C_SET *set)
SM_FUNCTION_INFO * func_index_info
SM_NAME_SPACE new_name_space
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)
static int do_add_attribute_from_select_column(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, DB_QUERY_TYPE *column)
unsigned int custom_print
#define ER_SM_INDEX_PREFIX_LENGTH_ON_UNIQUE_FOREIGN
TP_DOMAIN * tp_domain_copy(const TP_DOMAIN *domain, bool check_cache)
static int do_coalesce_partition_post(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
struct sm_constraint_info * next
DB_DOMAIN * pt_node_to_db_domain(PARSER_CONTEXT *parser, PT_NODE *node, const char *class_name)
struct sm_class_constraint * next
#define DB_MAX_PARTITION_EXPR_LENGTH
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 db_is_subclass(MOP classmop, MOP supermop)
int do_get_partition_parent(DB_OBJECT *const classop, MOP *const parentop)
int sm_set_class_comment(MOP classop, const char *comment)
static int do_reorganize_partition_pre(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
int dbt_add_set_attribute_domain(DB_CTMPL *def, const char *name, int class_attribute, const char *domain)
#define PT_NAME_INFO_IS_FLAGED(e, f)
#define ER_SM_CONSTRAINT_NOT_FOUND
PT_NODE * pt_sort_in_desc_order(PT_NODE *vlist)
int sm_save_function_index_info(SM_FUNCTION_INFO **save_info, SM_FUNCTION_INFO *func_index_info)
#define TP_TIMESTAMPTZ_AS_CHAR_LENGTH
#define MSGCAT_SEMANTIC_INVALID_PARTITION_DEFINITION
static int do_alter_change_tbl_comment(PARSER_CONTEXT *const parser, PT_NODE *const alter)
HFID * sm_get_ch_heap(MOP classmop)
#define UNIQUE_SAVEPOINT_CHANGE_ATTR
#define UNIQUE_SAVEPOINT_ALTER_INDEX
int do_drop(PARSER_CONTEXT *parser, PT_NODE *statement)
unsigned partition_pruned
#define UNIQUE_SAVEPOINT_MULTIPLE_ALTER
void db_ws_free(void *ptr)
static int do_alter_clause_change_attribute(PARSER_CONTEXT *const parser, PT_NODE *const alter)
int db_class_has_instance(DB_OBJECT *classobj)
int locator_upgrade_instances_domain(OID *class_oid, int attribute_id)
int db_attribute_is_shared(DB_ATTRIBUTE *attribute)
const char * AU_PUBLIC_USER_NAME
int db_attribute_is_non_null(DB_ATTRIBUTE *attribute)
static int do_find_auto_increment_serial(MOP *auto_increment_obj, const char *class_name, const char *attr_name)
DB_ATTRIBUTE * db_get_attribute_by_name(const char *class_name, const char *attribute_name)
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
SM_FOREIGN_KEY_ACTION update_action
void ws_free_string(const char *str)
DB_DEFAULT_EXPR_TYPE default_expr_type
#define UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT
#define UNIQUE_SAVEPOINT_ADD_ATTR_MTHD
SM_CLASS_CONSTRAINT * sm_class_constraints(MOP classop)
PT_FOREIGN_KEY_INFO foreign_key
#define ERROR0(error, code)
int pt_coerce_value_for_default_value(PARSER_CONTEXT *parser, PT_NODE *src, PT_NODE *dest, PT_TYPE_ENUM desired_type, PT_NODE *elem_type_list, DB_DEFAULT_EXPR_TYPE default_expr_type)
int dbt_add_super(DB_CTMPL *def, MOP super)
static int build_att_type_change_map(TP_DOMAIN *curr_domain, TP_DOMAIN *req_domain, SM_ATTR_PROP_CHG *attr_chg_properties)
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)
static int check_change_attribute(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *attribute, PT_NODE *old_name_node, PT_NODE **pointer_constraints, SM_ATTR_PROP_CHG *attr_chg_prop, SM_ATTR_CHG_SOL *change_mode)
PT_NODE * method_args_list
#define MSGCAT_SEMANTIC_CANT_COERCE_TO
int ib_get_thread_count()
DB_QUERY_TYPE * db_query_format_next(DB_QUERY_TYPE *query_type)
void parser_free_parser(PARSER_CONTEXT *parser)
int do_truncate(PARSER_CONTEXT *parser, PT_NODE *statement)
int dbt_add_class_resolution(DB_CTMPL *def, MOP super, const char *name, const char *alias)
static int do_alter_index_comment(PARSER_CONTEXT *parser, const PT_NODE *statement)
PT_NODE * class_attr_def_list
DB_DEFAULT_EXPR_TYPE default_expr_type
#define UNIQUE_SAVEPOINT_DROP_ENTITY
int intl_identifier_lower(const char *src, char *dst)
int smt_change_constraint_comment(SM_TEMPLATE *ctemplate, const char *index_name, const char *comment)
int do_recreate_filter_index_constr(PARSER_CONTEXT *parser, SM_PREDICATE_INFO *filter_index_info, PT_NODE *alter, const char *src_cls_name, const char *new_cls_name)
int er_get_severity(void)
static DB_CONSTRAINT_TYPE get_reverse_unique_index_type(const bool is_reverse, const bool is_unique)
void pt_report_to_ersys(const PARSER_CONTEXT *parser, const PT_ERROR_TYPE error_type)
char * db_query_format_name(DB_QUERY_TYPE *query_type)
#define ER_ALTER_CHANGE_ADD_NOT_NULL_SET_HARD_DEFAULT
MOBJ locator_fetch_class(MOP class_mop, DB_FETCH_MODE purpose)
DB_TYPE pt_type_enum_to_db(const PT_TYPE_ENUM t)
int db_make_string(DB_VALUE *value, DB_CONST_C_CHAR str)
#define UNIQUE_SAVEPOINT_TRUNCATE
int file_apply_tde_to_class_files(const OID *class_oid)
#define PT_ERRORmf3(parser, node, setNo, msgNo, arg1, arg2, arg3)
SM_CONSTRAINT_INFO * new_constr_info
PT_NODE * pt_semantic_check(PARSER_CONTEXT *parser, PT_NODE *node)
DB_DEFAULT_EXPR default_expr
SM_CONSTRAINT_INFO * constr_info
int do_drop_partitioned_class(MOP class_, int drop_sub_flag, bool is_cascade_constraints)
#define ER_NOTNULL_ON_TYPE_WITHOUT_DEFAULT_VALUE
void pt_free_statement_xasl_id(PT_NODE *statement)
#define DB_MAX_VARBIT_PRECISION
DB_ATTRIBUTE * db_get_attribute(DB_OBJECT *obj, const char *name)
#define ER_SM_NOT_NULL_NOT_ALLOWED
union pt_alter_info::@111 alter_clause
int pt_check_grammar_charset_collation(PARSER_CONTEXT *parser, PT_NODE *charset_node, PT_NODE *coll_node, int *charset, int *coll_id)
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,...)
int do_add_resolutions(const PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, const PT_NODE *resolution)
bool classobj_is_pk_referred(MOP clsop, SM_FOREIGN_KEY_INFO *fk_info, bool include_self_ref, char **fk_name)
static int add_union_query(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, const PT_NODE *query)
LANG_COLLATION * lang_get_collation(const int coll_id)
#define TP_TIMESTAMP_AS_CHAR_LENGTH
#define UNIQUE_PARTITION_SAVEPOINT_ALTER
const char * sm_ch_name(const MOBJ clobj)
#define ER_QPROC_SERIAL_NOT_FOUND
#define DB_MAX_VARCHAR_PRECISION
int tp_domain_match(const TP_DOMAIN *dom1, const TP_DOMAIN *dom2, TP_MATCH exact)
#define DB_MAX_NUMERIC_PRECISION
PT_OP_TYPE pt_op_type_from_default_expr_type(DB_DEFAULT_EXPR_TYPE expr_type)
void pt_get_default_expression_from_data_default_node(PARSER_CONTEXT *parser, PT_NODE *data_default_node, DB_DEFAULT_EXPR *default_expr)
PT_NODE * parser_make_expression(PARSER_CONTEXT *parser, PT_OP_TYPE OP, PT_NODE *arg1, PT_NODE *arg2, PT_NODE *arg3)
#define PT_ERRORmf2(parser, node, setNo, msgNo, arg1, arg2)
int tran_abort_upto_system_savepoint(const char *savepoint_name)
static SM_PARTITION * pt_node_to_partition_info(PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *entity_name, char *class_name, char *partition_name, DB_VALUE *minval)
int dbt_drop_method(DB_CTMPL *def, const char *name)
#define ER_ALTER_CHANGE_ATTR_TO_FROM_SHARED_NOT_ALLOWED
PT_NODE * constraint_list
PT_NODE * resolution_list
#define ER_ALTER_CHANGE_TYPE_WITH_INDEX
PT_NODE * referenced_attrs
int set_add_element(DB_COLLECTION *set, DB_VALUE *value)
int do_add_method_files(const PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *method_files)
struct pt_alter_info::@111::@113 attr_mthd
#define ER_LC_UNKNOWN_CLASSNAME
int sm_att_constrained(MOP classop, const char *name, SM_ATTRIBUTE_FLAG cons)
SM_ATTRIBUTE * shared_attributes
DB_QUERY_TYPE * query_type
static int build_attr_change_map(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *attr_def, PT_NODE *attr_old_name, PT_NODE *constraints, SM_ATTR_PROP_CHG *attr_chg_properties)
int smt_change_constraint_status(SM_TEMPLATE *ctemplate, const char *index_name, SM_INDEX_STATUS index_status)
int * attrs_prefix_length
int prm_get_integer_value(PARAM_ID prm_id)
void pt_evaluate_tree(PARSER_CONTEXT *parser, PT_NODE *tree, DB_VALUE *db_values, int values_count)
static int adjust_partition_size(MOP class_, DB_CTMPL *tmpl)
SM_PARTITION * classobj_make_partition_info(void)
struct db_value_slist * next
static int do_save_all_indexes(MOP classmop, SM_CONSTRAINT_INFO **saved_index_info_listpp)
int au_fetch_class(MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
static int validate_attribute_domain(PARSER_CONTEXT *parser, PT_NODE *attribute, const bool check_zero_precision)
#define ERROR1(error, code, arg1)
int sm_att_default_value(MOP classop, const char *name, DB_VALUE *value, DB_DEFAULT_EXPR **default_expr, DB_DEFAULT_EXPR_TYPE **on_update_expr)
int do_grant(const PARSER_CONTEXT *parser, const PT_NODE *statement)
int db_constrain_non_null(MOP class_, const char *name, int class_attribute, int on_or_off)
PT_NODE * of_sup_class_name
PT_MISC_TYPE grant_option
int do_add_queries(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, const PT_NODE *queries)
#define ER_FK_CANT_ON_SHARED_ATTRIBUTE
PT_MISC_TYPE with_check_option
int db_query_first_tuple(DB_QUERY_RESULT *result)
const char * pt_show_type_enum(PT_TYPE_ENUM t)
#define ER_IT_DATA_OVERFLOW
#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)
#define MSGCAT_SET_PARSER_RUNTIME
int db_attribute_is_primary_key(DB_ATTRIBUTE *attribute)
PT_NODE * flat_entity_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)
int do_rename_partition(MOP old_class, const char *newname)
PT_MISC_TYPE all_distinct
static int do_update_new_notnull_cols_without_default(PARSER_CONTEXT *parser, PT_NODE *alter, MOP class_mop)
void lang_set_parser_use_client_charset(bool use)
#define CHECK_1ARG_ERROR(obj)
int sm_is_partitioned_class(MOP op)
SM_ATTRIBUTE * class_attributes
struct pt_alter_info::@111::@117 collation
#define MSGCAT_SEMANTIC_OVERFLOW_COERCING_TO
static PT_NODE * replace_names_alter_chg_attr(PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
int dbt_rename_method_file(DB_CTMPL *def, const char *old_name, const char *new_name)
int sm_save_constraint_info(SM_CONSTRAINT_INFO **save_info, const SM_CLASS_CONSTRAINT *const c)
PT_NODE * pt_semantic_quick_check_node(PARSER_CONTEXT *parser, PT_NODE **spec_p, PT_NODE **node_p)
int au_set_password(MOP user, const char *password)
DB_SEQ * db_seq_copy(DB_SEQ *source)
int sm_update_statistics(MOP classop, bool with_fullscan)
int intl_identifier_casecmp(const char *str1, const char *str2)
#define ER_SM_INVALID_FILTER_PREDICATE_LENGTH
#define DB_VALUE_DOMAIN_TYPE(value)
int db_value_free(DB_VALUE *value)
void pt_evaluate_tree_having_serial(PARSER_CONTEXT *parser, PT_NODE *tree, DB_VALUE *db_value, int vals_cnt)
PT_PARTITION_INFO partition
#define MSGCAT_RUNTIME_RESOURCES_EXHAUSTED
#define DB_MAX_IDENTIFIER_LENGTH
#define TP_DOMAIN_COLLATION(dom)
int locator_flush_class(MOP class_mop)
void au_change_owner_method(MOP obj, DB_VALUE *returnval, DB_VALUE *class_, DB_VALUE *owner)
SM_QUERY_SPEC * query_spec
PT_NODE * parser_copy_tree(PARSER_CONTEXT *parser, const PT_NODE *tree)
#define UNIQUE_SAVEPOINT_CHANGE_DEF_COLL
PT_NODE * pt_semantic_type(PARSER_CONTEXT *parser, PT_NODE *tree, SEMANTIC_CHK_INFO *sc_info)
DB_CTMPL * dbt_create_vclass(const char *name)
#define ER_DO_ALTER_ADD_WITH_UNIQUE
int do_create_index(PARSER_CONTEXT *parser, const PT_NODE *statement)
#define MAX_FILTER_PREDICATE_STRING_LENGTH
static int do_update_new_cols_with_default_expression(PARSER_CONTEXT *parser, PT_NODE *alter, MOP class_mop)
DB_ATTRIBUTE * db_attribute_next(DB_ATTRIBUTE *attribute)
SM_ATTRIBUTE * instance_attributes
PT_FILE_PATH_INFO file_path
int dbt_drop_super(DB_CTMPL *def, MOP super)
const char * sm_get_ch_name(MOP op)
DB_DOMAIN * pt_data_type_to_db_domain(PARSER_CONTEXT *parser, PT_NODE *dt, const char *class_name)
static int do_drop_saved_indexes(MOP classmop, SM_CONSTRAINT_INFO *index_save_info)
int dbt_add_resolution(DB_CTMPL *def, MOP super, const char *name, const char *alias)
int do_create_local(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *pt_node, DB_QUERY_TYPE *create_select_columns)
DB_VALUE * db_value_copy(DB_VALUE *value)
static int update_locksets_for_multiple_rename(const char *class_name, int *num_mops, MOP *mop_set, int *num_names, char **name_set, bool error_on_misssing_class)
#define DB_IS_CONSTRAINT_REVERSE_INDEX_FAMILY(c)
int do_add_constraints(DB_CTMPL *ctemplate, PT_NODE *constraints)
#define CHECK_3ARGS_ERROR(obj1, obj2, obj3)
#define TP_DOMAIN_TYPE(dom)
int do_check_fk_constraints(DB_CTMPL *ctemplate, PT_NODE *constraints)
PT_DATA_TYPE_INFO data_type
void pt_enter_packing_buf(void)
int db_grant(MOP user, MOP class_, AU_TYPE auth, int grant_option)
static void cleanup(int signo)
#define PT_NAME_INFO_DESC
struct pt_alter_info::@111::@118 index
PT_ATTR_DEF_INFO attr_def
struct pt_alter_info::@111::@121 comment
static int get_att_default_from_def(PARSER_CONTEXT *parser, PT_NODE *attribute, DB_VALUE **default_value, const char *classname)
int tp_valid_indextype(DB_TYPE type)
static int do_alter_change_default_cs_coll(PARSER_CONTEXT *const parser, PT_NODE *const alter)
const char * er_msg(void)
#define UNIQUE_SAVEPOINT_DROP_USER_ENTITY
DB_SESSION * db_open_buffer(const char *buffer)
static int do_run_update_query_for_class(char *query, MOP class_mop, int *row_count)
int db_compile_statement(DB_SESSION *session)
void db_close_session(DB_SESSION *session)
int do_change_auto_increment_serial(PARSER_CONTEXT *const parser, MOP serial_obj, PT_NODE *node_new_val)
#define SM_PROPERTY_UNIQUE
#define PT_VALUE_GET_BYTES(node)
DB_AUTH pt_auth_to_db_auth(const PT_NODE *auth)
PT_TABLE_OPTION_TYPE option
void db_free_query(DB_SESSION *session)
static int execute_create_select_query(PARSER_CONTEXT *parser, const char *const class_name, PT_NODE *create_select, PT_CREATE_SELECT_ACTION create_select_action, DB_QUERY_TYPE *query_columns, PT_NODE *flagged_statement)
PT_CREATE_SELECT_ACTION create_select_action
PT_CREATE_ENTITY_INFO create_entity
#define SM_IS_CONSTRAINT_INDEX_FAMILY(c)
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
PARSER_VARCHAR * pt_print_bytes(PARSER_CONTEXT *parser, const PT_NODE *node)
#define TP_DATETIME_AS_CHAR_LENGTH
struct pt_alter_info::@110 super
int sm_set_class_collation(MOP classop, int collation_id)
#define ER_OBJ_INVALID_ATTRIBUTE
DB_CTMPL * dbt_create_class(const char *name)
static int do_run_update_query_for_new_notnull_fields(PARSER_CONTEXT *parser, PT_NODE *alter, PT_NODE *attr_list, int attr_count, MOP class_mop)
#define TP_BIGINT_PRECISION
#define PT_IS_COLLECTION_TYPE(t)
const char * loader_commands
#define TP_DATETIMETZ_AS_CHAR_LENGTH
short db_value_is_in_workspace
int db_rename_class(MOP classop, const char *new_name)
SM_TEMPLATE * smt_edit_class_mop(MOP op, DB_AUTH db_auth_type)
struct pt_alter_info::@111::@120 user
int db_drop_user(DB_OBJECT *user)
int dbt_set_object_id(DB_CTMPL *def, DB_NAMELIST *id_list)
LC_FIND_CLASSNAME locator_reserve_class_names(const int num_classes, const char **class_names, OID *class_oids)
static int fetch_result(T_SRV_HANDLE *, int, int, char, int, T_NET_BUF *, T_REQ_INFO *)
int do_revoke(const PARSER_CONTEXT *parser, const PT_NODE *statement)
SM_ATTRIBUTE * class_attributes
PT_AUTO_INCREMENT_INFO auto_increment
static int do_alter_partitioning_pre(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
#define ER_CANNOT_HAVE_NOTNULL_DEFAULT_NULL
#define MSGCAT_SEMANTIC_INV_PREC
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int pr_clear_value(DB_VALUE *value)
void db_free_query_format(DB_QUERY_TYPE *q)
DB_CTMPL * dbt_edit_class(MOP classobj)
#define ER_ALTER_CHANGE_TYPE_WITH_AUTO_INCR
#define TP_TIME_AS_CHAR_LENGTH
#define UNIQUE_SAVEPOINT_CREATE_ENTITY
#define UNIQUE_SAVEPOINT_CREATE_USER_ENTITY
void pt_copy_statement_flags(PT_NODE *source, PT_NODE *destination)
static int sort_constr_info_list(SM_CONSTRAINT_INFO **source)
#define ER_CANNOT_GET_LOCK
int sm_set_class_tde_algorithm(MOP classop, TDE_ALGORITHM tde_algo)
SM_INDEX_STATUS index_status
DB_DOMAIN * db_attribute_domain(DB_ATTRIBUTE *attribute)
#define ER_ALTER_CHANGE_TYPE_NOT_SUPP
bool is_cascade_constraints
struct db_domain_info::general_info general_info
SM_RESOLUTION * resolutions
DB_METHOD * db_get_method(DB_OBJECT *obj, const char *name)
static PT_NODE * get_attribute_with_name(PT_NODE *atts, const char *name)
DB_DEFAULT_EXPR_TYPE on_update
static SM_FUNCTION_INFO * compile_partition_expression(PARSER_CONTEXT *parser, PT_NODE *entity_name, PT_NODE *pinfo)
PT_NODE * parser_append_node(PT_NODE *node, PT_NODE *list)
char * pt_short_print(PARSER_CONTEXT *parser, const PT_NODE *node)
int dbt_add_method(DB_CTMPL *def, const char *name, const char *implementation)
SM_CLASS_CONSTRAINT * constraints
int dbt_add_query_spec(DB_CTMPL *def, const char *query)
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)
PT_NODE * parser_new_node(PARSER_CONTEXT *parser, PT_NODE_TYPE node_type)
int set_put_element(DB_COLLECTION *set, int index, DB_VALUE *value)
static void error(const char *msg)
static SM_FUNCTION_INFO * pt_node_to_function_index(PARSER_CONTEXT *parser, PT_NODE *spec, PT_NODE *sort_spec, DO_INDEX do_index)
static int do_drop_att_constraints(MOP class_mop, SM_CONSTRAINT_INFO *constr_info_list)
int dbt_add_class_method(DB_CTMPL *def, const char *name, const char *implementation)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
static void reset_att_property_structure(SM_ATTR_PROP_CHG *attr_chg_properties)
void parser_free_node(const PARSER_CONTEXT *parser, PT_NODE *node)
#define DB_DEFAULT_PRECISION
const char * pt_data_type_to_db_domain_name(const PT_NODE *dt)
static int do_add_attribute(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *atts, PT_NODE *constraints, bool error_on_not_normal)
#define ER_SM_INVALID_DEF_CONSTRAINT_NAME_PARAMS
const unsigned char * pt_get_varchar_bytes(const PARSER_VARCHAR *string)
#define CHECK_PARTITION_SUBS
SM_CLASS_CONSTRAINT * classobj_find_class_index(SM_CLASS *class_, const char *name)
#define TP_TYPE_HAS_COLLATION(typeid)
#define HFID_IS_NULL(hfid)
bool db_value_is_null(const DB_VALUE *value)
#define SM_IS_INDEX_FAMILY(c)
#define ER_SM_FK_MYSQL_DIFFERENT
static int do_copy_indexes(PARSER_CONTEXT *parser, MOP classmop, SM_CLASS *src_class)
PT_NODE * referenced_class
PT_SORT_SPEC_INFO sort_spec
#define ER_AU_INVALID_USER
#define ER_LC_CLASSNAME_EXIST
static int do_alter_change_owner(PARSER_CONTEXT *const parser, PT_NODE *const alter)
SM_METHOD_FILE * method_files
int sm_partitioned_class_type(DB_OBJECT *classop, int *partition_type, char *keyattr, MOP **partitions)
#define ER_ALTER_CHANGE_TYPE_NEED_ROW_CHECK
void parser_free_tree(PARSER_CONTEXT *parser, PT_NODE *tree)
int do_add_methods(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *methods)
#define TP_INTEGER_PRECISION
#define SM_PROPERTY_PRIMARY_KEY
int xts_map_func_pred_to_stream(const FUNC_PRED *xasl_tree, char **xasl_stream, int *xasl_stream_size)
#define QSTR_IS_FIXED_LENGTH(s)
int pt_attr_check_default_cs_coll(PARSER_CONTEXT *parser, PT_NODE *attr, int default_cs, int default_coll)
SM_FOREIGN_KEY_ACTION delete_action
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)
int do_drop_user(const PARSER_CONTEXT *parser, const PT_NODE *statement)
PT_NODE * pt_resolve_names(PARSER_CONTEXT *parser, PT_NODE *statement, SEMANTIC_CHK_INFO *sc_info)
static int do_create_partition_constraint(PT_NODE *alter, SM_CLASS *root_class, SM_CLASS_CONSTRAINT *constraint, SM_PARTITION_ALTER_INFO *pinfo)
#define MSGCAT_SET_PARSER_SEMANTIC
void classobj_free_partition_info(SM_PARTITION *partition_info)
int er_errid_if_has_error(void)
#define ER_SM_ONLY_NORMAL_ATTRIBUTES
static int do_alter_clause_drop_index(PARSER_CONTEXT *const parser, PT_NODE *const alter)
int do_add_attributes(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_NODE *atts, PT_NODE *constraints, DB_QUERY_TYPE *create_select_columns)
PT_MISC_TYPE update_action
struct pt_constraint_info::@127::@130 unique
static int save_constraint_info_from_pt_node(SM_CONSTRAINT_INFO **save_info, const PT_NODE *const pt_constr)
#define free_and_init(ptr)
static bool is_att_prop_set(const int prop, const int value)
static int build_att_coll_change_map(TP_DOMAIN *curr_domain, TP_DOMAIN *req_domain, SM_ATTR_PROP_CHG *attr_chg_properties)
static const char * get_hard_default_for_type(PT_TYPE_ENUM type)
PT_RESOLUTION_INFO resolution
char * parser_print_tree_with_quotes(PARSER_CONTEXT *parser, const PT_NODE *node)
DB_METHOD * db_get_class_method(DB_OBJECT *obj, const char *name)
DB_CONSTRAINT_TYPE db_constraint_type(const DB_CONSTRAINT *constraint)
bool pt_is_function_index_expr(PARSER_CONTEXT *parser, PT_NODE *expr, bool report_error)
#define ER_SM_INVALID_INDEX_TYPE
#define ERROR2(error, code, arg1, arg2)
#define ER_OBJ_INVALID_ARGUMENTS
int dbt_drop_query_spec(DB_CTMPL *def, const int query_no)
#define ER_AUTO_INCREMENT_SINGLE_COL_AMBIGUITY
struct pt_constraint_info::@127::@129 not_null
enum intl_codeset INTL_CODESET
bool tr_set_execution_state(bool new_state)
int dbt_change_query_spec(DB_CTMPL *def, const char *new_query, const int query_no)
int sm_drop_index(MOP classop, const char *constraint_name)
bool prm_get_bool_value(PARAM_ID prm_id)
PT_ALTER_USER_INFO alter_user
SM_ATTRIBUTE ** attributes
MOP ws_find_class(const char *name)
#define ER_ALTER_CHANGE_MULTIPLE_PK
PRED_EXPR_WITH_CONTEXT * pt_to_pred_with_context(PARSER_CONTEXT *parser, PT_NODE *predicate, PT_NODE *spec)
#define ER_CREATE_AS_SELECT_NULL_TYPE
SM_FUNCTION_INFO * func_index_info
void * db_ws_alloc(size_t size)
static int do_check_fk_constraints_internal(DB_CTMPL *ctemplate, PT_NODE *constraints, bool is_partitioned)
static PT_NODE * pt_replace_names_index_expr(PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
int sm_drop_constraint(MOP classop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, bool class_attributes, bool mysql_index_name)
int db_query_set_copy_tplvalue(DB_QUERY_RESULT *result, int copy)
PT_NODE * method_def_list
SM_CLASS * sm_get_class_with_statistics(MOP classop)
SM_PREDICATE_INFO * filter_predicate
int serial_decache(OID *oid)
#define ER_ALTER_CHANGE_PARTITIONS
PT_NODE * method_file_list
#define TP_FLOATING_PRECISION_VALUE
#define ER_ALTER_PARTITIONS_FK_NOT_ALLOWED
static bool is_att_change_needed(const SM_ATTR_PROP_CHG *attr_chg_properties)
static int do_run_update_query_for_new_default_expression_fields(PARSER_CONTEXT *parser, PT_NODE *alter, PT_NODE *attr_list, int attr_count, MOP class_mop)
static int adjust_partition_range(DB_OBJLIST *objs)
char * parser_print_tree(PARSER_CONTEXT *parser, const PT_NODE *node)
#define DB_VALUE_TYPE(value)
static int do_recreate_renamed_class_indexes(const PARSER_CONTEXT *parser, const char *const old_class_name, const char *const class_name)
int dbt_rename(DB_CTMPL *def, const char *name, int class_namespace, const char *newname)
int xts_map_filter_pred_to_stream(const PRED_EXPR_WITH_CONTEXT *pred, char **pred_stream, int *pred_stream_size)
int db_make_null(DB_VALUE *value)
#define SM_PROPERTY_FOREIGN_KEY
#define DB_IS_NULL(value)
int do_update_maxvalue_of_auto_increment_serial(PARSER_CONTEXT *parser, MOP *serial_object, const char *class_name, PT_NODE *att)
int do_is_partitioned_subclass(int *is_partitioned, const char *classname, char *keyattr)
struct pt_alter_info::@111::@114 ch_attr_def
static int do_coalesce_partition_pre(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
static int do_alter_change_col_comment(PARSER_CONTEXT *const parser, PT_NODE *const alter)
#define ER_NOT_ALLOWED_ACCESS_TO_PARTITION
#define pt_is_set_type(n)
#define ER_SM_INVALID_CONSTRAINT
struct pt_constraint_info::@127::@128 primary_key
int sm_att_fk_constrained(MOP classop, const char *name)
DB_OBJECT * db_add_user(const char *name, int *exists)
char * strdup(const char *str)
void dbt_abort_class(DB_CTMPL *def)
int db_get_error(const DB_VALUE *value)
SM_INDEX_STATUS index_status
PT_TRUNCATE_INFO truncate
#define ER_PARTITION_WORK_FAILED
#define DB_MAX_VARNCHAR_PRECISION
int do_alter_index(PARSER_CONTEXT *parser, const PT_NODE *statement)
int ws_list_length(DB_LIST *list)
#define PT_INTERNAL_ERROR(parser, what)
static int do_promote_partition_by_name(const char *class_name, const char *part_num, char **partition_name)
#define TP_SMALLINT_PRECISION
int db_value_clear(DB_VALUE *value)
int db_make_int(DB_VALUE *value, const int num)
static int do_redistribute_partitions_data(const char *class_name, const char *keyname, char **promoted, int promoted_count, PT_ALTER_CODE alter_op, bool should_update, bool should_insert)
static int do_alter_index_rebuild(PARSER_CONTEXT *parser, const PT_NODE *statement)
int db_query_get_tuple_value(DB_QUERY_RESULT *result, int index, DB_VALUE *value)
static const char * get_attr_name(PT_NODE *attribute)
struct db_object * class_mop
int pt_coerce_value(PARSER_CONTEXT *parser, PT_NODE *src, PT_NODE *dest, PT_TYPE_ENUM desired_type, PT_NODE *elem_type_list)
#define pt_has_error(parser)
int db_revoke(MOP user, MOP class_mop, AU_TYPE auth)
MOP sm_find_class(const char *name)
int smt_find_attribute(SM_TEMPLATE *template_, const char *name, int class_attribute, SM_ATTRIBUTE **attp)
int dbt_add_method_file(DB_CTMPL *def, const char *name)
#define STATS_WITH_SAMPLING
PT_NODE * pt_domain_to_data_type(PARSER_CONTEXT *parser, DB_DOMAIN *domain)
int db_make_char(DB_VALUE *value, const int char_length, DB_CONST_C_CHAR str, const int char_str_byte_size, const int codeset, const int collation_id)
SM_CLASS_TYPE smt_get_class_type(SM_TEMPLATE *template_)
int smt_set_attribute_default(SM_TEMPLATE *template_, const char *name, int class_attribute, DB_VALUE *proposed_value, DB_DEFAULT_EXPR *default_expr)
int do_get_partition_keycol(char *keycol, MOP class_)
int sm_att_unique_constrained(MOP classop, const char *name)
#define TP_DOMAIN_CODESET(dom)
int dbt_change_method_implementation(DB_CTMPL *def, const char *name, int class_method, const char *newname)
#define PT_HAS_COLLATION(t)
static int do_remove_partition_pre(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
PT_CONSTRAINT_INFO constraint
char * ws_copy_string(const char *str)
static int do_alter_one_clause_with_template(PARSER_CONTEXT *parser, PT_NODE *alter)
static int do_alter_change_auto_increment(PARSER_CONTEXT *const parser, PT_NODE *const alter)
SM_RESOLUTION * class_resolutions
static int do_alter_partitioning_post(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
#define INTL_CAN_COERCE_CS(cs_from, cs_to)
int do_check_rows_for_null(MOP class_mop, const char *att_name, bool *has_nulls)
PT_NODE * pt_dbval_to_value(PARSER_CONTEXT *parser, const DB_VALUE *val)
SM_ATTRIBUTE * ordered_attributes
int pt_length_of_list(const PT_NODE *list)
struct parser_node::@132 flag
int db_add_member(DB_OBJECT *user, DB_OBJECT *member)
static int do_alter_index_status(PARSER_CONTEXT *parser, const PT_NODE *statement)
int dbt_change_domain(DB_CTMPL *def, const char *name, int class_attribute, const char *domain)
MOP do_get_serial_obj_id(DB_IDENTIFIER *serial_obj_id, DB_OBJECT *serial_class_mop, const char *serial_name)
static int do_create_partition(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
#define SM_PROPERTY_REVERSE_UNIQUE
DB_VALUE * pt_value_to_db(PARSER_CONTEXT *parser, PT_NODE *value)
#define UNIQUE_SAVEPOINT_REPLACE_VIEW
PT_DATA_DEFAULT_INFO data_default
int db_compile_and_execute_local(const char *CSQL_query, void *result, DB_QUERY_ERROR *query_error)
#define TP_DATE_AS_CHAR_LENGTH
int dbt_drop_method_file(DB_CTMPL *def, const char *name)
static int create_or_drop_index_helper(PARSER_CONTEXT *parser, const char *const constraint_name, const bool is_reverse, const bool is_unique, PT_NODE *spec, PT_NODE *column_names, PT_NODE *column_prefix_length, PT_NODE *filter_predicate, int func_index_pos, int func_index_args_count, PT_NODE *function_expr, PT_NODE *comment, DB_OBJECT *const obj, SM_INDEX_STATUS index_status, DO_INDEX do_index)
#define SM_PROPERTY_NOT_NULL
struct pt_alter_info::@111::@116 partition
union pt_constraint_info::@127 un
int do_recreate_func_index_constr(PARSER_CONTEXT *parser, SM_CONSTRAINT_INFO *constr, SM_FUNCTION_INFO *func_index_info, PT_NODE *alter, const char *src_cls_name, const char *new_cls_name)
int do_create_user(const PARSER_CONTEXT *parser, const PT_NODE *statement)
static int check_change_class_collation(PARSER_CONTEXT *parser, DB_CTMPL *ctemplate, PT_ALTER_INFO *alter, bool *need_update, int *collation_id)
int db_namelist_append(DB_NAMELIST **list, const char *name)
DB_SESSION_ERROR * db_get_errors(DB_SESSION *session)
PT_NODE * parser_walk_tree(PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE_WALK_FUNCTION pre_function, void *pre_argument, PT_NODE_WALK_FUNCTION post_function, void *post_argument)
static int do_promote_partition_list(PARSER_CONTEXT *parser, PT_NODE *alter, SM_PARTITION_ALTER_INFO *pinfo)
char keycol[DB_MAX_IDENTIFIER_LENGTH]
int dbt_drop_class_attribute(DB_CTMPL *def, const char *name)
#define PT_IS_NAME_NODE(n)
SM_ATTRIBUTE * attributes
static int do_alter_clause_add_index(PARSER_CONTEXT *const parser, PT_NODE *const alter)
int do_create_entity(PARSER_CONTEXT *parser, PT_NODE *node)
#define ER_OBJ_NOT_A_CLASS
#define TP_IS_CHAR_BIT_TYPE(typeid)
int db_drop_class_ex(MOP class_, bool is_cascade_constraints)
int do_alter_user(const PARSER_CONTEXT *parser, const PT_NODE *statement)
int au_set_user_comment(MOP user, const char *comment)
void tp_domain_free(TP_DOMAIN *dom)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
int db_statement_count(DB_SESSION *session)
int do_create_auto_increment_serial(PARSER_CONTEXT *parser, MOP *serial_object, const char *class_name, PT_NODE *att)
#define PT_ERRORmf(parser, node, setNo, msgNo, arg1)
static int do_rename_internal(const char *const old_name, const char *const new_name)
#define ER_IS_ABORTED_DUE_TO_DEADLOCK(err)
int db_add_constraint(MOP classmop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, int class_attributes)
#define ER_ALTER_CHANGE_TYPE_UPGRADE_CFG
PT_CREATE_USER_INFO create_user
int do_drop_partition_list(MOP class_, PT_NODE *name_list, DB_CTMPL *tmpl)
PT_NODE * constraint_list
int sm_rename_class(MOP op, const char *new_name)
#define ER_AU_MISSING_OR_INVALID_USER
int classobj_drop_prop(DB_SEQ *properties, const char *name)
static SM_FOREIGN_KEY_ACTION map_pt_to_sm_action(const PT_MISC_TYPE action)
#define UNIQUE_SAVEPOINT_ALTER_USER_ENTITY
int sm_delete_class_mop(MOP op, bool is_cascade_constraints)
int sm_update_class(SM_TEMPLATE *template_, MOP *classmop)
int db_find_user_to_drop(const char *name, DB_OBJECT **user)
SM_INDEX_STATUS index_status
int sm_set_class_flag(MOP classop, SM_CLASS_FLAG flag, int on_or_off)
#define DB_MAX_CHAR_PRECISION
DB_OBJLIST * db_get_subclasses(DB_OBJECT *obj)
EXECUTION_STATE_VALUES execution_values
PT_NODE * pt_node_list(PARSER_CONTEXT *parser_ptr, PT_MISC_TYPE list_type, PT_NODE *list)
#define ER_ALTER_CHANGE_FK
void sm_free_function_index_info(SM_FUNCTION_INFO *func_index_info)