32 #if !defined (WINDOWS) 35 #include <sys/types.h> 60 #define CLASS_NAME_MAX 80 63 #define SCHEMA_SUFFIX "_schema" 64 #define TRIGGER_SUFFIX "_trigger" 65 #define INDEX_SUFFIX "_indexes" 67 #define EX_ERROR_CHECK(c,d,m) \ 70 if (db_error_code() != NO_ERROR) { \ 76 fprintf(stderr, "%s: %s.\n\n", \ 80 fprintf(stderr, "%s: Unknown database error occurs but may not be database error.\n\n", \ 170 char *output_filename_p,
const size_t filename_size);
202 for (cl = *class_list, prev =
NULL, next =
NULL; cl !=
NULL; cl = next)
238 for (cl = *class_list, prev =
NULL, next =
NULL; cl !=
NULL; cl = next)
280 return (!
ml_find (ordered, class_) &&
ml_find (unordered, class_));
304 if (setdomain !=
NULL)
311 if (class_ !=
NULL && class_ != this_class)
317 return (dependencies);
340 for (su = supers; su !=
NULL && !dependencies; su = su->
next)
349 if (!dependencies && conservative)
358 return (dependencies);
391 for (cl = *class_list, prev =
NULL, next =
NULL; cl !=
NULL; cl = next)
413 for (o = *order_list, last =
NULL; o !=
NULL; o = o->
next)
447 output_ctx (
"/* Error calculating class dependency order.\n");
448 output_ctx (
" This indicates one of the following:\n");
449 output_ctx (
" - bug in dependency algorithm\n");
450 output_ctx (
" - cycle in class hierarchy\n");
451 output_ctx (
" - cycle in proxy attribute used as object ids\n");
452 output_ctx (
" The next class may not be in the proper definition order.\n");
453 output_ctx (
" Hand editing of the schema may be required before loading.\n");
454 output_ctx (
" */\n");
480 *class_list = cl->
next;
483 for (o = *order_list, last =
NULL; o !=
NULL; o = o->
next)
517 if (class_table ==
NULL)
540 for (i = 0; class_table[
i] !=
NULL; i++)
551 while (classes !=
NULL)
582 const char *classname;
587 if (classname !=
NULL)
596 output_ctx (
"call [change_owner]('%s', '%s') on class [db_root];\n", classname,
626 "select [name], [owner].[name], " "[current_val], " "[increment_val], " "[max_val], " "[min_val], " "[cyclic], " 627 "[started], " "[cached_num], " "[comment] " "from [db_serial] where [class_name] is null and [att_name] is null";
762 error =
numeric_db_value_add (&values[SERIAL_CURRENT_VAL], &values[SERIAL_INCREMENT_VAL], &answer_value);
773 output_ctx (
"call [find_user]('%s') on class [db_user] to [auser];\n",
783 output_ctx (
"\t nocache\n");
788 output_ctx (
"\t cache %d\n",
db_get_int (&values[SERIAL_CACHED_NUM]));
793 output_ctx (
"\t comment ");
797 output_ctx (
"call [change_serial_owner] ('%s', '%s') on class [db_serial];\n\n",
826 output_file =
fopen_ex (output_filename,
"w");
827 if (output_file ==
NULL)
829 (void) fprintf (stderr,
"%s: %s.\n\n", ctxt.
exec_name, strerror (errno));
840 output_ctx (
"COMMIT WORK;\n");
843 fclose (output_file);
876 fprintf (stderr,
"%s: Unknown database error occurs " "but may not be database error.\n\n", ctxt.
exec_name);
897 fprintf (stderr,
" Check the value of db_serial object.\n");
933 output_file =
fopen_ex (output_filename,
"w");
934 if (output_file ==
NULL)
936 (void) fprintf (stderr,
"%s: %s.\n\n", ctxt.
exec_name, strerror (errno));
944 fflush (output_file);
946 if (ftell (output_file) == 0)
949 fclose (output_file);
959 output_ctx (
"COMMIT WORK;\n");
961 fclose (output_file);
1008 output_file =
fopen_ex (output_filename,
"r");
1009 if (output_file !=
NULL)
1011 fclose (output_file);
1013 if (unlink (output_filename))
1015 (void) fprintf (stderr,
"%s.\n\n", strerror (errno));
1022 output_file =
fopen_ex (output_filename,
"w");
1023 if (output_file ==
NULL)
1025 (void) fprintf (stderr,
"%s: %s.\n\n", ctxt.
exec_name, strerror (errno));
1033 fflush (output_file);
1035 if (ftell (output_file) == 0)
1038 fclose (output_file);
1047 output_ctx (
"COMMIT WORK;\n");
1049 fclose (output_file);
1070 for (cl = classes; cl !=
NULL; cl = cl->
next)
1079 if (vclass_list_has_using_index !=
NULL)
1101 int has_indexes = 0;
1103 const char *tde_algo_name;
1104 int is_partitioned = 0;
1109 for (cl = classes; cl !=
NULL; cl = cl->
next)
1119 output_ctx (
"CREATE %s %s%s%s", is_vclass ?
"VCLASS" :
"CLASS",
PRINT_IDENTIFIER (name));
1130 output_ctx (
" WITH CHECK OPTION");
1134 output_ctx (
" WITH LOCAL CHECK OPTION");
1141 output_ctx (
" REUSE_OID");
1145 output_ctx (
" DONT_REUSE_OID");
1159 output_ctx (
" ENCRYPT=%s", tde_algo_name);
1181 for (cl = classes; cl !=
NULL; cl = cl->
next)
1184 class_type = (is_vclass > 0) ?
"VCLASS" :
"CLASS";
1188 output_ctx (
"\n\n");
1193 for (cl = classes; cl !=
NULL; cl = cl->
next)
1204 class_type = (is_vclass > 0) ?
"VCLASS" :
"CLASS";
1218 (void) output_ctx (
"\n");
1239 for (cl = classes; cl !=
NULL; cl = cl->
next)
1242 class_type = (is_vclass > 0) ?
"VCLASS" :
"CLASS";
1258 for (cl = classes; cl !=
NULL; cl = cl->
next)
1310 const char *null_spec;
1311 bool has_using_index;
1312 bool change_vclass_spec;
1319 for (cl = classes; cl !=
NULL; cl = cl->
next)
1338 has_using_index =
false;
1352 if (query_ptr !=
NULL)
1356 if (has_using_index ==
true)
1365 if (has_using_index ==
false)
1376 if (query_ptr !=
NULL)
1380 output_ctx (
"ALTER VCLASS %s%s%s ADD QUERY %s ; \n",
PRINT_IDENTIFIER (name), null_spec);
1390 for (cl = classes; cl !=
NULL; cl = cl->
next)
1404 if (
ml_find (vclass_list_has_using_index, cl->
op))
1413 if (change_vclass_spec)
1415 output_ctx (
"ALTER VCLASS %s%s%s CHANGE QUERY %d %s ;\n",
PRINT_IDENTIFIER (name), i,
1425 return vclass_list_has_using_index;
1442 const char *null_spec;
1443 bool change_vclass_spec;
1446 output_ctx (
"\n\n");
1453 for (cl = vclass_list_has_using_index; cl !=
NULL; cl = cl->
next)
1484 if (query_ptr !=
NULL)
1487 output_ctx (
"ALTER VCLASS %s%s%s ADD QUERY %s ; \n",
PRINT_IDENTIFIER (name), null_spec);
1494 for (cl = vclass_list_has_using_index; cl !=
NULL; cl = cl->
next)
1511 if (change_vclass_spec)
1513 output_ctx (
"ALTER VCLASS %s%s%s CHANGE QUERY %d %s ;\n",
PRINT_IDENTIFIER (name), i,
1547 return (supers !=
NULL);
1550 output_ctx (
"ALTER %s %s%s%s ADD SUPERCLASS ", class_type,
PRINT_IDENTIFIER (name));
1552 for (s = supers; s !=
NULL; s = s->
next)
1566 return (supers !=
NULL);
1585 bool return_value =
false;
1589 if (resolution_list !=
NULL)
1592 output_ctx (
"ALTER %s %s%s%s INHERIT", class_type,
PRINT_IDENTIFIER (name));
1596 if (return_value ==
true)
1603 return_value =
true;
1612 return (return_value);
1625 const char *name, *alias, *class_name;
1641 if (class_name ==
NULL)
1694 int unique_flag = 0;
1695 int reverse_unique_flag = 0;
1697 DB_VALUE cur_val, started_val, min_val, max_val, inc_val, sr_name;
1698 const char *name, *start_with;
1714 reverse_unique_flag = 1;
1723 if (unique_flag && reverse_unique_flag && index_flag)
1734 if (has_indexes !=
NULL)
1736 *has_indexes |= index_flag;
1741 first_attribute =
NULL;
1746 first_attribute = a;
1750 if (first_attribute ==
NULL)
1758 DB_ATTRIBUTE **ordered_attributes, **storage_attributes;
1759 int i, j, max_order, shared_pos;
1760 const char *
option, *old_attribute_name;
1770 if (a->
order > max_order)
1772 max_order = a->
order;
1778 if (ordered_attributes ==
NULL)
1782 storage_attributes = &ordered_attributes[max_order];
1794 storage_attributes[max_order - shared_pos] = a;
1804 for (i = 0; i < max_order; i++)
1806 a = storage_attributes[
i];
1813 ordered_attributes[a->
order] = a;
1815 for (j = a->
order - 1; j >= 0; j--)
1817 if (ordered_attributes[j])
1828 old_attribute_name =
"";
1831 output_ctx (
"ALTER %s %s%s%s ADD ATTRIBUTE ", class_type,
PRINT_IDENTIFIER (name));
1840 output_ctx (
" %s", option);
1841 if (old_attribute_name[0] ==
'\0')
1851 free (ordered_attributes);
1855 output_ctx (
"ALTER %s %s%s%s ADD ATTRIBUTE\n", class_type,
PRINT_IDENTIFIER (name));
1860 if (a != first_attribute)
1974 cur_val = answer_val;
1978 if (start_with[0] ==
'\0')
1980 start_with =
"NULL";
1983 output_ctx (
"ALTER SERIAL %s%s%s START WITH %s;\n",
1997 if (reverse_unique_flag)
2016 DB_ATTRIBUTE *class_attribute_list, *first_class_attribute, *a;
2020 first_class_attribute =
NULL;
2026 first_class_attribute = a;
2030 if (first_class_attribute !=
NULL)
2033 output_ctx (
"ALTER %s %s%s%s ADD CLASS ATTRIBUTE \n", class_type,
PRINT_IDENTIFIER (name));
2039 if (a != first_class_attribute)
2049 return (first_class_attribute !=
NULL);
2056 const char *table_name;
2057 bool first_print =
true;
2078 first_print =
false;
2098 bool istatus, cstatus;
2103 return istatus || cstatus;
2116 bool printed_once =
false;
2127 if (printed_once ==
false)
2129 printed_once =
true;
2130 output_ctx (
"\nFILE");
2163 DB_METHOD *method_list, *class_method_list, *m;
2164 DB_METHOD *first_method, *first_class_method;
2171 first_method = first_class_method =
NULL;
2184 first_class_method = m;
2188 if (first_method !=
NULL)
2191 output_ctx (
"ALTER %s %s%s%s ADD METHOD\n", class_type,
PRINT_IDENTIFIER (name));
2197 if (m != first_method)
2211 if (first_class_method !=
NULL)
2214 output_ctx (
"ALTER %s %s%s%s ADD METHOD\n", class_type,
PRINT_IDENTIFIER (name));
2220 if (m != first_class_method)
2230 if (first_method ==
NULL)
2237 return ((first_method !=
NULL || first_class_method !=
NULL));
2260 int has_object, size,
i;
2275 for (i = 0; i < size && !has_object; i++)
2352 output_ctx (
" SHARED ");
2359 const char *default_expr_type_str;
2363 output_ctx (
" DEFAULT ");
2368 output_ctx (
"TO_CHAR(");
2372 if (default_expr_type_str !=
NULL)
2374 output_ctx (
"%s", default_expr_type_str);
2381 output_ctx (
"NULL");
2394 output_ctx (
", \'");
2405 const char *default_expr_type_str;
2407 output_ctx (
" ON UPDATE ");
2410 if (default_expr_type_str !=
NULL)
2412 output_ctx (
"%s", default_expr_type_str);
2419 output_ctx (
" NOT NULL");
2442 bool has_inherited_atts;
2443 int num_printed = 0;
2444 const char *name, *class_name;
2452 if (constraint_list ==
NULL)
2457 for (constraint = constraint_list; constraint !=
NULL && not_online == 0;
2474 if (not_online == 0)
2480 output_ctx (
"\nALTER %s %s%s%s ADD ATTRIBUTE\n", class_type,
PRINT_IDENTIFIER (class_name));
2497 has_inherited_atts =
false;
2499 for (att = atts; *att !=
NULL; att++)
2503 has_inherited_atts =
true;
2508 if (!has_inherited_atts)
2510 if (num_printed > 0)
2517 output_ctx (
" CONSTRAINT [%s] PRIMARY KEY(", constraint->
name);
2521 output_ctx (
" CONSTRAINT [%s] UNIQUE(", constraint->
name);
2525 for (att = atts, i = 0; *att !=
NULL; att++, i++)
2537 output_ctx (
"%s",
" DESC");
2565 bool has_inherited_atts;
2569 if (constraint_list ==
NULL)
2588 has_inherited_atts =
false;
2590 for (att = atts; *att !=
NULL; att++)
2594 has_inherited_atts =
true;
2599 if (!has_inherited_atts)
2602 output_ctx (
"CREATE REVERSE UNIQUE INDEX %s%s%s on %s%s%s (",
PRINT_IDENTIFIER (constraint->
name),
2605 for (att = atts; *att !=
NULL; att++)
2616 output_ctx (
");\n");
2633 const char *cls_name, *att_name;
2634 int partitioned_subclass = 0, au_save;
2636 const int *asc_desc;
2637 const int *prefix_length;
2641 if (constraint_list ==
NULL)
2647 if (cls_name !=
NULL)
2656 if (partitioned_subclass)
2687 output_ctx (
"CREATE %s%sINDEX %s%s%s ON %s%s%s (",
2694 output_ctx (
"CREATE %s%sINDEX %s%s%s ON %s%s%s (",
2701 prefix_length =
NULL;
2723 for (att = atts; *att !=
NULL; att++)
2729 for (att = atts; k < n_attrs; att++)
2742 output_ctx (
"%s",
" DESC");
2761 if (*prefix_length >= 0)
2763 output_ctx (
" (%d)", *prefix_length);
2772 output_ctx (
"%s",
" DESC");
2801 output_ctx (
" WITH ONLINE");
2823 const char *json_schema;
2839 output_ctx (
"%s", prtype->
name);
2850 output_ctx (
"%s", prtype->
name);
2880 for (i = 1; i <
count; i++)
2905 if (json_schema !=
NULL)
2907 output_ctx (
"('%s')", json_schema);
2980 const char *method_function_name;
3010 for (i = 1; i < arg_count; i++)
3027 if (method_return_domain !=
NULL)
3036 if (method_function_name !=
NULL)
3070 if (partition_info ==
NULL)
3077 output_ctx (
",\n ");
3085 output_ctx (
" VALUES LESS THAN ");
3090 output_ctx (
"MAXVALUE");
3101 output_ctx (
" VALUES IN (");
3104 for (i1 = 0; i1 < setsize; i1++)
3155 output_ctx (
"\nPARTITION BY ");
3162 output_ctx (
"HASH ( ");
3165 output_ctx (
"RANGE ( ");
3168 output_ctx (
"LIST ( ");
3175 ptr2 = strstr (ptr + 7,
" FROM ");
3179 output_ctx (
"%s", ptr + 7);
3180 output_ctx (
" ) \n ");
3188 output_ctx (
" PARTITIONS %d",
db_get_int (&ele));
3225 DB_VALUE arg_val, arg_name_val, arg_mode_val, arg_type_val, arg_comment_val;
3226 int arg_mode, arg_type,
i, save;
3232 for (i = 0; i < arg_cnt; i++)
3261 output_ctx (
"CURSOR");
3270 output_ctx (
" COMMENT ");
3274 if (i < arg_cnt - 1)
3294 MOP cls, obj, owner;
3296 DB_VALUE sp_name_val, sp_type_val, arg_cnt_val, args_val, rtn_type_val, method_val, comment_val;
3297 DB_VALUE owner_val, owner_name_val;
3298 int sp_type, rtn_type, arg_cnt, save;
3313 for (cur_sp = sp_list; cur_sp; cur_sp = cur_sp->
next)
3331 output_ctx (
"\nCREATE %s", sp_type ==
SP_TYPE_PROCEDURE ?
"PROCEDURE" :
"FUNCTION");
3351 output_ctx (
"RETURN CURSOR ");
3359 output_ctx (
"AS LANGUAGE JAVA NAME '%s'",
db_get_string (&method_val));
3363 output_ctx (
" COMMENT ");
3370 err =
db_get (owner,
"name", &owner_name_val);
3377 output_ctx (
"call [change_sp_owner]('%s', '%s') on class [db_root];\n",
db_get_string (&sp_name_val),
3401 bool has_inherited_atts;
3402 const char *cls_name, *att_name;
3405 for (cl = classes; cl !=
NULL; cl = cl->
next)
3418 has_inherited_atts =
false;
3419 for (att = atts; *att !=
NULL; att++)
3423 has_inherited_atts =
true;
3428 if (has_inherited_atts)
3433 output_ctx (
"ALTER CLASS [%s] ADD", cls_name);
3435 output_ctx (
" CONSTRAINT [%s] FOREIGN KEY(", constraint->
name);
3437 for (att = atts; *att !=
NULL; att++)
3459 (void) output_ctx (
";\n\n");
3468 char *output_filename_p,
const size_t filename_size)
3475 char *output_filename_p,
const size_t filename_size)
3482 char *output_filename_p,
const size_t filename_size)
3489 char *output_filename_p,
const size_t filename_size)
3491 if (output_dirname ==
NULL)
3493 output_dirname =
".";
3496 size_t total =
strlen (output_dirname) +
strlen (output_prefix) +
strlen (suffix) + 8;
3498 if (total > filename_size)
3503 snprintf (output_filename_p, filename_size - 1,
"%s/%s%s", output_dirname, output_prefix, suffix);
#define SP_ATTR_RETURN_TYPE
DB_OBJECT * db_find_class(const char *name)
DB_OBJECT * db_attribute_class(DB_ATTRIBUTE *attribute)
int ml_append(DB_OBJLIST **list, MOP mop, int *added_ptr)
static int emit_foreign_key(print_output &output_ctx, DB_OBJLIST *classes)
void desc_value_print(print_output &output_ctx, DB_VALUE *value)
int set_get_element_nocopy(DB_COLLECTION *set, int index, DB_VALUE *value)
#define DB_GET_ENUM_ELEM_STRING(elem)
DB_COLLECTION * db_get_set(const DB_VALUE *value)
int tr_dump_selective_triggers(print_output &output_ctx, DB_OBJLIST *classes)
static int is_dependent_class(DB_OBJECT *class_, DB_OBJLIST *unordered, DB_OBJLIST *ordered)
#define SP_ATTR_ARG_COUNT
int db_attribute_is_indexed(DB_ATTRIBUTE *attribute)
SM_FOREIGN_KEY_INFO * fk_info
const char * db_get_class_name(DB_OBJECT *class_)
static DB_OBJLIST * emit_query_specs(print_output &output_ctx, DB_OBJLIST *classes)
int db_domain_scale(const DB_DOMAIN *domain)
MOP ws_mop(const OID *oid, MOP class_mop)
const char * db_get_type_name(DB_TYPE type_id)
DB_ATTRIBUTE * db_get_attributes(DB_OBJECT *obj)
SM_PREDICATE_INFO * filter_predicate
static void emit_method_def(print_output &output_ctx, DB_METHOD *method, METHOD_QUALIFIER qualifier)
#define TP_IS_SET_TYPE(typenum)
static bool emit_class_attributes(print_output &output_ctx, DB_OBJECT *class_, const char *class_type)
#define DB_MAX_STRING_LENGTH
int db_domain_precision(const DB_DOMAIN *domain)
int extract_triggers_to_file(extract_context &ctxt, const char *output_filename)
int db_seq_get(DB_SET *set, int index, DB_VALUE *value)
int db_get_int(const DB_VALUE *value)
static int emit_stored_procedure_args(print_output &output_ctx, int arg_cnt, DB_SET *arg_set)
int db_is_vclass(DB_OBJECT *op)
static void filter_unrequired_classes(DB_OBJLIST **class_list)
DB_CONSTRAINT * db_constraint_next(DB_CONSTRAINT *constraint)
static int ex_contains_object_reference(DB_VALUE *value)
int db_method_arg_count(DB_METHOD *method)
static int check_domain_dependencies(DB_DOMAIN *domain, DB_OBJECT *this_class, DB_OBJLIST *unordered, DB_OBJLIST *ordered)
PT_NODE * pt_has_using_index_clause(PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
DB_DOMAIN * db_domain_next(const DB_DOMAIN *domain)
int db_query_end(DB_QUERY_RESULT *result)
int db_attribute_order(DB_ATTRIBUTE *attribute)
int is_req_class(DB_OBJECT *class_)
DB_CONSTRAINT * db_get_constraints(DB_OBJECT *obj)
PARSER_CONTEXT * parser_create_parser(void)
static int class_type(DB_OBJECT *class_obj)
DB_ATTRIBUTE ** db_constraint_attributes(DB_CONSTRAINT *constraint)
int numeric_db_value_compare(const DB_VALUE *dbv1, const DB_VALUE *dbv2, DB_VALUE *answer)
SM_DEFAULT_VALUE default_value
#define PRINT_FUNCTION_INDEX_NAME(s)
static char * output_filename
int extract_triggers(extract_context &ctxt, print_output &output_ctx)
DB_OBJLIST * db_get_superclasses(DB_OBJECT *obj)
static void emit_partition_parts(print_output &output_ctx, SM_PARTITION *partition_info, int partcnt)
SM_FUNCTION_INFO * func_index_info
const char * db_default_expression_string(DB_DEFAULT_EXPR_TYPE default_expr_type)
int extract_classes_to_file(extract_context &ctxt, const char *output_filename)
int do_get_partition_parent(DB_OBJECT *const classop, MOP *const parentop)
DB_OBJECT * db_method_class(DB_METHOD *method)
int au_export_users(print_output &output_ctx)
static bool emit_class_meta(print_output &output_ctx, DB_OBJECT *table)
int numeric_db_value_sub(const DB_VALUE *dbv1, const DB_VALUE *dbv2, DB_VALUE *answer)
int set_size(DB_COLLECTION *set)
#define ER_NODATA_TOBE_UNLOADED
static int order_classes(DB_OBJLIST **class_list, DB_OBJLIST **order_list, int conservative)
int ml_find(DB_OBJLIST *list, MOP mop)
const char * db_attribute_name(DB_ATTRIBUTE *attribute)
int db_attribute_is_shared(DB_ATTRIBUTE *attribute)
static void emit_domain_def(print_output &output_ctx, DB_DOMAIN *domains)
int create_filename_trigger(const char *output_dirname, const char *output_prefix, char *output_filename_p, const size_t filename_size)
static void emit_method_files(print_output &output_ctx, DB_OBJECT *class_)
int db_attribute_is_non_null(DB_ATTRIBUTE *attribute)
const int * db_constraint_prefix_length(DB_CONSTRAINT *constraint)
const char * output_dirname
static bool emit_resolutions(print_output &output_ctx, DB_OBJECT *class_, const char *class_type)
SM_FOREIGN_KEY_ACTION update_action
int db_attribute_is_reverse_unique(DB_ATTRIBUTE *attribute)
static bool emit_all_attributes(print_output &output_ctx, DB_OBJECT *class_, const char *class_type, int *has_indexes, EMIT_STORAGE_ORDER storage_order)
static void emit_methfile_def(print_output &output_ctx, DB_METHFILE *methfile)
static void force_one_class(print_output &output_ctx, DB_OBJLIST **class_list, DB_OBJLIST **order_list)
void parser_free_parser(PARSER_CONTEXT *parser)
static int has_dependencies(DB_OBJECT *class_, DB_OBJLIST *unordered, DB_OBJLIST *ordered, int conservative)
static bool emit_instance_attributes(print_output &output_ctx, DB_OBJECT *class_, const char *class_type, int *has_indexes, EMIT_STORAGE_ORDER storage_order)
DB_DEFAULT_EXPR_TYPE default_expr_type
const char * lang_get_collation_name(const int coll_id)
int db_make_string(DB_VALUE *value, DB_CONST_C_CHAR str)
DB_DEFAULT_EXPR default_expr
const char * tde_get_algorithm_name(TDE_ALGORITHM tde_algo)
#define SP_ATTR_DATA_TYPE
PR_TYPE * pr_type_from_id(DB_TYPE id)
TP_DOMAIN * tp_domain_resolve_default(DB_TYPE type)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
int db_set_get(DB_SET *set, int index, DB_VALUE *value)
static void filter_system_classes(DB_OBJLIST **class_list)
DB_METHFILE * db_get_method_files(DB_OBJECT *obj)
static int emit_schema(print_output &output_ctx, DB_OBJLIST *classes, int do_auth, DB_OBJLIST **vclass_list_has_using_index, EMIT_STORAGE_ORDER emit_storage_order)
static void emit_cycle_warning(print_output &output_ctx)
static bool emit_methods(print_output &output_ctx, DB_OBJECT *class_, const char *class_type)
int au_fetch_class(MOP op, SM_CLASS **class_ptr, AU_FETCHMODE fetchmode, DB_AUTH type)
int db_query_first_tuple(DB_QUERY_RESULT *result)
#define ER_IT_DATA_OVERFLOW
DB_DOMAIN * db_method_arg_domain(DB_METHOD *method, int arg)
PT_NODE ** parser_parse_string(PARSER_CONTEXT *parser, const char *buffer)
int create_filename_indexes(const char *output_dirname, const char *output_prefix, char *output_filename_p, const size_t filename_size)
void db_objlist_free(DB_OBJLIST *list)
static DB_OBJLIST * get_ordered_classes(print_output &output_ctx, MOP *class_table)
DB_DOMAIN * db_method_return_domain(DB_METHOD *method)
#define DOM_GET_ENUM_ELEM(dom, idx)
const char * db_error_string(int level)
DB_OBJECT * db_domain_class(const DB_DOMAIN *domain)
#define DOM_GET_ENUM_ELEMS_COUNT(dom)
const char * db_domain_raw_json_schema(const DB_DOMAIN *domain)
DB_ATTRIBUTE * db_attribute_next(DB_ATTRIBUTE *attribute)
int db_resolution_isclass(DB_RESOLUTION *resolution)
const char * db_query_spec_string(DB_QUERY_SPEC *query_spec)
DB_OBJECT * db_get_object(const DB_VALUE *value)
#define TP_DOMAIN_TYPE(dom)
const char * db_method_function(DB_METHOD *method)
#define NUMERIC_MAX_STRING_SIZE
const char * pr_type_name(DB_TYPE id)
static int create_filename(const char *output_dirname, const char *output_prefix, const char *suffix, char *output_filename_p, const size_t filename_size)
int sm_get_class_flag(MOP op, SM_CLASS_FLAG flag)
int au_export_grants(print_output &output_ctx, MOP class_mop)
static void emit_partition_info(print_output &output_ctx, MOP clsobj)
int extract_indexes_to_file(extract_context &ctxt, const char *output_filename)
static bool has_vclass_domains(DB_OBJECT *vclass)
int ml_ext_add(DB_OBJLIST **list, MOP mop, int *added_ptr)
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
int db_is_system_class(MOP op)
static void emit_unique_def(print_output &output_ctx, DB_OBJECT *class_, const char *class_type)
int db_set_size(DB_SET *set)
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)
FILE * fopen_ex(const char *filename, const char *type)
DB_DOMAIN * db_attribute_domain(DB_ATTRIBUTE *attribute)
DB_METHOD * db_method_next(DB_METHOD *method)
static int emit_autoincrement_def(print_output &output_ctx, DB_ATTRIBUTE *attribute)
static void error(const char *msg)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
const char * db_resolution_name(DB_RESOLUTION *resolution)
SM_CLASS_CONSTRAINT * classobj_find_class_index(SM_CLASS *class_, const char *name)
int db_query_next_tuple(DB_QUERY_RESULT *result)
char * numeric_db_value_print(const DB_VALUE *val, char *buf)
MOP au_get_class_owner(MOP classmop)
#define ER_INVALID_SERIAL_VALUE
const char * default_expr_format
static int export_serial(print_output &output_ctx)
#define SP_ATTR_ARG_COMMENT
SM_FOREIGN_KEY_ACTION delete_action
#define PRINT_IDENTIFIER(s)
DB_CONSTRAINT_TYPE db_constraint_type(const DB_CONSTRAINT *constraint)
void help_print_describe_comment(print_output &output_ctx, const char *comment)
const int * db_constraint_asc_desc(DB_CONSTRAINT *constraint)
DB_RESOLUTION * db_get_resolutions(DB_OBJECT *obj)
#define DB_CURSOR_SUCCESS
int db_get(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
void ml_ext_free(DB_OBJLIST *list)
DB_METHFILE * db_methfile_next(DB_METHFILE *methfile)
DB_METHOD * db_get_class_methods(DB_OBJECT *obj)
static void emit_attribute_def(print_output &output_ctx, DB_ATTRIBUTE *attribute, ATTRIBUTE_QUALIFIER qualifier)
DB_VALUE * db_attribute_default(DB_ATTRIBUTE *attribute)
static void emit_class_owner(print_output &output_ctx, MOP class_)
#define TP_FLOATING_PRECISION_VALUE
DB_RESOLUTION * db_resolution_next(DB_RESOLUTION *resolution)
DB_TYPE db_attribute_type(DB_ATTRIBUTE *attribute)
int create_filename_schema(const char *output_dirname, const char *output_prefix, char *output_filename_p, const size_t filename_size)
const char * db_resolution_alias(DB_RESOLUTION *resolution)
#define DB_VALUE_TYPE(value)
DB_ATTRIBUTE * db_get_class_attributes(DB_OBJECT *obj)
int db_make_null(DB_VALUE *value)
#define DB_IS_NULL(value)
DB_QUERY_SPEC * db_get_query_specs(DB_OBJECT *obj)
int do_is_partitioned_subclass(int *is_partitioned, const char *classname, char *keyattr)
SM_INDEX_STATUS index_status
DB_OBJLIST * db_get_all_objects(DB_OBJECT *op)
DB_OBJLIST * sm_fetch_all_classes(int external_list, DB_FETCH_MODE purpose)
int db_value_clear(DB_VALUE *value)
DB_TYPE db_set_type(DB_SET *set)
int db_query_get_tuple_value(DB_QUERY_RESULT *result, int index, DB_VALUE *value)
int numeric_db_value_add(const DB_VALUE *dbv1, const DB_VALUE *dbv2, DB_VALUE *answer)
char * pt_print_query_spec_no_list(PARSER_CONTEXT *parser, const PT_NODE *node)
const char * db_methfile_name(DB_METHFILE *methfile)
static int emit_stored_procedure(print_output &output_ctx)
static void emit_index_def(print_output &output_ctx, DB_OBJECT *class_)
const char * db_method_name(DB_METHOD *method)
int db_attribute_is_unique(DB_ATTRIBUTE *attribute)
int db_compile_and_execute_local(const char *CSQL_query, void *result, DB_QUERY_ERROR *query_error)
static void emit_reverse_unique_def(print_output &output_ctx, DB_OBJECT *class_)
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 emit_query_specs_has_using_index(print_output &output_ctx, DB_OBJLIST *vclass_list_has_using_index)
DB_METHOD * db_get_methods(DB_OBJECT *obj)
char * classobj_describe_foreign_key_action(SM_FOREIGN_KEY_ACTION action)
int au_fetch_class_force(MOP op, SM_CLASS **class_, AU_FETCHMODE fetchmode)
static int emit_indexes(print_output &output_ctx, DB_OBJLIST *classes, int has_indexes, DB_OBJLIST *vclass_list_has_using_index)
int extract_classes(extract_context &ctxt, print_output &schema_output_ctx)
DB_CONST_C_CHAR db_get_string(const DB_VALUE *value)
DB_DOMAIN * db_domain_set(const DB_DOMAIN *domain)
DB_OBJECT * db_resolution_class(DB_RESOLUTION *resolution)
static bool emit_superclasses(print_output &output_ctx, DB_OBJECT *class_, const char *class_type)
void ml_ext_free_link(DB_OBJLIST *link)
static void emit_resolution_def(print_output &output_ctx, DB_RESOLUTION *resolution, RESOLUTION_QUALIFIER qualifier)
DB_QUERY_SPEC * db_query_spec_next(DB_QUERY_SPEC *query_spec)