78 #if defined (SUPPRESS_STRLEN_WARNING) 79 #define strlen(s1) ((int) strlen(s1)) 82 #define SM_ADD_CONSTRAINT_SAVEPOINT_NAME "aDDcONSTRAINT" 83 #define SM_ADD_UNIQUE_CONSTRAINT_SAVEPOINT_NAME "aDDuNIQUEcONSTRAINT" 84 #define SM_DROP_CLASS_MOP_SAVEPOINT_NAME "dELETEcLASSmOP" 85 #define SM_TRUNCATE_SAVEPOINT_NAME "SmtRUnCATE" 136 #define WC_PERIOD L'.' 218 static const char *method_file_extension =
".dll";
220 static const char *method_file_extension =
".sl";
221 #elif defined (SOLARIS) || defined(LINUX) 222 static const char *method_file_extension =
".so";
223 #elif defined(sun) || defined(AIX) 224 static const char *method_file_extension =
".o";
226 #error "Unknown machine type." 229 #if !defined(WINDOWS) 235 #if defined (ENABLE_UNUSED_FUNCTION) 271 #if defined (ENABLE_UNUSED_FUNCTION) 287 #if !defined(WINDOWS) 291 #if defined (sun) || defined(SOLARIS) || defined(LINUX) || defined(AIX) 292 #if defined(SOLARIS) || defined(LINUX) || defined(AIX) 293 static int sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files);
295 static int sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands);
298 static int sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands);
299 #elif defined(WINDOWS) 300 static HINSTANCE load_dll (
const char *
name);
301 static int sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands);
355 const int *prefix_lengths,
int func_col_id,
TP_DOMAIN * func_domain);
357 int *n_classes,
int n_attrs,
OID * oids,
int *attr_ids,
HFID * hfids);
359 const int *asc_desc,
const int *attrs_prefix_length,
int unique_pk,
int not_null,
360 int reverse,
const char *constraint_name,
BTID *
index,
OID * fk_refcls_oid,
366 OID * pk_cls_oid,
BTID * pk_btid,
char *fk_name);
395 bool needs_hierarchy_lock);
399 const int *asc_desc);
405 #if defined (WINDOWS) 406 static void sm_method_final (
void);
410 const char *constraint_name,
const char **att_names,
const int *asc_desc,
426 static int sm_truncate_using_destroy_heap (
MOP class_mop);
429 #if defined(CUBRID_DEBUG) 430 static void sm_print (
MOP classmop);
433 #if defined(ENABLE_UNUSED_FUNCTION) 435 static TP_DOMAIN *sm_get_set_domain (
MOP classop,
int att_id);
437 static DB_OBJLIST *sm_get_all_classes (
int external_list);
438 static DB_OBJLIST *sm_get_base_classes (
int external_list);
439 static const char *sm_get_class_name_internal (
MOP op,
bool return_null);
440 static const char *sm_get_class_name (
MOP op);
441 static const char *sm_get_class_name_not_null (
MOP op);
442 static int sm_update_trigger_cache (
DB_OBJECT * class_,
const char *attribute,
int class_attribute,
void *cache);
443 static const char *sc_current_schema_name (
void);
444 static int sm_object_disk_size (
MOP op);
446 static int sm_get_att_domain (
MOP op,
const char *
name,
TP_DOMAIN ** domain);
447 static const char *sm_type_name (
DB_TYPE id);
451 const char *old_name,
const char *new_name);
483 Current_Schema.
name[0] =
'\0';
484 Current_Schema.
owner = user;
487 if (wsp_user_name ==
NULL)
508 #if defined(ENABLE_UNUSED_FUNCTION) 518 sc_current_schema_name (
void)
520 return (
const char *) &(Current_Schema.
name);
543 for (m = Static_method_table; m !=
NULL && found ==
NULL; m = m->
next)
545 if (strcmp (m->
name, name) == 0)
565 Static_method_table = new_;
568 new_->
name = (
char *) malloc (
strlen (name) + 1);
576 strcpy ((
char *) new_->
name, name);
594 for (m = Static_method_table; m !=
NULL && found ==
NULL; m = m->
next)
596 if (strcmp (m->
name, name) == 0)
613 Static_method_table = found->
next;
633 for (m = Static_method_table, next =
NULL; m !=
NULL; m =
next)
640 Static_method_table =
NULL;
661 if (strcmp (m->
name, name) == 0)
685 int tokens, chars, maxchars,
i;
695 for (i = 0; i < (int)
strlen (
string); i++)
705 if (chars > maxchars)
711 if (maxcharp !=
NULL)
713 *maxcharp = maxchars;
732 int tokens, maxchars,
i, j;
744 buf = (
char *)
db_ws_alloc (
sizeof (
char) * (maxchars + 1));
752 commands = (
char **)
db_ws_alloc (
sizeof (
char *) * (tokens + 1));
753 if (commands ==
NULL)
761 ptr = (
char *)
string;
762 for (i = 0; i < tokens && error ==
NO_ERROR; i++)
767 for (j = 0; *ptr !=
'\0' && !
char_isspace (*ptr); ptr++, j++)
776 commands[
i] = (
char *) new_;
795 *command_p = (
const char **) commands;
813 if (commands !=
NULL)
815 for (i = 0; commands[
i] !=
NULL; i++)
836 for (link = links; link !=
NULL; link =
next)
979 char filebuf[PATH_MAX];
997 strcat (filebuf, method_file_extension);
1001 if (strcmp (filebuf, f->
name) != 0)
1035 #if !defined(WINDOWS) 1041 struct nlist *namelist;
1043 const char **fnames;
1056 fnames = (
const char **)
db_ws_alloc (
sizeof (
char *) * nlinks);
1064 for (i = 0; i < nlinks; i++)
1077 #if defined(sun) && !defined(SOLARIS) 1085 if (strcmp (fname, fnames[i]) == 0)
1097 fnames[index++] = new_;
1112 if (namelist ==
NULL)
1119 for (i = 0; i <
index; i++)
1121 namelist[
i].n_name = (
char *) fnames[i];
1133 *nlist_p = namelist;
1151 if (namelist !=
NULL)
1153 for (i = 0; namelist[
i].n_name !=
NULL; i++)
1177 #if defined (sun) || defined(SOLARIS) || defined(LINUX) || defined(AIX) 1178 #if defined(SOLARIS) || defined(LINUX) || defined(AIX) 1180 sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files)
1183 sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands)
1188 struct nlist *namelist, *nl;
1196 #if defined(SOLARIS) || defined(LINUX) || defined(AIX) 1197 status = dl_load_object_module (files, &msg);
1199 status = dl_load_object_module (files, &msg, commands);
1209 status = dl_resolve_object_symbol (namelist);
1226 for (ml = links; ml !=
NULL; ml = ml->
next)
1229 if (nl->n_type == (
N_TEXT | N_EXT))
1250 sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands)
1254 struct nlist *namelist, *nl;
1263 status = dl_load_object_module (files, &msg, commands);
1272 status = dl_resolve_object_symbol (namelist);
1289 for (ml = links; ml !=
NULL; ml = ml->
next)
1292 if (nl->n_type == (ST_ENTRY))
1310 #elif defined(WINDOWS) 1314 typedef struct pc_dll
1316 struct pc_dll *next;
1322 static PC_DLL *pc_dll_list =
NULL;
1334 load_dll (
const char *name)
1342 for (dll = pc_dll_list; dll !=
NULL && strcmp (name, dll->name) != 0; dll = dll->next);
1346 handle = dll->handle;
1352 handle = LoadLibrary (name);
1357 dll = (PC_DLL *) malloc (
sizeof (PC_DLL) +
strlen (name) + 2);
1361 FreeLibrary (handle);
1366 dll->next = pc_dll_list;
1369 dll->name = (
char *) dll +
sizeof (PC_DLL);
1370 strcpy (dll->name, name);
1385 sm_method_final (
void)
1389 for (dll = pc_dll_list, next =
NULL; dll !=
NULL; dll = next)
1392 FreeLibrary (dll->handle);
1407 sm_link_dynamic_methods (
METHOD_LINK * links,
const char **files,
const char **commands)
1409 char filebuf[PATH_MAX];
1414 HINSTANCE libhandle;
1427 if (
strlen (file) + 3 < PATH_MAX)
1430 strcpy (filebuf, file);
1432 for (j =
strlen (file) - 1; j > 0 && filebuf[j] !=
'.'; j--)
1437 strcpy (&filebuf[j],
".dll");
1442 strcat (filebuf,
".dll");
1447 libhandle = load_dll (filebuf);
1448 if (libhandle !=
NULL)
1451 for (ml = links; ml !=
NULL; ml = ml->
next)
1461 func = GetProcAddress (libhandle, fname);
1465 strcpy (fname,
"_");
1467 func = GetProcAddress (libhandle, fname);
1498 #error "Unknown machine type for link_dynamic_methods" 1517 return (plen > elen) && (strcmp (&(path[plen - elen]), ext) == 0);
1535 char **names =
NULL, **sorted_names =
NULL, **commands =
NULL;
1546 names = (
char **)
db_ws_alloc (
sizeof (
char *) * (nfiles + 1));
1554 sorted_names = (
char **)
db_ws_alloc (
sizeof (
char *) * (nfiles + 1));
1555 if (sorted_names ==
NULL)
1571 for (file = files, i = 0; file !=
NULL; file = file->next, i++)
1573 if (file->expanded_name !=
NULL)
1575 names[
i] = (
char *) file->expanded_name;
1579 names[
i] = (
char *) file->name;
1582 names[nfiles] =
NULL;
1587 for (i = 0; i < nfiles; i++)
1591 sorted_names[psn++] = names[
i];
1594 for (i = 0; i < nfiles; i++)
1598 sorted_names[psn++] = names[
i];
1601 sorted_names[nfiles] =
NULL;
1605 #if defined(SOLARIS) || defined(LINUX) || defined(AIX) 1606 error = sm_link_dynamic_methods (links, (
const char **) sorted_names);
1608 error = sm_link_dynamic_methods (links, (
const char **) sorted_names, (
const char **) commands);
1610 if (commands !=
NULL)
1825 names = (
char **)
db_ws_alloc (
sizeof (
char *) * (nfiles + 1));
1833 for (i = 0, name = filenames; name !=
NULL; name = name->
next, i++)
1835 names[
i] = (
char *) name->
name;
1837 names[nfiles] =
NULL;
1840 #if defined(SOLARIS) || defined(LINUX) || defined(AIX) 1841 error = sm_link_dynamic_methods (total_links, (
const char **) names);
1843 error = sm_link_dynamic_methods (total_links, (
const char **) names,
NULL);
1852 for (cl = classes; cl !=
NULL; cl = cl->
next)
1883 #if defined(WINDOWS) 1892 const char *filename;
1898 sprintf (fname,
"%s",
function);
1900 sprintf (fname,
"_%s",
function);
1903 nl[0].n_name = fname;
1904 nl[1].n_name =
NULL;
1910 for (files = class->method_files; files !=
NULL && found ==
NULL; files = files->next)
1912 if (files->expanded_name !=
NULL)
1914 filename = files->expanded_name;
1918 filename = files->name;
1921 status =
nlist (filename, &nl[0]);
1922 if (nl[0].n_type != 0)
1954 #if defined(WINDOWS) 1962 const char *const_cfile;
1985 if (ofile[len - 1] ==
'o' && ofile[len - 2] ==
'.')
1989 cfile = (
char *) const_cfile;
1990 cfile[len - 1] =
'c';
2011 sm_Root_class_mop =
ws_mop (rootclass_oid,
NULL);
2023 sm_Descriptors =
NULL;
2085 #if defined(WINDOWS) 2093 for (d = sm_Descriptors, next =
NULL; d !=
NULL; d = next)
2143 if (name ==
NULL || name[0] ==
'\0')
2174 assert (name_size < maxlen);
2272 for (i = 0; i < lmops->
num; i++)
2356 for (i = 0; i < lmops->
num; i++)
2426 #if defined (ENABLE_UNUSED_FUNCTION) 2441 sm_get_all_classes (
int external_list)
2453 sm_get_base_classes (
int external_list)
2541 if (classmop !=
NULL)
2559 for (i = 0; i < lmops->
num; i++)
2571 new_->
next = objects;
2598 #if defined (ENABLE_UNUSED_FUNCTION) 2634 const char *current, *newname;
2636 int is_partition = 0;
2642 #if defined (ENABLE_UNUSED_FUNCTION) 2671 if (newname ==
NULL)
2685 class_->header.ch_name = newname;
2696 const char *class_name;
2704 if (class_name !=
NULL && (strcmp (current, class_name) == 0))
2763 for (i = 0; i < lmops->
num; i++)
2792 if (classop !=
NULL)
2811 #if defined(ENABLE_UNUSED_FUNCTION) 2814 sm_mark_system_class_for_catalog (
void)
2820 const char *classes[] = {
2834 for (i = 0; classes[
i] !=
NULL; i++)
2861 if (classop !=
NULL)
2868 class_->
flags |= flag;
2872 class_->
flags &= ~flag;
2895 if (classop !=
NULL)
3077 int save, result = 0;
3121 int au_save, pcnt,
i;
3144 if (partitions ==
NULL && keyattr ==
NULL)
3164 if (keyattr || partitions)
3174 goto partition_failed;
3181 goto partition_failed;
3187 goto partition_failed;
3191 goto partition_failed;
3194 pcnt = psize.
data.
i;
3197 const char *
p =
NULL;
3202 goto partition_failed;
3217 subobjs = (
MOP *) malloc (
sizeof (
MOP) * (pcnt + 1));
3218 if (subobjs ==
NULL)
3220 goto partition_failed;
3222 memset (subobjs, 0,
sizeof (
MOP) * (pcnt + 1));
3224 for (objs = smclass->
users, i = 0; objs && i < pcnt; objs = objs->next)
3228 goto partition_failed;
3234 subobjs[i++] = objs->
op;
3237 *partitions = subobjs;
3280 result = class_->
flags & flag;
3304 for (i = 0; i < lmops->
num; i++)
3316 for (i = 0; i < lmops->
num; i++)
3408 if (dclass_mop == class_mop)
3494 MOP object_class_mop;
3527 if (object_class_mop !=
NULL)
3529 if (domain->
class_mop == object_class_mop)
3560 *dest_object = object;
3601 #if defined (ENABLE_UNUSED_FUNCTION) 3612 sm_get_set_domain (
MOP classop,
int att_id)
3789 if (classop !=
NULL)
3837 class_->
stats = stats;
3860 if (classop !=
NULL)
3880 class_->
stats = stats;
4033 const char *classes[] = {
4041 for (i = 0; classes[
i] != NULL && error ==
NO_ERROR; i++)
4113 if (attribute ==
NULL)
4129 #if defined(ENABLE_UNUSED_FUNCTION) 4142 sm_update_trigger_cache (
DB_OBJECT * classop,
const char *attribute,
int class_attribute,
void *cache)
4152 if (attribute ==
NULL)
4185 bool has_event_type_triggers =
false;
4230 if (!has_event_type_triggers)
4251 return ((has_event_type_triggers) ? 1 : 0);
4274 if (classop ==
NULL)
4291 *status_ptr = status;
4343 if (attribute ==
NULL)
4356 if (location !=
NULL)
4360 if (*location !=
NULL)
4368 if (*location ==
NULL)
4373 if (*location ==
NULL)
4439 if (attribute !=
NULL)
4442 if (classop != target_class)
4462 if (!error && trigger !=
NULL)
4568 const char *name =
NULL;
4581 #if defined(ENABLE_UNUSED_FUNCTION) 4597 sm_get_class_name_internal (
MOP op,
bool return_null)
4600 const char *name =
NULL;
4610 name = class_->
header.name;
4616 return (name ? name : (return_null ?
NULL :
""));
4620 sm_get_class_name (
MOP op)
4622 return sm_get_class_name_internal (op,
true);
4626 sm_get_class_name_not_null (
MOP op)
4628 return sm_get_class_name_internal (op,
false);
4657 if (s->
op == supermop)
4742 #if defined(ENABLE_UNUSED_FUNCTION) 4752 sm_object_disk_size (
MOP op)
4787 #if defined(CUBRID_DEBUG) 4795 sm_print (
MOP classmop)
4801 classobj_print (class_);
4818 const char *ch_name =
NULL;
4826 #if !defined(NDEBUG) 4880 return ch_rep_dir_p;
4917 sm_get_ch_rep_dir (
MOP classmop)
4922 ch_rep_dir_p =
NULL;
4931 return ch_rep_dir_p;
4962 bool has_indexes =
false;
4977 #if defined(ENABLE_UNUSED_FUNCTION) 4991 int has_constraint = 0;
4996 if (att->
flags & constraint)
5003 return has_constraint;
5112 #if defined(ENABLE_UNUSED_FUNCTION) 5123 sm_get_att_domain (
MOP op,
const char *name,
TP_DOMAIN ** domain)
5149 const char *name =
NULL;
5214 #if defined(ENABLE_UNUSED_FUNCTION) 5334 bool force_local_index =
false;
5348 force_local_index =
true;
5351 if (unique_index_only)
5370 if (unique_index_only)
5381 if (force_local_index && is_global)
5399 for (i = 0; i < num_atts; i++)
5408 if (att2 ==
NULL || att1->
id != att2->
id)
5522 rc = att->
flags & cons;
5570 if (classobj !=
NULL)
5587 for (subclass = class_->
users; !rc && subclass !=
NULL; subclass = subclass->
next)
5679 int buf_size, buf_len = 0, buf_malloced = 0, uniques = 0;
5680 char *bufp, *buf_start;
5700 buf_size = buf_size * 2;
5703 buf_start = (
char *) realloc (buf_start, buf_size);
5704 if (buf_start ==
NULL)
5709 goto error_class_check_uniques;
5714 buf_start = (
char *) malloc (buf_size);
5715 if (buf_start ==
NULL)
5719 goto error_class_check_uniques;
5721 memcpy (buf_start, buffer, buf_len);
5724 bufp = buf_start + buf_len;
5745 error_class_check_uniques:
5782 #if defined (ENABLE_UNUSED_FUNCTION) 5799 if (!
ml_find (exceptions, op))
5833 error = lock_query_subclasses (subclasses, u->
op, exceptions, update);
5837 for (l = *subclasses, found =
NULL; l !=
NULL && found ==
NULL; l = l->
next)
5853 new_->
next = *subclasses;
5872 sm_query_lock (
MOP classop,
DB_OBJLIST * exceptions,
int only,
int update)
5879 if (classop !=
NULL)
5906 if (!
ml_find (exceptions, classop))
5919 error = lock_query_subclasses (&classes, u->
op, exceptions, update);
5928 classes = sm_get_all_classes (0);
5986 class_list.
op = class_mop;
5995 if (class_obj ==
NULL)
5998 if (class_obj ==
NULL)
6011 for (obj = &class_list; obj !=
NULL; obj = obj->
next)
6021 for (obj = &class_list; obj !=
NULL; obj = obj->
next)
6118 if (obj_class_mop ==
NULL)
6130 if (obj_class_mop ==
NULL)
6271 if (new_nested_view ==
NULL)
6347 bool recache =
false;
6354 (void)
ws_pin (class_object, 1);
6485 if (class_attribute)
6532 if (!error && att !=
NULL)
6555 sm_Descriptors = desc;
6595 if (!error && method !=
NULL)
6614 sm_Descriptors = desc;
6634 for (d = sm_Descriptors, prev =
NULL; d != desc; d = d->
next)
6644 sm_Descriptors = d->
next;
6674 for (d = sm_Descriptors; d !=
NULL; d = d->
next)
6684 for (d = sm_Descriptors; d !=
NULL; d = d->
next)
6766 int class_component;
6819 *comp_ptr = d->
comp;
6861 *class_ptr = class_;
6870 #if defined (ENABLE_UNUSED_FUNCTION) 6878 sm_has_text_domain (
DB_ATTRIBUTE * attributes,
int check_all)
6924 name =
template_->name;
6944 const char *name =
NULL;
6954 name =
template_->name;
6956 else if (template_->
op !=
NULL)
6988 if (classop !=
NULL)
7006 else if (temp !=
NULL)
7013 for (el = super_list; el !=
NULL && !status; el = el->
next)
7015 if (el->
op == super)
7025 for (el = super_list; el !=
NULL && !status; el = el->
next)
7327 if (candidate !=
NULL)
7333 candidate->
source = source;
7334 candidate->
obj = comp;
7337 candidate->
order = 0;
7364 for (c = candidates, next =
NULL; c !=
NULL; c = next)
7387 head = *clist_pointer;
7423 new_->
order = order;
7424 new_->
next = *candlist;
7448 new_->
order = order;
7449 new_->
next = *candlist;
7559 int att_order, meth_order;
7589 for (comp = complist; comp !=
NULL; comp = comp->
next, att_order++)
7596 for (comp = complist; comp !=
NULL; comp = comp->
next, meth_order++)
7621 for (comp = complist; comp !=
NULL; comp = comp->
next, meth_order++)
7633 for (comp = complist; comp !=
NULL; comp = comp->
next, att_order++)
7640 for (comp = complist; comp !=
NULL; comp = comp->
next, meth_order++)
7649 for (comp = complist; comp !=
NULL; comp = comp->
next, att_order++)
7656 for (comp = complist; comp !=
NULL; comp = comp->
next, meth_order++)
7687 att_cand = meth_cand =
NULL;
7694 if (att_cand !=
NULL)
7703 if (meth_cand !=
NULL)
7731 normal = alias =
NULL;
7838 *most_specific = most;
7858 for (res = *resolutions; res !=
NULL && found ==
NULL; res = res->
next)
7879 res->
next = *resolutions;
7902 SM_CANDIDATE *winner, *c, *requested, *conflict, *local, *alias;
7929 for (c = candidates; c !=
NULL; c = c->
next)
7995 if (winner != requested || auto_resolve)
8014 if (local ==
NULL && winner != requested)
8040 if (local == winner)
8078 *winner_return = winner;
8082 *winner_return =
NULL;
8274 for (; mfile !=
NULL; mfile = mfile->
next)
8279 if (new_mfile ==
NULL)
8348 for (res = *reslist; res !=
NULL; res = next)
8435 if (deleted_class !=
NULL)
8437 for (res = *reslist, prev =
NULL, next =
NULL; res !=
NULL; res = next)
8557 for (res = *resolutions, prev =
NULL, next =
NULL; res !=
NULL && error ==
NO_ERROR; res = next)
8571 if (original !=
NULL)
8589 if (original !=
NULL)
8594 *resolutions = next;
8737 bool is_partition =
false;
8749 if (new_att->
id == -1)
8759 new_att->
id = found->
id;
8770 if (super_new !=
NULL)
8779 new_att->
id = found->
id;
8787 if (super_old !=
NULL)
8796 new_att->
id = found->
id;
8813 if (new_att->
id == -1)
8823 new_att->
id = found->
id;
8834 if (super_new !=
NULL)
8843 new_att->
id = found->
id;
8851 if (super_old !=
NULL)
8860 new_att->
id = found->
id;
8883 if (found !=
NULL && found->class != new->class)
8887 new->id = found->
id;
8930 if (flat_triggers ==
NULL)
8952 if (super_triggers !=
NULL)
8961 if (flat_triggers !=
NULL)
9025 goto structure_error;
9035 goto structure_error;
9056 goto structure_error;
9059 for (c = constraints; c !=
NULL; c = c->
next)
9069 if (attrs[0] !=
NULL)
9073 for (i = 0; ((attrs[
i] !=
NULL) && found_match); i++)
9100 int cnstr_exists = 0;
9106 c->
name, &cnstr_val);
9112 int is_global_index = 0;
9120 goto structure_error;
9126 goto structure_error;
9136 goto structure_error;
9148 int is_global_index = 0;
9153 goto structure_error;
9156 if (is_global_index == 1)
9167 goto structure_error;
9235 if (deleted_class !=
NULL)
9346 if (attribute->
id == -1)
9348 if (class_attribute)
9363 attribute->
id = attr->
id;
9389 if (method->
id == -1)
9409 if (method->
id == -1)
9435 while (atts !=
NULL)
9491 SM_ATTRIBUTE *fixed, *variable, *current, *new_att, *found, *next, *newatts;
9494 fixed = variable =
NULL;
9506 if (new_att->
id != -1)
9508 if (new_att->
id == current->
id)
9535 if (found->id == -1)
9538 found->
id = current->
id;
9542 found->header.next =
NULL;
9543 if (found->type->variable_p)
9555 if (newatts !=
NULL)
9558 for (new_att = newatts, next =
NULL; new_att !=
NULL; new_att = next)
9602 prev = found =
NULL;
9608 found->
id = supatt->
id;
9726 for (d = domain; d !=
NULL; d = d->
next)
9825 int func_col_id,
TP_DOMAIN * func_domain)
9834 if (n_atts == 1 && func_domain ==
NULL)
9836 if ((asc_desc && asc_desc[0] == 1)
9840 if (new_domain ==
NULL)
9845 if (asc_desc && asc_desc[0] == 1)
9864 cached_domain = atts[0]->
domain;
9867 else if ((n_atts > 1) || func_domain)
9872 for (i = 0; i < n_atts; i++)
9874 if (i == func_col_id)
9880 current = new_domain;
9884 current->
next = new_domain;
9885 current = new_domain;
9890 if (new_domain ==
NULL)
9911 if (asc_desc && asc_desc[i] == 1)
9923 current = new_domain;
9927 current->
next = new_domain;
9928 current = new_domain;
9932 if (i == func_col_id)
9938 current = new_domain;
9942 current->
next = new_domain;
9943 current = new_domain;
9947 if (set_domain ==
NULL)
9955 return cached_domain;
9962 for (td = head, next =
NULL; td !=
NULL; td = next)
9990 int n_attrs,
OID * oids,
int *attr_ids,
HFID * hfids)
9996 for (sub = subclasses; ((sub !=
NULL) && (error ==
NO_ERROR)); sub = sub->
next)
10006 flat = class_->
new_;
10056 attr_ptr = &attr_ids[(*n_classes) * n_attrs];
10057 for (i = 0; i < n_attrs; i++)
10110 const int *attrs_prefix_length,
int unique_pk,
int not_null,
int reverse,
const char *constraint_name,
10111 BTID *
index,
OID * fk_refcls_oid,
BTID * fk_refcls_pk_btid,
const char *fk_name,
10117 int *attr_ids =
NULL;
10118 size_t attr_ids_size;
10122 int max_classes, n_classes, has_instances;
10126 for (i = 0, n_attrs = 0; attrs[
i] !=
NULL; i++, n_attrs++)
10134 else if (attrs_prefix_length && attrs_prefix_length[i] >= 0)
10141 else if (((
long) attrs[i]->domain->
precision) < attrs_prefix_length[i])
10154 if (function_index)
10173 if (domain ==
NULL)
10184 for (sub = subclasses; sub !=
NULL; sub = sub->
next)
10190 attr_ids_size = max_classes * n_attrs *
sizeof (int);
10191 attr_ids = (
int *) malloc (attr_ids_size);
10192 if (attr_ids ==
NULL)
10198 oids = (
OID *) malloc (max_classes *
sizeof (
OID));
10205 hfids = (
HFID *) malloc (max_classes *
sizeof (
HFID));
10215 for (i = 0; i < n_attrs; i++)
10217 attr_ids[
i] = attrs[
i]->
id;
10224 if (unique_pk || (fk_refcls_oid !=
NULL && !
OID_ISNULL (fk_refcls_oid)))
10236 for (i = 0; i < n_classes; i++)
10256 if (function_index)
10258 error =
btree_load_index (index, constraint_name, domain, oids, n_classes, n_attrs, attr_ids,
10259 (
int *) attrs_prefix_length, hfids, unique_pk, not_null, fk_refcls_oid,
10267 error =
btree_load_index (index, constraint_name, domain, oids, n_classes, n_attrs, attr_ids,
10268 (
int *) attrs_prefix_length, hfids, unique_pk, not_null, fk_refcls_oid,
10284 if (attr_ids !=
NULL)
10315 for (con = cons; con !=
NULL; con = con->
next)
10323 if (ref_count == 1)
10367 BTID * pk_btid,
char *fk_name)
10371 int *attr_ids =
NULL;
10376 cls_oid =
ws_oid (classop);
10381 for (i = 0, n_attrs = 0; key_attrs[
i] !=
NULL; i++, n_attrs++);
10384 if (domain ==
NULL)
10390 attr_ids = (
int *) malloc (n_attrs *
sizeof (
int));
10391 if (attr_ids ==
NULL)
10397 for (i = 0; i < n_attrs; i++)
10399 attr_ids[
i] = key_attrs[
i]->
id;
10448 owner_clsop = ref_clsop;
10452 if (template_ ==
NULL)
10477 if (ref_clsop ==
NULL)
10490 #if defined (ENABLE_RENAME_CONSTRAINT) 10500 sm_rename_foreign_key_ref (
MOP ref_clsop,
const BTID *
btid,
const char *old_name,
const char *new_name)
10531 owner_clsop = ref_clsop;
10535 if (template_ ==
NULL)
10549 error = classobj_rename_foreign_key_ref (&(template_->
properties), btid, old_name, new_name);
10558 if (ref_clsop ==
NULL)
10583 int unique_pk, not_null, reverse;
10586 const int *asc_desc;
10601 while (attr !=
NULL && i < class_->att_count)
10608 while (key_attr !=
NULL)
10610 if (key_attr->
id == attr->
id)
10618 if (key_attr ==
NULL)
10640 if (is_global == 0)
10644 int is_global_cnst = 0;
10658 if (is_global_cnst)
10661 local_subclasses = subclasses;
10666 local_subclasses =
NULL;
10709 if (super_con !=
NULL)
10785 if (classop == ref_clsop)
10888 int num_indexes = 0;
10890 bool dont_decache_and_flush =
false;
10896 if (classop ==
NULL)
10905 if (!dont_decache_and_flush)
10909 goto structure_error;
10925 if (new_attributes ==
NULL)
10928 goto structure_error;
10937 new_attributes[att_count] =
NULL;
10953 goto structure_error;
10964 goto structure_error;
10978 goto structure_error;
10985 if (!dont_decache_and_flush)
11013 goto structure_error;
11021 goto structure_error;
11026 goto structure_error;
11031 goto structure_error;
11039 return num_indexes;
11061 char *saved_name =
NULL;
11062 int name_length = 0;
11066 name_length =
strlen ((*cons)->name) + 1;
11067 saved_name = (
char *) malloc (name_length);
11068 if (saved_name ==
NULL)
11075 strcpy (saved_name, (*cons)->name);
11111 if (saved_name !=
NULL)
11141 if (classop == ref_clsop)
11143 for (con = flat_cons; con !=
NULL; con = con->
next)
11185 owner_clsop = ref_clsop;
11189 if (refcls_template ==
NULL)
11210 if (ref_clsop ==
NULL)
11238 MOP origin_classop;
11243 if (origin_classop == classop)
11280 if (super_con ==
NULL)
11372 bool is_partitioned;
11374 MOP origin_classop;
11375 int is_global_index = 0;
11397 #if defined (ENABLE_RENAME_CONSTRAINT) 11403 if (new_con !=
NULL)
11407 if (!
BTID_IS_EQUAL (&con->index_btid, &new_con->index_btid))
11413 new_con->index_btid = con->index_btid;
11444 if (con->attributes[0] !=
NULL)
11456 if (new_con ==
NULL)
11472 origin_classop = con->attributes[0]->
class_mop;
11479 for (other_con = con->
next; other_con !=
NULL; other_con = other_con->
next)
11487 if (other_con ==
NULL)
11506 for (con = flat_constraints, prev =
NULL, next =
NULL; con !=
NULL; con = next)
11509 if (con->attributes[0] !=
NULL 11519 flat_constraints = con->
next;
11558 is_partitioned = (error ?
true :
false);
11560 for (con = flat_constraints; ((con !=
NULL) && (error ==
NO_ERROR)); con = con->
next)
11562 is_global_index = 0;
11581 for (con = flat_constraints; ((con !=
NULL) && (error ==
NO_ERROR)); con = con->
next)
11590 if (num_pk != 0 && (!is_partitioned || !
BTID_IS_NULL (&con->index_btid)))
11601 con->attrs_prefix_length, &(con->index_btid), con->filter_predicate,
11602 con->fk_info, con->shared_cons_name, con->func_index_info, con->comment,
11603 con->index_status,
false);
11614 con->attrs_prefix_length, &(con->index_btid), con->filter_predicate,
NULL,
NULL,
11615 con->func_index_info, con->comment, con->index_status,
false);
11636 if (flat_constraints !=
NULL)
11702 if (new_attr !=
NULL)
11721 if (new_attr !=
NULL)
11818 int needrep, newrep;
11822 if (classop ==
NULL)
11993 for (super = current; super !=
NULL; super = super->
next)
12088 for (super = oldsupers; ((super !=
NULL) && (error ==
NO_ERROR)); super = super->
next)
12098 for (super = newsupers; ((super !=
NULL) && (error ==
NO_ERROR)); super = super->
next)
12124 for (super = supers; super !=
NULL; super = super->
next)
12162 for (super = supers; ((super !=
NULL) && (error ==
NO_ERROR)); super = super->
next)
12251 new_->
next = *newsubs;
12267 for (sub = cursubs; ((sub !=
NULL) && (error ==
NO_ERROR)); sub = sub->
next)
12346 for (sub = subclasses; ((sub !=
NULL) && (error ==
NO_ERROR)); sub = sub->
next)
12358 if (utemplate ==
NULL)
12369 class_->new_ = flat;
12398 for (sub = subclasses; sub !=
NULL; sub = sub->
next)
12476 if (num_indexes < 0)
12479 error = num_indexes;
12517 const char *names[1];
12522 if (class_ !=
NULL)
12534 else if (temp !=
NULL)
12536 names[0] = temp->
name;
12600 DB_OBJLIST *cursupers, *oldsupers, *newsupers, *cursubs, *newsubs;
12631 if (needs_hierarchy_lock)
12641 if (class_ !=
NULL)
12646 error =
lock_supers (template_, cursupers, &oldsupers, &newsupers);
12655 if (class_ !=
NULL)
12657 class_->
new_ = template_;
12673 if (needs_hierarchy_lock)
12676 if (class_ !=
NULL)
12678 cursubs = class_->
users;
12696 if (class_ !=
NULL)
12698 class_->
new_ = flat;
12721 if (class_ ==
NULL)
12724 if (class_ ==
NULL)
12764 if (template_->
op ==
NULL)
12797 if (num_indexes < 0)
12799 error = num_indexes;
12816 if (classmop !=
NULL)
12818 *classmop =
template_->op;
12888 return update_class (template_, classmop, 0, auth, needs_hierarchy_lock);
12971 if (fk_class_mop ==
NULL)
12979 if (template_ ==
NULL)
13026 int is_partition = 0, subdel = 0;
13028 char *fk_name =
NULL;
13029 const char *table_name;
13101 if (table_name ==
NULL)
13115 if (is_cascade_constraints)
13136 const char *class_name;
13145 OID *oidp, serial_obj_id;
13171 if (template_ ==
NULL)
13181 if (oldsupers ==
NULL)
13316 if (oldsupers !=
NULL)
13320 if (oldsubs !=
NULL)
13340 #if defined(ENABLE_UNUSED_FUNCTION) 13348 sm_delete_class (
const char *name)
13354 if (classop ==
NULL)
13424 const int *asc_desc,
const int *attrs_prefix_length,
SM_PREDICATE_INFO * filter_index,
13430 int i, n_attrs, is_partition = 0, savepoint_index = 0;
13434 const char *class_name;
13435 const char *partition_name;
13436 int use_prefix_length;
13439 char *out_shared_cons_name =
NULL;
13454 sm_check_index_exist (classop, &out_shared_cons_name, db_constraint_type, constraint_name, attnames, asc_desc,
13455 filter_index, function_index);
13470 if (is_partition == 1)
13472 if (attrs_prefix_length)
13476 for (i = 0; attnames[
i] !=
NULL; i++)
13481 use_prefix_length =
false;
13482 for (i = 0; i < n_attrs; i++)
13484 if (attrs_prefix_length[i] != -1)
13486 use_prefix_length =
true;
13491 if (use_prefix_length)
13504 savepoint_index = 1;
13505 if (function_index)
13521 for (i = 0; error ==
NO_ERROR && sub_partitions[
i]; i++)
13539 if (function_index)
13542 if (class_name ==
NULL)
13550 if (partition_name ==
NULL)
13566 new_func_index_info =
NULL;
13572 if (new_filter_index_info->
num_attrs > 0)
13575 if (class_name ==
NULL)
13583 if (partition_name ==
NULL)
13600 new_filter_index_info =
NULL;
13604 sm_add_index (sub_partitions[i], db_constraint_type, constraint_name, attnames, asc_desc,
NULL,
13605 new_filter_index_info, new_func_index_info, comment);
13608 if (new_func_index_info)
13613 if (new_filter_index_info)
13625 if (sub_partitions)
13634 for (i = 0; attnames[
i] !=
NULL; i++)
13646 goto general_error;
13650 for (i = 0; i < n_attrs; i++)
13657 goto general_error;
13662 goto general_error;
13664 #if defined (ENABLE_UNUSED_FUNCTION) 13665 if (sm_has_text_domain (attrs[i], 0))
13671 goto general_error;
13676 attrs[n_attrs] =
NULL;
13684 goto general_error;
13687 if (out_shared_cons_name)
13700 error =
allocate_index (classop, class_,
NULL, attrs, asc_desc, attrs_prefix_length, 0 ,
13701 false, reverse_index, constraint_name, &index,
NULL,
NULL,
NULL, filter_index,
13717 attrs_prefix_length, &index, filter_index,
NULL, out_shared_cons_name, function_index,
13766 if (sub_partitions)
13770 if (out_shared_cons_name)
13774 if (new_func_index_info)
13779 if (new_filter_index_info)
13792 if (out_shared_cons_name)
13796 if (new_func_index_info)
13801 if (new_filter_index_info)
13827 if (out_shared_cons_name)
13831 if (new_func_index_info)
13836 if (new_filter_index_info)
13874 int i, is_partition = 0, savepoint_index = 0;
13889 if (is_partition == 1)
13897 savepoint_index = 1;
13898 for (i = 0; sub_partitions[
i]; i++)
13904 error =
sm_drop_index (sub_partitions[i], constraint_name);
13912 if (sub_partitions)
13983 if (sub_partitions)
14037 *index = con->
index;
14084 const int *asc_desc)
14086 #define MAX_ATTR_IN_AUTO_GEN_NAME 30 14089 int name_length = 0;
14096 if ((class_name ==
NULL) || (att_names ==
NULL))
14102 const char *prefix;
14106 char md5_str[32 + 1] = {
'\0' };
14140 name_length =
strlen (prefix);
14141 name_length +=
strlen (class_name);
14143 for (ptr = att_names; *ptr !=
NULL; ptr++)
14149 for (ptr = att_names; (*ptr !=
NULL) && (i < n_attrs); ptr++, i++)
14159 if (asc_desc[i] == 1)
14167 name_length += (1 + ptr_size);
14179 char *name_all =
NULL;
14183 name_all = (
char *) malloc (name_length + 1);
14184 if (name_all ==
NULL)
14189 strcpy (name_all, class_name);
14190 for (ptr = att_names, i = 0; i < n_attrs; ptr++, i++)
14192 strcat (name_all, *ptr);
14195 strcat (name_all,
"d");
14211 att_name_prefix_size = size_class_and_attrs / (n_attrs + 1);
14212 class_name_prefix_size = att_name_prefix_size;
14214 if (
strlen (class_name) < class_name_prefix_size)
14216 class_name_prefix_size =
strlen (class_name);
14222 strncpy (class_name_trunc, class_name, class_name_prefix_size);
14223 class_name_trunc[class_name_prefix_size] =
'\0';
14234 class_name_prefix_size =
strlen (class_name_trunc);
14238 att_name_prefix_size = ((size_class_and_attrs - class_name_prefix_size) / n_attrs) - 1;
14244 name = (
char *) malloc (name_length + 1);
14248 strcpy (name, prefix);
14251 strncat (name, class_name, class_name_prefix_size);
14257 for (ptr = att_names; k < n_attrs; ptr++, i++)
14265 if (asc_desc[i] == 1)
14272 strcat (name,
"_");
14281 strcat (name,
"_d");
14293 assert (att_name_prefix_size > 2);
14301 strcat (att_name_trunc,
"_d");
14314 strcat (name, att_name_trunc);
14322 strcat (name,
"_");
14323 strcat (name, md5_str);
14337 #undef MAX_ATTR_IN_AUTO_GEN_NAME 14364 const int *asc_desc,
const char *given_name)
14369 if (given_name ==
NULL)
14376 name = (
char *) malloc (name_size + 1);
14403 const int *asc_desc,
const char *given_name)
14420 const int *asc_desc,
const char *given_name)
14440 const char *constraint_name,
const char **att_names,
const int *asc_desc,
14458 constraint_type, constraint_name, att_names, asc_desc, filter_index, func_info);
14463 const char *constraint_name,
const char **att_names,
const int *asc_desc,
14464 const int *attrs_prefix_length,
int class_attributes,
14469 bool set_savept =
false;
14472 const char *class_name, *partition_name;
14486 if (function_index !=
NULL)
14495 if (filter_index !=
NULL)
14504 for (i = 0; error ==
NO_ERROR && sub_partitions[
i]; i++)
14509 if (class_name ==
NULL)
14521 if (function_index !=
NULL)
14524 if (class_name ==
NULL)
14531 if (partition_name ==
NULL)
14545 if (filter_index !=
NULL)
14548 if (new_filter_index_info->
num_attrs > 0)
14551 if (class_name ==
NULL)
14558 if (partition_name ==
NULL)
14572 error =
sm_add_constraint (sub_partitions[i], constraint_type, constraint_name, att_names, asc_desc,
14573 attrs_prefix_length, class_attributes, new_filter_index_info, new_func_index_info,
14574 comment, index_status);
14582 if (new_func_index_info !=
NULL)
14587 if (new_filter_index_info !=
NULL)
14619 const int *asc_desc,
const int *attrs_prefix_length,
int class_attributes,
14626 bool needs_hierarchy_lock;
14627 bool set_savepoint =
false;
14628 int partition_type;
14631 if (att_names ==
NULL)
14637 switch (constraint_type)
14645 bool is_secondary_index;
14652 set_savepoint =
true;
14656 if (is_secondary_index)
14665 #if defined (SA_MODE) 14690 char *shared_cons_name =
NULL;
14692 error =
smt_check_index_exist (def, &shared_cons_name, constraint_type, constraint_name, att_names,
14693 asc_desc, filter_index, function_index);
14702 if (shared_cons_name !=
NULL)
14731 if (sub_partitions !=
NULL)
14741 if (is_secondary_index)
14746 for (
int i = 0; attrs_prefix_length !=
NULL && att_names[
i] !=
NULL;
i++)
14748 if (attrs_prefix_length[
i] != -1)
14753 if (sub_partitions !=
NULL)
14763 asc_desc, attrs_prefix_length, class_attributes,
14764 filter_index, function_index, comment, index_status,
14768 if (sub_partitions !=
NULL)
14778 if (sub_partitions !=
NULL)
14783 error =
smt_add_constraint (def, constraint_type, constraint_name, att_names, asc_desc, attrs_prefix_length,
14784 class_attributes,
NULL, filter_index, function_index, comment, index_status);
14848 error =
smt_add_constraint (def, constraint_type, constraint_name, att_names, asc_desc, attrs_prefix_length,
14849 class_attributes,
NULL, filter_index, function_index, comment, index_status);
14905 const char **att_names,
bool class_attributes,
bool mysql_index_name)
14923 if (constraint !=
NULL 14932 switch (constraint_type)
15048 if (save_info ==
NULL || *save_info ==
NULL)
15054 while (info !=
NULL)
15057 char **crt_name_p =
NULL;
15059 for (crt_name_p = info->
att_names; *crt_name_p !=
NULL; ++crt_name_p)
15067 for (crt_name_p = info->
ref_attrs; *crt_name_p !=
NULL; ++crt_name_p)
15156 if (new_constraint ==
NULL)
15176 for (crt_att_p = c->
attributes, num_atts = 0; *crt_att_p !=
NULL; ++crt_att_p)
15182 new_constraint->
att_names = (
char **) calloc (num_atts + 1,
sizeof (
char *));
15190 for (crt_att_p = c->
attributes, i = 0; *crt_att_p !=
NULL; ++crt_att_p, ++i)
15192 const char *
const attr_name = (*crt_att_p)->header.name;
15207 new_constraint->
asc_desc = (
int *) calloc (num_atts,
sizeof (
int));
15214 for (i = 0; i < num_atts; ++
i)
15224 new_constraint->
prefix_length = (
int *) calloc (num_atts,
sizeof (
int));
15231 for (i = 0; i < num_atts; ++
i)
15273 if (ref_clsop ==
NULL)
15295 if (pk_cons ==
NULL)
15303 new_constraint->
ref_attrs = (
char **) calloc (num_atts + 1,
sizeof (
char *));
15311 for (crt_att_p = pk_cons->
attributes, i = 0; *crt_att_p !=
NULL; ++crt_att_p, ++i)
15313 const char *
const attr_name = (*crt_att_p)->header.name;
15334 while ((*save_info) !=
NULL)
15336 save_info = &((*save_info)->next);
15338 *save_info = new_constraint;
15343 if (new_constraint !=
NULL)
15363 if (func_index_info !=
NULL)
15368 if (new_func_index_info ==
NULL)
15382 new_func_index_info->
expr_str = (
char *) calloc (len + 1,
sizeof (
char));
15400 new_func_index_info->
col_id = func_index_info->
col_id;
15404 *save_info = new_func_index_info;
15408 if (new_func_index_info !=
NULL)
15432 if (new_filter_index_info ==
NULL)
15439 new_filter_index_info->
pred_string = (
char *) calloc (len + 1,
sizeof (
char));
15465 new_filter_index_info->
att_ids = (
int *) calloc (filter_index_info->
num_attrs, sizeof (
int));
15472 for (i = 0; i < filter_index_info->
num_attrs; i++)
15480 *save_info = new_filter_index_info;
15484 if (new_filter_index_info !=
NULL)
15504 const char *class_name;
15505 bool save_tr_state;
15508 if (class_name ==
NULL)
15516 (void) snprintf (delete_query,
sizeof (delete_query),
"DELETE /*+ RECOMPILE */ FROM [%s];", class_name);
15519 if (session ==
NULL)
15550 if (session !=
NULL)
15568 sm_truncate_using_destroy_heap (
MOP class_mop)
15573 bool reuse_oid =
false;
15576 oid =
ws_oid (class_mop);
15608 error =
heap_create (insts_hfid, oid, reuse_oid);
15638 bool keep_pk =
false;
15722 if (fk_save_info !=
NULL)
15732 for (saved = fk_save_info; saved !=
NULL; saved = saved->
next)
15751 for (saved = unique_save_info; saved !=
NULL; saved = saved->
next)
15761 for (saved = index_save_info; saved !=
NULL; saved = saved->
next)
15777 error = sm_truncate_using_destroy_heap (class_mop);
15792 for (saved = index_save_info; saved !=
NULL; saved = saved->
next)
15804 for (saved = unique_save_info; saved !=
NULL; saved = saved->
next)
15824 for (saved = fk_save_info; saved !=
NULL; saved = saved->
next)
15861 if (unique_save_info !=
NULL)
15866 if (fk_save_info !=
NULL)
15871 if (index_save_info !=
NULL)
15885 if (unique_save_info !=
NULL)
15890 if (fk_save_info !=
NULL)
15895 if (index_save_info !=
NULL)
15917 for (i = 0; attrs[
i] !=
NULL; i++)
15943 int is_global_index = 0;
15947 if (template_ ==
NULL || super_class ==
NULL)
15980 for (c = old_constraints; c !=
NULL; c = c->
next)
15987 is_global_index = 0;
16001 if (new_con ==
NULL)
16082 if (filter_index_info->
att_ids)
16108 bool has_partition =
false;
16112 if (constraint ==
NULL)
16118 switch (constraint->
type)
16142 has_partition =
false;
16143 while (attr !=
NULL)
16147 has_partition =
true;
16154 if (has_partition ==
true 16162 if (template_ !=
NULL)
16200 for (subclass = class_->
users; subclass !=
NULL; subclass = subclass->
next)
16209 for (subclass = class_->
users; subclass !=
NULL; subclass = subclass->
next)
16217 if (*found ==
true)
16238 const char *old_name,
const char *new_name)
16241 int i, is_partition = 0;
16269 for (i = 0; sub_partitions[
i] != 0; i++)
16272 if (sub_ctemplate ==
NULL)
16287 if (sm_cons ==
NULL)
16294 if (old_name !=
NULL)
16322 #if defined (ENABLE_RENAME_CONSTRAINT) 16323 if (old_name !=
NULL && new_name !=
NULL)
16325 error = classobj_rename_foreign_key_ref (&sub_ctemplate->
properties, btid, old_name, new_name);
16337 if (fk_info !=
NULL)
16345 else if (btid !=
NULL)
16370 sub_ctemplate =
NULL;
16376 if (sub_partitions !=
NULL)
16387 if (sub_ctemplate !=
NULL)
16430 int i, n_attrs, n_classes, max_classes;
16433 int *attr_ids =
NULL;
16434 size_t attr_ids_size;
16449 subclasses = class_->
users;
16523 for (sub = subclasses; sub !=
NULL; sub = sub->
next)
16529 attr_ids_size = max_classes * n_attrs *
sizeof (int);
16530 attr_ids = (
int *) malloc (attr_ids_size);
16531 if (attr_ids ==
NULL)
16537 oids = (
OID *) malloc (max_classes *
sizeof (
OID));
16544 hfids = (
HFID *) malloc (max_classes *
sizeof (
HFID));
16554 for (i = 0; i < n_attrs; i++)
16561 for (sub = subclasses; sub !=
NULL; sub = sub->
next, n_classes++)
16572 for (
int j = 0; j < n_attrs; j++)
16574 attr_ids[n_classes * n_attrs + j] = con->
attributes[j]->
id;
16633 if (attr_ids !=
NULL)
16661 for (constr = constraint_list; constr !=
NULL; constr = constr->
next)
16671 if (constr ==
NULL)
16724 if (new_ptr ==
NULL)
struct tr_schema_cache * triggers
bool sm_has_indexes(MOBJ classobj)
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)
static bool sm_is_nested_view_recached(PARSER_CONTEXT *parser)
DB_OBJECT * db_find_class(const char *name)
static DB_OBJLIST * sm_fetch_all_objects_internal(DB_OBJECT *op, DB_FETCH_MODE purpose, LC_FETCH_VERSION_TYPE *force_fetch_version_type)
#define ER_LK_UNILATERALLY_ABORTED
static bool is_index_owner(MOP classop, SM_CLASS_CONSTRAINT *con)
int sm_is_subclass(MOP classmop, MOP supermop)
int btree_load_index(BTID *btid, const char *bt_name, TP_DOMAIN *key_type, OID *class_oids, int n_classes, int n_attrs, int *attr_ids, int *attrs_prefix_length, HFID *hfids, int unique_pk, int not_null_flag, OID *fk_refcls_oid, BTID *fk_refcls_pk_btid, const char *fk_name, char *pred_stream, int pred_stream_size, char *expr_stream, int expr_stream_size, int func_col_id, int func_attr_index_start, SM_INDEX_STATUS index_status)
#define OR_BTID_ALIGNED_SIZE
#define ER_SM_ATTRIBUTE_NOT_FOUND
int ml_append(DB_OBJLIST **list, MOP mop, int *added_ptr)
int tp_domain_disk_size(TP_DOMAIN *domain)
int btree_add_index(BTID *btid, TP_DOMAIN *key_type, OID *class_oid, int attr_id, int unique_pk)
int db_execute_statement_local(DB_SESSION *session, int stmt, DB_QUERY_RESULT **result)
static int rem_class_from_index(OID *oid, BTID *index, HFID *heap)
DB_CONSTRAINT_TYPE constraint_type
int tran_system_savepoint(const char *savept_name)
bool classobj_has_unique_constraint(SM_CONSTRAINT *constraints)
char * or_pack_btid(char *buf, const BTID *btid)
int sm_destroy_representations(MOP op)
int tr_delete_triggers_for_class(TR_SCHEMA_CACHE **cache, DB_OBJECT *class_object)
#define WS_IS_DELETED(mop)
int sm_check_object_domain(TP_DOMAIN *domain, MOP object)
int tr_drop_cache_trigger(TR_SCHEMA_CACHE *cache, DB_OBJECT *trigger_object)
int sm_touch_class(MOP classmop)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
static char * sm_default_constraint_name(const char *class_name, DB_CONSTRAINT_TYPE type, const char **att_names, const int *asc_desc)
void mq_free_virtual_query_cache(PARSER_CONTEXT *parser)
static int alter_trigger_hierarchy(DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *target_class, DB_OBJECT *trigger, int drop_it)
static int flatten_components(SM_TEMPLATE *def, SM_TEMPLATE *flat, SM_NAME_SPACE name_space, int auto_res)
int tr_delete_schema_cache(TR_SCHEMA_CACHE *cache, DB_OBJECT *class_object)
static int sm_load_online_index(MOP classmop, const char *constraint_name)
#define DB_MAX_SCHEMA_LENGTH
DB_COLLECTION * db_get_set(const DB_VALUE *value)
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 DB_IS_CONSTRAINT_UNIQUE_FAMILY(c)
#define ER_SM_INVALID_RESOLUTION
static void sm_free_function_nlist(struct nlist *namelist)
NESTED_VIEW_VERSION_INFO * next
int sm_att_id(MOP classop, const char *name)
static int lock_supers_drop(DB_OBJLIST *supers)
int sm_is_system_class(MOP op)
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)
bool sm_att_auto_increment(MOP classop, const char *name)
SM_CLASS * classobj_make_class(const char *name)
#define SM_MAP_CONSTRAINT_TO_ATTFLAG(c)
SM_FOREIGN_KEY_INFO * fk_info
static int update_class(SM_TEMPLATE *template_, MOP *classmop, int auto_res, DB_AUTH auth, bool needs_hierarchy_lock)
int tr_merge_schema_cache(TR_SCHEMA_CACHE *destination, TR_SCHEMA_CACHE *source)
static STATIC_METHOD * sm_find_static_method(const char *name)
int btree_class_test_unique(char *buf, int buf_size)
void classobj_free_method(SM_METHOD *meth)
static void fixup_method_self_domains(SM_METHOD *meth, MOP self)
static SM_CANDIDATE * get_candidates(SM_TEMPLATE *def, SM_TEMPLATE *flat, SM_NAME_SPACE name_space)
const char * db_get_class_name(DB_OBJECT *class_)
void sm_bump_global_schema_version(void)
void * parser_alloc(const PARSER_CONTEXT *parser, const int length)
BTID * sm_find_index(MOP classop, char **att_names, int num_atts, bool unique_index_only, bool skip_prefix_index, BTID *btid)
MOP ws_mop(const OID *oid, MOP class_mop)
enum au_fetchmode AU_FETCHMODE
int smt_quit(SM_TEMPLATE *template_)
static int sm_link_static_method(SM_METHOD *method, METHOD_LINK **link_ptr)
DB_ATTRIBUTE * db_get_attributes(DB_OBJECT *obj)
int do_reset_auto_increment_serial(MOP serial_obj)
int sm_decache_mop(MOP mop, void *info)
bool sm_is_index_visible(SM_CLASS_CONSTRAINT *constraint_list, BTID btid)
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 tran_unilaterally_abort(void)
#define SM_GET_FILTER_PRED_STREAM(filter)
int classobj_install_template(SM_CLASS *class_, SM_TEMPLATE *flat, int saverep)
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)
bool tr_get_execution_state(void)
int sm_att_in_unique_filter_constraint_predicate(MOP classop, const char *name)
static DOMAIN_COMP compare_component_domains(SM_COMPONENT *c1, SM_COMPONENT *c2)
int tr_add_cache_trigger(TR_SCHEMA_CACHE *cache, DB_OBJECT *trigger_object)
int sm_mark_system_class(MOP classop, int on_or_off)
#define ER_SM_RESOLUTION_OVERRIDE
PT_NODE * pt_class_pre_fetch(PARSER_CONTEXT *parser, PT_NODE *statement)
static int transfer_disk_structures(MOP classop, SM_CLASS *class_, SM_TEMPLATE *flat)
static int annotate_method_files(MOP classmop, SM_CLASS *class_)
#define ERROR4(error, code, arg1, arg2, arg3, arg4)
int stats_update_all_statistics(int with_fullscan)
SM_ATTRIBUTE * classobj_find_attribute_list(SM_ATTRIBUTE *attlist, const char *name, int id)
DB_ATTRIBUTE * partition_parent_atts
char * intl_mbs_chr(const char *mbs, wchar_t wc)
int sm_update_all_statistics(bool with_fullscan)
#define ER_HEAP_NODATA_NEWADDRESS
int sm_truncate_class(MOP class_mop)
unsigned triggers_validated
static int flatten_partition_info(SM_TEMPLATE *def, SM_TEMPLATE *flat)
int tp_domain_copy_enumeration(DB_ENUMERATION *dest, const DB_ENUMERATION *src)
SM_METHOD * class_methods
unsigned int virtual_cache_snapshot_version
SM_CLASS_CONSTRAINT * classobj_find_cons_primary_key(SM_CLASS_CONSTRAINT *cons_list)
void sm_delete_static_method(const char *name)
static SM_METHOD_ARGUMENT * find_argument(SM_METHOD_SIGNATURE *sig, int argnum)
struct tp_domain * setdomain
int sm_check_class_domain(TP_DOMAIN *domain, MOP class_)
static int find_attribute_op(MOP op, const char *name, SM_CLASS **classp, SM_ATTRIBUTE **attp)
int db_value_clone(DB_VALUE *src, DB_VALUE *dest)
#define SM_MAP_INDEX_ATTFLAG_TO_CONSTRAINT(c)
int classobj_get_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
DB_NAMELIST * nlist_filter(DB_NAMELIST **root, const char *name, NLSEARCHER fcn)
int sm_class_check_uniques(MOP classop)
DB_OBJLIST * ml_ext_alloc_link(void)
static const char * template_classname(SM_TEMPLATE *template_)
int sm_invalidate_trigger_cache(DB_OBJECT *classop)
SM_ATTRIBUTE * attributes
void nlist_free(DB_NAMELIST *list)
unsigned int virtual_cache_local_schema_id
VIEW_CACHE_INFO * view_cache
SM_COMPONENT * classobj_find_component(SM_CLASS *class_, const char *name, int class_component)
#define ASSERT_ERROR_AND_SET(error_code)
static int sm_expand_method_files(SM_METHOD_FILE *files)
int tr_empty_schema_cache(TR_SCHEMA_CACHE *cache)
#define assert_release(e)
SM_RESOLUTION * resolutions
void classobj_free_template(SM_TEMPLATE *template_ptr)
#define SM_MAX_IDENTIFIER_LENGTH
MOP locator_add_root(OID *root_oid, MOBJ class_root)
void classobj_free_desclist(SM_DESCRIPTOR_LIST *dl)
#define ER_SM_ALIAS_COMPONENT_INHERITED
SM_CLASS_TYPE sm_get_class_type(SM_CLASS *class_)
int sm_is_partition(MOP classmop, MOP supermop)
DB_OBJECT * dbt_finish_class(DB_CTMPL *def)
SM_DEFAULT_VALUE default_value
struct sm_descriptor * next
void sm_free_constraint_info(SM_CONSTRAINT_INFO **save_info)
static int allocate_disk_structures(MOP classop, SM_CLASS *class_, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
#define OR_ALIGNED_BUF(size)
NESTED_VIEW_VERSION_INFO * nested_views
#define SM_IS_CONSTRAINT_UNIQUE_FAMILY(c)
SM_CLASS_CONSTRAINT * classobj_find_constraint_by_name(SM_CLASS_CONSTRAINT *cons_list, const char *name)
int sm_flush_and_decache_objects(MOP obj, int decache)
OID * ws_identifier(MOP mop)
struct sm_component * next
#define OID_SET_NULL(oidp)
#define ER_WS_NO_CLASS_FOR_INSTANCE
void sm_downcase_name(const char *name, char *buf, int maxlen)
char * sm_get_method_source_file(MOP obj, const char *name)
#define ER_SM_INVALID_METHOD_ENV
static int sm_check_index_exist(MOP classop, 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 *func_info)
void ws_mark_instances_deleted(MOP class_op)
int do_update_auto_increment_serial_on_rename(MOP serial_obj, const char *class_name, const char *att_name)
DB_OBJLIST * db_get_superclasses(DB_OBJECT *obj)
int db_make_sequence(DB_VALUE *value, DB_C_SET *set)
MOP locator_find_class(const char *classname)
int sm_prelink_methods(DB_OBJLIST *classes)
SM_FUNCTION_INFO * func_index_info
int smt_add_constraint(SM_TEMPLATE *template_, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const int *attrs_prefix_length, int class_attribute, SM_FOREIGN_KEY_INFO *fk_info, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status)
int sm_update_catalog_statistics(const char *class_name, bool with_fullscan)
unsigned int ws_get_mvcc_snapshot_version(void)
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)
enum lc_prefetch_flags LC_PREFETCH_FLAGS
struct sm_constraint_info * next
SM_METHOD_ARGUMENT * value
struct sm_class_constraint * next
#define BTID_IS_EQUAL(b1, b2)
#define ER_SM_ATTRIBUTE_NAME_CONFLICT
static int check_attribute_method_overlap(SM_TEMPLATE *template_, SM_CANDIDATE *candidates)
int do_get_partition_parent(DB_OBJECT *const classop, MOP *const parentop)
int sm_set_class_comment(MOP classop, const char *comment)
static const char * sm_locate_method_file(SM_CLASS *class_, const char *function)
#define ER_SM_CONSTRAINT_NOT_FOUND
static int filter_local_constraints(SM_TEMPLATE *template_, SM_CLASS *super_class)
#define ER_SM_MISSING_ALIAS_SUBSTITUTE
int sm_save_function_index_info(SM_FUNCTION_INFO **save_info, SM_FUNCTION_INFO *func_index_info)
void sm_free_filter_index_info(SM_PREDICATE_INFO *filter_index_info)
void locator_free_list_mops(LIST_MOPS *mops)
HFID * sm_get_ch_heap(MOP classmop)
int classobj_drop_foreign_key_ref(DB_SEQ **properties, const BTID *btid, const char *name)
static int allocate_index(MOP classop, SM_CLASS *class_, DB_OBJLIST *subclasses, SM_ATTRIBUTE **attrs, const int *asc_desc, const int *attrs_prefix_length, int unique_pk, int not_null, int reverse, const char *constraint_name, BTID *index, OID *fk_refcls_oid, BTID *fk_refcls_pk_btid, const char *fk_name, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, SM_INDEX_STATUS index_status)
LIST_MOPS * locator_get_all_mops(MOP class_mop, DB_FETCH_MODE purpose, LC_FETCH_VERSION_TYPE *force_fetch_version_type)
const char * sm_get_att_name(MOP classop, int id)
static int check_alias_conflict(SM_TEMPLATE *template_, SM_CANDIDATE *candidates)
MOBJ locator_prepare_rename_class(MOP class_mop, const char *old_classname, const char *new_classname)
struct sm_foreign_key_info * next
unsigned int is_requested
void db_ws_free(void *ptr)
static void check_inherited_attributes(MOP classmop, SM_CLASS *class_, SM_TEMPLATE *flat)
int ws_map_class(MOP class_op, MAPFUNC function, void *args)
int ml_find(DB_OBJLIST *list, MOP mop)
static int sm_build_function_nlist(METHOD_LINK *links, struct nlist **nlist_ptr)
static void assign_method_id(SM_CLASS *class_, SM_METHOD *method, bool class_method)
struct parser_context * virtual_query_cache
char * sm_produce_constraint_name_mop(MOP classop, DB_CONSTRAINT_TYPE constraint_type, const char **att_names, const int *asc_desc, const char *given_name)
SM_DESCRIPTOR * sm_Descriptors
#define COPY_OID(dest_oid_ptr, src_oid_ptr)
SM_FOREIGN_KEY_ACTION update_action
static void fixup_attribute_self_domain(SM_ATTRIBUTE *att, MOP self)
void ws_free_string(const char *str)
int get_mem_size_of_mem(const void *mem, const tp_domain *domain=NULL) const
static int deallocate_index(SM_CLASS_CONSTRAINT *cons, BTID *index)
static int flatten_properties(SM_TEMPLATE *def, SM_TEMPLATE *flat)
int sm_save_filter_index_info(SM_PREDICATE_INFO **save_info, SM_PREDICATE_INFO *filter_index_info)
static bool sm_constraint_belongs_to_class(const SM_CLASS_CONSTRAINT *const con, MOP const mop)
int heap_destroy_newly_created(const HFID *hfid, const OID *class_oid)
struct method_link * next
SM_CLASS_CONSTRAINT * sm_class_constraints(MOP classop)
#define ER_FK_REF_CLASS_HAS_NOT_PK
#define ERROR0(error, code)
#define ER_SM_INCOMPATIBLE_DOMAINS
SM_CLASS_CONSTRAINT * classobj_find_class_constraint_by_btid(SM_CLASS_CONSTRAINT *constraints, SM_CONSTRAINT_TYPE type, BTID btid)
static int flatten_query_spec_lists(SM_TEMPLATE *def, SM_TEMPLATE *flat)
void sm_transaction_boundary(void)
static int update_supers_drop(MOP classop, DB_OBJLIST *supers)
const char * expanded_name
CLASS_STATS * sm_get_statistics_force(MOP classop)
SM_PARTITION * classobj_copy_partition_info(SM_PARTITION *partition_info)
int sm_drop_trigger(DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *trigger)
static int sm_split_loader_commands(const char *string, const char ***command_ptr)
int sm_get_descriptor_component(MOP op, SM_DESCRIPTOR *desc, int for_update, SM_CLASS **class_ptr, SM_COMPONENT **comp_ptr)
LOCK locator_fetch_mode_to_lock(DB_FETCH_MODE purpose, LC_OBJTYPE type, LC_FETCH_VERSION_TYPE fetch_version_type)
static SCHEMA_DEF Current_Schema
static int flatten_method_files(SM_TEMPLATE *def, SM_TEMPLATE *flat)
static int domain_search(MOP dclass_mop, MOP class_mop)
int intl_identifier_lower(const char *src, char *dst)
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)
static DB_OBJECT * is_class(OID *obj_oid, OID *class_oid)
int classobj_copy_props(DB_SEQ *properties, MOP filter_class, DB_SEQ **new_properties)
#define OR_ALIGNED_BUF_START(abuf)
int classobj_cache_class_constraints(SM_CLASS *class_)
int locator_remove_class_from_index(OID *oid, BTID *btid, HFID *hfid)
MOBJ locator_fetch_class(MOP class_mop, DB_FETCH_MODE purpose)
static int sm_file_extension(const char *path, const char *ext)
#define SM_GET_FILTER_PRED_STREAM_SIZE(filter)
bool pr_is_set_type(DB_TYPE type)
const char TEXT_CONSTRAINT_PREFIX[]
DB_DEFAULT_EXPR default_expr
int do_drop_partitioned_class(MOP class_, int drop_sub_flag, bool is_cascade_constraints)
int sm_find_subclass_in_hierarchy(MOP hierarchy, MOP class_mop, bool *found)
unsigned is_parameterized
PR_TYPE * pr_type_from_id(DB_TYPE id)
#define UNIQUE_PARTITION_SAVEPOINT_DROP
int sm_issystem(SM_CLASS *class_)
static DOMAIN_COMP compare_domains(TP_DOMAIN *d1, TP_DOMAIN *d2)
#define ER_SM_CONSTRAINT_EXISTS
static void invalidate_unused_triggers(MOP class_mop, SM_CLASS *class_, SM_TEMPLATE *flat)
#define SM_ADD_CONSTRAINT_SAVEPOINT_NAME
int sm_get_class_repid(MOP classop)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
int classobj_put_foreign_key_ref(DB_SEQ **properties, SM_FOREIGN_KEY_INFO *fk_info)
SM_FOREIGN_KEY_ACTION fk_update_action
bool classobj_is_pk_referred(MOP clsop, SM_FOREIGN_KEY_INFO *fk_info, bool include_self_ref, char **fk_name)
int sm_has_non_null_attribute(SM_ATTRIBUTE **attrs)
const char * sm_ch_name(const MOBJ clobj)
DB_OBJLIST * vid_getall_mops(MOP class_mop, SM_CLASS *class_p, DB_FETCH_MODE purpose)
struct tr_schema_cache * triggers
int tp_domain_match(const TP_DOMAIN *dom1, const TP_DOMAIN *dom2, TP_MATCH exact)
int tran_abort_upto_system_savepoint(const char *savepoint_name)
#define ER_SM_INCOMPATIBLE_ALIAS_LOCAL_SUB
void classobj_free_descriptor(SM_DESCRIPTOR *desc)
static int fetch_descriptor_class(MOP op, SM_DESCRIPTOR *desc, int for_update, SM_CLASS **class_)
static int lockhint_subclasses(SM_TEMPLATE *temp, SM_CLASS *class_)
int classobj_copy_methfiles(SM_METHOD_FILE *files, MOP filter_class, SM_METHOD_FILE **copy_ptr)
struct sm_candidate * next
#define ER_SM_INCOMPATIBLE_ALIAS_SUBSTITUTE
#define WS_SET_NO_OBJECTS(mop)
int sm_att_constrained(MOP classop, const char *name, SM_ATTRIBUTE_FLAG cons)
SM_ATTRIBUTE * shared_attributes
static int check_alias_domains(SM_TEMPLATE *template_, SM_CANDIDATE *candidates, SM_CANDIDATE **most_specific)
unsigned int virtual_cache_snapshot_version
void sm_create_root(OID *rootclass_oid, HFID *rootclass_hfid)
static SM_ATTRIBUTE * find_matching_att(SM_ATTRIBUTE *list, SM_ATTRIBUTE *att, int idmatch)
#define ER_SM_INDEX_PREFIX_LENGTH_ON_PARTITIONED_CLASS
static void fixup_self_reference_domains(MOP classop, SM_TEMPLATE *flat)
int smt_change_constraint_status(SM_TEMPLATE *ctemplate, const char *index_name, SM_INDEX_STATUS index_status)
unsigned recache_constraints
int * attrs_prefix_length
unsigned int virtual_cache_local_schema_id
int au_fetch_class(MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
void ws_list_free(DB_LIST *list, LFREEER function)
const char * sm_Root_class_name
#define ERROR1(error, code, arg1)
int sm_clean_class(MOP classmop, SM_CLASS *class_)
int sm_class_has_triggers(DB_OBJECT *classop, int *status_ptr, DB_TRIGGER_EVENT event_type)
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 sm_object_size_quick(SM_CLASS *class_, MOBJ obj)
void stats_free_statistics(CLASS_STATS *stats)
SM_DESCRIPTOR * classobj_make_descriptor(MOP class_mop, SM_CLASS *classobj, SM_COMPONENT *comp, int write_access)
SM_REPRESENTATION * representations
int ws_pin(MOP mop, int pin)
static int update_subclasses(DB_OBJLIST *subclasses)
struct db_object * class_mop
unsigned dont_decache_constraints_or_flush
#define ER_OUT_OF_VIRTUAL_MEMORY
int sm_check_catalog_rep_dir(MOP classmop, SM_CLASS *class_)
static int flatten_template(SM_TEMPLATE *def, MOP deleted_class, SM_TEMPLATE **flatp, int auto_res)
#define ER_SM_CYCLE_DETECTED
void classobj_free_class(SM_CLASS *class_)
#define DOM_GET_ENUMERATION(dom)
int do_rename_partition(MOP old_class, const char *newname)
int sm_update_class_auto(SM_TEMPLATE *template_, MOP *classmop)
int sm_is_partitioned_class(MOP op)
SM_ATTRIBUTE * class_attributes
static void sm_reset_descriptors(MOP class_)
SM_FOREIGN_KEY_ACTION fk_delete_action
HFID * sm_ch_heap(MOBJ clobj)
static unsigned int local_schema_version
int sm_save_constraint_info(SM_CONSTRAINT_INFO **save_info, const SM_CLASS_CONSTRAINT *const c)
int sm_update_statistics(MOP classop, bool with_fullscan)
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 sm_truncate_using_delete(MOP class_mop)
static TP_DOMAIN * construct_index_key_domain(int n_atts, SM_ATTRIBUTE **atts, const int *asc_desc, const int *prefix_lengths, int func_col_id, TP_DOMAIN *func_domain)
SM_METHOD_FILE * method_files
#define DB_MAX_IDENTIFIER_LENGTH
struct sm_descriptor_list * next
int locator_flush_class(MOP class_mop)
int stats_get_statistics(OID *classoid, unsigned int timestamp, CLASS_STATS **stats_p)
DB_OBJECT * db_domain_class(const DB_DOMAIN *domain)
static enum scanner_mode mode
SM_QUERY_SPEC * query_spec
void sm_flush_static_methods()
static int collect_hier_class_info(MOP classop, DB_OBJLIST *subclasses, const char *constraint_name, int reverse, int *n_classes, int n_attrs, OID *oids, int *attr_ids, HFID *hfids)
int sm_filter_domain(TP_DOMAIN *domain, int *changes)
#define HFID_SET_NULL(hfid)
DB_ATTRIBUTE * db_attribute_next(DB_ATTRIBUTE *attribute)
SM_ATTRIBUTE * instance_attributes
unsigned int sm_global_schema_version(void)
#define ER_SM_INVALID_PREFIX_LENGTH
const char * sm_get_ch_name(MOP op)
static int flatten_subclasses(DB_OBJLIST *subclasses, MOP deleted_class)
#define UNIQUE_PARTITION_SAVEPOINT_RENAME
void sm_add_static_method(const char *name, void(*function)())
#define OID_EQ(oidp1, oidp2)
MOP ws_class_mop(MOP mop)
void classobj_free_attribute(SM_ATTRIBUTE *att)
const char * function_name
int sm_update_class_with_auth(SM_TEMPLATE *template_, MOP *classmop, DB_AUTH auth, bool needs_hierarchy_lock)
int classobj_get_cached_constraint(SM_CONSTRAINT *constraints, SM_CONSTRAINT_TYPE type, BTID *id)
#define DB_IS_CONSTRAINT_REVERSE_INDEX_FAMILY(c)
static int allocate_foreign_key(MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses)
DB_OBJLIST * sm_fetch_all_base_classes(int external_list, DB_FETCH_MODE purpose)
#define TP_DOMAIN_TYPE(dom)
void db_set_read_fetch_instance_version(LC_FETCH_VERSION_TYPE read_Fetch_Instance_Version)
int do_check_fk_constraints(DB_CTMPL *ctemplate, PT_NODE *constraints)
#define ER_SM_MULTIPLE_ALIAS
#define ER_SM_INVALID_NAME
#define UNIQUE_PARTITION_SAVEPOINT_INDEX
static void cleanup(int signo)
#define SM_MAP_DB_INDEX_CONSTRAINT_TO_SM_CONSTRAINT(c)
static int install_new_representation(MOP classop, SM_CLASS *class_, SM_TEMPLATE *flat)
struct db_namelist * next
int heap_create(HFID *hfid, const OID *class_oid, bool reuse_oid)
int tp_valid_indextype(DB_TYPE type)
#define SM_ADD_UNIQUE_CONSTRAINT_SAVEPOINT_NAME
SM_METHOD_SIGNATURE * signatures
const char * pr_type_name(DB_TYPE id)
#define ER_PC_UNIMPLEMENTED
#define ER_REGU_NOT_IMPLEMENTED
DB_SESSION * db_open_buffer(const char *buffer)
SM_QUERY_SPEC * classobj_copy_query_spec_list(SM_QUERY_SPEC *query_spec)
int db_compile_statement(DB_SESSION *session)
int sm_force_write_all_classes(void)
int sm_check_name(const char *name)
int db_attribute_is_foreign_key(DB_ATTRIBUTE *attribute)
void db_close_session(DB_SESSION *session)
DB_OBJLIST * ws_Resident_classes
static int check_invalid_resolutions(SM_TEMPLATE *template_, SM_RESOLUTION **resolutions, SM_RESOLUTION *original_list)
#define SM_PROPERTY_UNIQUE
static unsigned int global_schema_version
void db_free_query(DB_SESSION *session)
int sm_get_class_flag(MOP op, SM_CLASS_FLAG flag)
int sm_add_trigger(DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *trigger)
#define ER_OBJ_CANT_ASSIGN_OID
#define BTID_SET_NULL(btid)
int vid_flush_all_instances(MOP class_mop, bool decache)
OID * sm_ch_rep_dir(MOBJ clobj)
char name[DB_MAX_SCHEMA_LENGTH *INTL_UTF8_MAX_CHAR_SIZE+4]
#define SM_IS_CONSTRAINT_INDEX_FAMILY(c)
TP_DOMAIN * tp_domain_cache(TP_DOMAIN *transient)
#define ERROR3(error, code, arg1, arg2, arg3)
int crypt_md5_buffer_hex(const char *buffer, size_t len, char *resblock)
int ml_remove(DB_OBJLIST **list, MOP mop)
void classobj_remove_class_constraint_node(SM_CLASS_CONSTRAINT **constraints, SM_CLASS_CONSTRAINT *node)
#define ER_OBJ_INVALID_ATTRIBUTE
int sm_set_class_collation(MOP classop, int collation_id)
int sm_decache_instances_after_query_executed_with_commit(MOP class_mop)
#define TM_TRAN_READ_FETCH_VERSION()
const char * loader_commands
static const char * candidate_source_name(SM_TEMPLATE *template_, SM_CANDIDATE *candidate)
static int allocate_unique_constraint(MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
static int sm_count_tokens(const char *string, int *maxcharp)
SM_TEMPLATE * smt_edit_class_mop(MOP op, DB_AUTH db_auth_type)
static int sm_dynamic_link_class(SM_CLASS *class_, METHOD_LINK *links)
#define SM_DROP_CLASS_MOP_SAVEPOINT_NAME
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
void ml_free(DB_OBJLIST *list)
MOP vid_get_referenced_mop(MOP mop)
static void auto_resolve_conflict(SM_CANDIDATE *candidate, SM_RESOLUTION **resolutions, SM_NAME_SPACE resspace)
SM_ATTRIBUTE * class_attributes
int sm_exist_index(MOP classop, const char *idxname, BTID *btid)
static int check_fk_validity(MOP classop, SM_CLASS *class_, SM_ATTRIBUTE **key_attrs, const int *asc_desc, OID *pk_cls_oid, BTID *pk_btid, char *fk_name)
const char * classobj_map_constraint_to_property(SM_CONSTRAINT_TYPE constraint)
int sm_flush_objects(MOP obj)
void ws_disconnect_deleted_instances(MOP classop)
int pr_clear_value(DB_VALUE *value)
void sm_bump_local_schema_version(void)
DB_CTMPL * dbt_edit_class(MOP classobj)
SM_ATTRIBUTE * classobj_find_attribute_id(SM_CLASS *class_, int id, int class_attribute)
int stats_update_statistics(OID *classoid, int with_fullscan)
unsigned post_load_cleanup
int sm_active_triggers(MOP class_mop, SM_CLASS *class_, DB_TRIGGER_EVENT event_type)
int sm_set_class_tde_algorithm(MOP classop, TDE_ALGORITHM tde_algo)
struct schema_def SCHEMA_DEF
int nlist_append(DB_NAMELIST **list, const char *name, NLSEARCHER fcn, int *added_ptr)
#define ER_FK_CANT_DROP_PK_REFERRED
#define ER_SM_INCOMPATIBLE_SHADOW
void classobj_free_representation(SM_REPRESENTATION *rep)
DB_DOMAIN * db_attribute_domain(DB_ATTRIBUTE *attribute)
int ws_class_has_cached_objects(MOP class_mop)
SM_CONSTRAINT * constraints
#define ER_SM_INVALID_UNIQUE_IDX_PARTITION
SM_METHOD * class_methods
#define WS_LIST_APPEND(lst, element)
int au_fetch_class_by_classmop(MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
static void insert_attribute(SM_ATTRIBUTE **attlist, SM_ATTRIBUTE *att)
int ws_mop_compare(MOP mop1, MOP mop2)
SM_RESOLUTION * resolutions
#define ER_OBJ_INVALID_ARGUMENT
#define ER_SM_LESS_SPECIFIC_ALIAS_SUBSTITUTE
DB_TYPE sm_att_type_id(MOP classop, const char *name)
SM_CLASS_CONSTRAINT * constraints
struct static_method * next
#define INTL_UTF8_MAX_CHAR_SIZE
void classobj_free_class_constraints(SM_CLASS_CONSTRAINT *constraints)
#define TP_IS_CHAR_TYPE(typeid)
MOP locator_find_class_with_purpose(const char *classname, bool for_update)
static int build_storage_order(SM_CLASS *class_, SM_TEMPLATE *flat)
SM_DOMAIN * sm_domain_alloc()
static int alter_trigger_cache(SM_CLASS *class_, const char *attribute, int class_attribute, DB_OBJECT *trigger, int drop_it)
static void error(const char *msg)
int classobj_btid_from_property_value(DB_VALUE *value, BTID *btid, char **shared_cons_name)
SM_DESCRIPTOR_LIST * classobj_make_desclist(MOP classobj, SM_CLASS *class_, SM_COMPONENT *comp, int write_access)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
static void sm_free_loader_commands(char **commands)
void classobj_free_resolution(SM_RESOLUTION *res)
int ml_add(DB_OBJLIST **list, MOP mop, int *added_ptr)
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_)
SM_CLASS_CONSTRAINT * classobj_find_class_constraint(SM_CLASS_CONSTRAINT *constraints, SM_CONSTRAINT_TYPE type, const char *name)
int sm_get_method_descriptor(DB_OBJECT *op, const char *name, int class_method, SM_DESCRIPTOR **desc_ptr)
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
#define ER_SM_INVALID_DEF_CONSTRAINT_NAME_PARAMS
DB_OBJLIST * sm_fetch_all_objects(DB_OBJECT *op, DB_FETCH_MODE purpose)
int sm_att_info(MOP classop, const char *name, int *idp, TP_DOMAIN **domainp, int *sharedp, int class_attr)
int locator_check_fk_validity(OID *cls_oid, HFID *hfid, TP_DOMAIN *key_type, int n_attrs, int *attr_ids, OID *pk_cls_oid, BTID *pk_btid, char *fk_name)
#define WS_LIST_REMOVE(lst, element)
SM_CLASS_CONSTRAINT * classobj_find_class_index(SM_CLASS *class_, const char *name)
static int resolve_candidates(SM_TEMPLATE *template_, SM_CANDIDATE *candidates, int auto_resolve, SM_CANDIDATE **winner_return)
#define HFID_IS_NULL(hfid)
OID * locator_assign_permanent_oid(MOP mop)
static int sm_link_static_methods(SM_CLASS *class_, METHOD_LINK **links_ptr)
static int allocate_disk_structures_index(MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
DB_OBJLIST * ml_copy(DB_OBJLIST *list)
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)
unsigned int virtual_cache_global_schema_id
struct parser_context * sm_virtual_queries(PARSER_CONTEXT *parser, DB_OBJECT *class_object)
SM_METHOD_FILE * method_files
int sm_partitioned_class_type(DB_OBJECT *classop, int *partition_type, char *keyattr, MOP **partitions)
int locator_remove_class(MOP class_mop)
int pr_clone_value(const DB_VALUE *src, DB_VALUE *dest)
#define SM_PROPERTY_INDEX
static int lock_supers(SM_TEMPLATE *def, DB_OBJLIST *current, DB_OBJLIST **oldlist, DB_OBJLIST **newlist)
static int lock_subclasses_internal(SM_TEMPLATE *def, MOP op, DB_OBJLIST *newsupers, DB_OBJLIST **newsubs)
int sm_get_index(MOP classop, const char *attname, BTID *index)
#define NLIST_FIND(lst, name)
#define SM_PROPERTY_PRIMARY_KEY
int locator_all_flush(void)
int classobj_populate_class_properties(DB_SET **properties, SM_CLASS_CONSTRAINT *constraints, SM_CONSTRAINT_TYPE type)
LC_FIND_CLASSNAME locator_lockhint_classes(int num_classes, const char **many_classnames, LOCK *many_locks, int *need_subclasses, LC_PREFETCH_FLAGS *flags, int quit_on_errors, LOCK lock_rr_tran)
static void abort_subclasses(DB_OBJLIST *subclasses)
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 sm_update_all_catalog_statistics(bool with_fullscan)
static int inherit_constraint(MOP classop, SM_CLASS_CONSTRAINT *con)
SM_METHOD_FILE * classobj_make_method_file(const char *name)
static SM_CANDIDATE * make_candidate_from_component(SM_COMPONENT *comp, MOP source)
int sm_force_method_link(MOP obj)
int sm_class_has_unique_constraint(MOBJ classobj, MOP classop, bool check_subclasses, bool *has_unique)
unsigned has_active_triggers
int intl_identifier_lower_string_size(const char *src)
void classobj_decache_class_constraints(SM_CLASS *class_)
SM_METHOD * classobj_copy_method(SM_METHOD *src, const char *alias)
int nlist(char *, struct nlist *)
static int retain_former_ids(SM_TEMPLATE *flat)
static int find_superclass(DB_OBJECT *classop, SM_TEMPLATE *temp, DB_OBJECT *super)
#define free_and_init(ptr)
int sm_coerce_object_domain(TP_DOMAIN *domain, MOP object, MOP *dest_object)
#define BTID_COPY(btid_ptr1, btid_ptr2)
bool sm_is_reuse_oid_class(MOP op)
static int sm_add_secondary_index_on_partition(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, MOP *sub_partitions)
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_OBJLIST * sm_fetch_all_objects_of_dirty_version(DB_OBJECT *op, DB_FETCH_MODE purpose)
static int sm_flush_and_decache_objects_internal(MOP obj, MOP obj_class_mop, int decache)
DB_CONSTRAINT_TYPE db_constraint_type(const DB_CONSTRAINT *constraint)
#define ER_SM_INVALID_INDEX_TYPE
#define ERROR2(error, code, arg1, arg2)
static void free_candidates(SM_CANDIDATE *candidates)
int smt_drop_constraint(SM_TEMPLATE *template_, const char **att_names, const char *constraint_name, int class_attribute, SM_ATTRIBUTE_FLAG constraint)
static int sm_link_methods(SM_CLASS *class_)
#define ER_OBJ_INVALID_ARGUMENTS
static void insert_method(SM_METHOD **methlist, SM_METHOD *method)
bool classobj_has_class_unique_constraint(SM_CLASS_CONSTRAINT *constraints)
int sm_check_reuse_oid_class(MOP op)
DB_C_INT(* NLSEARCHER)(const void *, const void *)
SM_COMPONENT * classobj_filter_components(SM_COMPONENT **complist, SM_NAME_SPACE name_space)
#define ER_HEAP_UNKNOWN_OBJECT
int tp_domain_filter_list(TP_DOMAIN *dlist, int *list_changes)
SM_RESOLUTION * classobj_make_resolution(MOP class_mop, const char *name, const char *alias, SM_NAME_SPACE name_space)
static void filter_reslist(SM_RESOLUTION **reslist, MOP deleted_class)
static int sm_drop_cascade_foreign_key(SM_CLASS *class_)
int db_get(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
bool tr_set_execution_state(bool new_state)
static void remove_shadowed_resolutions(SM_TEMPLATE *original, SM_TEMPLATE *flat)
void ml_ext_free(DB_OBJLIST *list)
int sm_drop_index(MOP classop, const char *constraint_name)
static SM_CANDIDATE * prune_candidate(SM_CANDIDATE **clist_pointer)
static STATIC_METHOD * Static_method_table
static void assign_attribute_id(SM_CLASS *class_, SM_ATTRIBUTE *att, int class_attribute)
#define QSTR_IS_ANY_CHAR_OR_BIT(s)
MOP sm_find_class_with_purpose(const char *name, bool for_update)
static void save_previous_value(SM_ATTRIBUTE *old, SM_ATTRIBUTE *new_)
#define MAX_ATTR_IN_AUTO_GEN_NAME
int catalog_check_rep_dir(OID *class_id, OID *rep_dir_p)
SM_ATTRIBUTE ** attributes
SM_FUNCTION_INFO * func_index_info
void * db_ws_alloc(size_t size)
SM_METHOD_ARGUMENT * args
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 tr_active_schema_cache(MOP class_mop, TR_SCHEMA_CACHE *cache, DB_TRIGGER_EVENT event_type, bool *has_event_type_triggers)
#define WS_LIST_LENGTH(lst)
static bool sm_is_possible_to_recreate_constraint(MOP class_mop, const SM_CLASS *const class_, const SM_CLASS_CONSTRAINT *const constraint)
unsigned int sm_local_schema_version(void)
SM_CLASS * sm_get_class_with_statistics(MOP classop)
TR_SCHEMA_CACHE * tr_make_schema_cache(TR_CACHE_TYPE type, DB_OBJLIST *objects)
SM_PREDICATE_INFO * filter_predicate
int serial_decache(OID *oid)
static void sm_free_method_links(METHOD_LINK *links)
#define SM_IS_CONSTRAINT_REVERSE_INDEX_FAMILY(c)
#define ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED
#define IS_CLASS_MOP(mop)
DB_TYPE db_attribute_type(DB_ATTRIBUTE *attribute)
int locator_flush_for_multi_update(MOP class_mop)
unsigned int virtual_cache_global_schema_id
int classobj_copy_reslist(SM_RESOLUTION *src, SM_NAME_SPACE resspace, SM_RESOLUTION **copy_ptr)
int heap_has_instance(HFID *hfid, OID *class_oid, int has_visible_instance)
void ws_remove_resident_class(MOP classop)
TR_SCHEMA_CACHE * tr_copy_schema_cache(TR_SCHEMA_CACHE *cache, MOP filter_class)
int locator_flush_all_instances(MOP class_mop, bool decache)
int db_make_null(DB_VALUE *value)
void vid_decache_instance(MOP mop)
#define SM_TRUNCATE_SAVEPOINT_NAME
#define SM_PROPERTY_FOREIGN_KEY
int sm_get_class_collation(MOP classop, int *collation_id)
#define DB_IS_NULL(value)
int intl_identifier_fix(char *name, int ident_max_size, bool error_on_case_overflow)
MOP sm_get_class(MOP obj)
MOBJ locator_update_class(MOP mop)
char * au_get_user_name(MOP obj)
#define ER_NOT_ALLOWED_ACCESS_TO_PARTITION
#define ER_SM_UNRESOLVED_METHODS
static int flatten_trigger_cache(SM_TEMPLATE *def, SM_TEMPLATE *flat)
#define DB_IS_CONSTRAINT_INDEX_FAMILY(c)
int sm_att_fk_constrained(MOP classop, const char *name)
static int filter_resolutions(SM_TEMPLATE *def, SM_TEMPLATE *flat, MOP deleted_class)
#define SM_IS_ATTFLAG_INDEX_FAMILY(c)
void(* METHOD_FUNCTION)()
static int remove_class_triggers(MOP classop, SM_CLASS *class_)
char * strdup(const char *str)
void dbt_abort_class(DB_CTMPL *def)
int sm_flush_for_multi_update(MOP class_mop)
int sm_get_attribute_descriptor(DB_OBJECT *op, const char *name, int class_attribute, int for_update, SM_DESCRIPTOR **desc_ptr)
#define ER_SM_ONLINE_INDEX_ON_HIERARCHY
SM_INDEX_STATUS index_status
int au_fetch_instance(MOP op, MOBJ *obj_ptr, AU_FETCHMODE mode, LC_FETCH_VERSION_TYPE fetch_version_type, DB_AUTH type)
DB_OBJLIST * sm_fetch_all_classes(int external_list, DB_FETCH_MODE purpose)
#define ER_PARTITION_WORK_FAILED
struct sm_attribute * order_link
static bool sm_filter_index_pred_have_invalid_attrs(SM_CLASS_CONSTRAINT *constraint, char *class_name, SM_ATTRIBUTE *old_atts, SM_ATTRIBUTE *new_atts)
#define ER_SM_INDEX_EXISTS
int sm_link_method(SM_CLASS *class_, SM_METHOD *method)
int ws_list_length(DB_LIST *list)
#define BTID_IS_NULL(btid)
static SM_ATTRIBUTE * order_atts_by_alignment(SM_ATTRIBUTE *atts)
int db_value_clear(DB_VALUE *value)
struct db_object * class_mop
#define pt_has_error(parser)
#define ER_SM_ALIAS_COMPONENT_EXISTS
PT_NODE * vquery_for_query
MOP sm_att_class(MOP classop, const char *name)
#define ER_SM_INCOMPATIBLE_COMPONENTS
MOP sm_find_class(const char *name)
#define STATS_WITH_SAMPLING
int au_delete_auth_of_dropping_table(const char *class_name)
bool classobj_is_exist_foreign_key_ref(MOP refop, SM_FOREIGN_KEY_INFO *fk_info)
#define db_ws_free_and_init(obj)
static DOMAIN_COMP compare_argument_domains(SM_METHOD *m1, SM_METHOD *m2)
void sm_free_descriptor(SM_DESCRIPTOR *desc)
static int update_foreign_key_ref(MOP ref_clsop, SM_FOREIGN_KEY_INFO *fk_info)
int locator_is_class(MOP mop, DB_FETCH_MODE hint_purpose)
static void filter_component_resolutions(SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE resspace)
#define ER_SM_INVALID_INDEX_WITH_PREFIX_TYPE
int sm_finish_class(SM_TEMPLATE *template_, MOP *classmop)
int sm_att_unique_constrained(MOP classop, const char *name)
bool log_does_allow_replication(void)
SM_CONSTRAINT_EXTRA_FLAG extra_status
static void fixup_self_domain(TP_DOMAIN *domain, MOP self)
#define SM_PROPERTY_REVERSE_INDEX
void tr_free_schema_cache(TR_SCHEMA_CACHE *cache)
static int update_fk_ref_partitioned_class(SM_TEMPLATE *ctemplate, SM_FOREIGN_KEY_INFO *fk_info, const BTID *btid, const char *old_name, const char *new_name)
char * ws_copy_string(const char *str)
int envvar_expand(const char *string, char *buffer, size_t maxlen)
SM_RESOLUTION * class_resolutions
struct sm_resolution * next
bool locator_is_root(MOP mop)
struct sm_constraint * next
#define WS_MOP_IS_NULL(mop)
#define SM_FIND_NAME_IN_COMPONENT_LIST(complist, name)
SM_ATTRIBUTE * ordered_attributes
void sm_mark_system_classes(void)
int ws_find(MOP mop, MOBJ *obj)
void sm_init(OID *rootclass_oid, HFID *rootclass_hfid)
bool classobj_cache_constraints(SM_CLASS *class_)
#define TP_IS_BIT_TYPE(typeid)
#define SM_PROPERTY_REVERSE_UNIQUE
PARSER_CONTEXT * mq_virtual_queries(DB_OBJECT *class_obj)
TP_DOMAIN * tp_domain_new(DB_TYPE type)
int sm_get_trigger_cache(DB_OBJECT *classop, const char *attribute, int class_attribute, void **cache)
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 sm_get_class_tde_algorithm(MOP classop, TDE_ALGORITHM *tde_algo)
#define ER_SM_INVALID_CLASS
int btree_delete_index(BTID *btid)
DB_SESSION_ERROR * db_get_errors(DB_SESSION *session)
void sm_domain_free(SM_DOMAIN *ptr)
SM_ATTRIBUTE * classobj_copy_attribute(SM_ATTRIBUTE *src, const char *alias)
static void sm_free_resident_classes_virtual_query_cache(void)
#define HFID_COPY(hfid_ptr1, hfid_ptr2)
SM_ATTRIBUTE * attributes
#define ER_OBJ_INVALID_METHOD
static int lock_subclasses(SM_TEMPLATE *def, DB_OBJLIST *newsupers, DB_OBJLIST *cursubs, DB_OBJLIST **newsubs)
#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)
#define ER_SM_UNRESOLVED_METHOD
struct sm_method_file * next
void tp_domain_free(TP_DOMAIN *dom)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
const char * loader_commands
int db_statement_count(DB_SESSION *session)
static void add_candidate(SM_CANDIDATE **candlist, SM_COMPONENT *comp, int order, MOP source, SM_RESOLUTION *resolutions)
static int drop_foreign_key_ref(MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *flat_cons, SM_CLASS_CONSTRAINT **cons)
struct sm_method_argument * next
static int drop_foreign_key_ref_internal(MOP classop, SM_CLASS_CONSTRAINT *flat_cons, SM_CLASS_CONSTRAINT *cons)
int sc_set_current_schema(MOP user)
SM_RESOLUTION * classobj_find_resolution(SM_RESOLUTION *reslist, MOP class_mop, const char *name, SM_NAME_SPACE name_space)
int sm_rename_class(MOP op, const char *new_name)
const char * rel_major_release_string(void)
MOP locator_add_class(MOBJ class_obj, const char *classname)
int classobj_drop_prop(DB_SEQ *properties, const char *name)
static int check_resolution_target(SM_TEMPLATE *template_, SM_RESOLUTION *res, int *valid_ptr)
HFID * sm_Root_class_hfid
SM_NAME_SPACE sm_resolution_space(SM_NAME_SPACE name_space)
#define ER_SM_PRIMARY_KEY_EXISTS
SM_DOMAIN * sm_domain_copy(SM_DOMAIN *ptr)
static SM_COMPONENT * make_component_from_candidate(MOP classop, SM_CANDIDATE *cand)
static int sm_save_nested_view_versions(PARSER_CONTEXT *parser, DB_OBJECT *class_object, SM_CLASS *class_)
int sm_delete_class_mop(MOP op, bool is_cascade_constraints)
int classobj_put_prop(DB_SEQ *properties, const char *name, DB_VALUE *pvalue)
int classobj_find_prop_constraint(DB_SEQ *properties, const char *prop_name, const char *cnstr_name, DB_VALUE *cnstr_val)
SM_METHOD * classobj_find_method(SM_CLASS *class_, const char *name, int class_method)
#define ER_SM_INVALID_PROPERTY
static void fixup_component_classes(MOP classop, SM_TEMPLATE *flat)
int sm_update_class(SM_TEMPLATE *template_, MOP *classmop)
SM_INDEX_STATUS index_status
int sm_set_class_flag(MOP classop, SM_CLASS_FLAG flag, int on_or_off)
static int update_supers(MOP classop, DB_OBJLIST *oldsupers, DB_OBJLIST *newsupers)
void sm_free_function_index_info(SM_FUNCTION_INFO *func_index_info)