57 if (comment !=
NULL && comment[0] !=
'\0')
87 m_buf (
" VALUES LESS THAN ");
104 m_buf (
" VALUES IN (");
106 for (i = 0; i < setsize; i++)
146 m_buf (
"%s", identifier);
151 m_buf (
"[%s]", identifier);
170 bool force_print_collation)
173 char temp_buffer[27];
174 int precision = 0, idx,
count;
180 for (temp_domain = &domain; temp_domain !=
NULL; temp_domain = temp_domain->
next)
209 strcpy (temp_buffer, temp_domain->
type->
name);
239 strcpy (temp_buffer, temp_domain->
type->
name);
252 strcpy (temp_buffer, temp_domain->
type->
name);
265 strcpy (temp_buffer, temp_domain->
type->
name);
272 strcpy (temp_buffer, temp_domain->
type->
name);
274 m_buf (
"%s OF ", temp_buffer);
292 strcpy (temp_buffer, temp_domain->
type->
name);
295 for (idx = 1; idx <=
count; idx++)
341 else if (argument.
type)
347 m_buf (
"invalid type");
370 if (signature_p ==
NULL)
387 m_buf (
" FUNCTION ");
417 for (i = 1; i <= signature.
num_args; i++)
419 for (argument_p = signature.
args; argument_p !=
NULL && argument_p->
index != i; argument_p=argument_p->
next)
422 if (argument_p !=
NULL)
485 m_buf (
" AUTO_INCREMENT ");
524 const char *default_expr_type_str;
534 if (default_expr_type_str !=
NULL)
536 m_buf (
"%s", default_expr_type_str);
556 const char *default_expr_type_str;
558 m_buf (
" ON UPDATE ");
560 m_buf (
"%s", default_expr_type_str);
607 const int *prefix_length;
612 switch (constraint.
type)
621 m_buf (
"REVERSE INDEX ");
624 m_buf (
"REVERSE UNIQUE ");
627 m_buf (
"PRIMARY KEY ");
630 m_buf (
"FOREIGN KEY ");
633 m_buf (
"CONSTRAINT ");
647 switch (constraint.
type)
656 m_buf (
" CONSTRAINT ");
658 m_buf (
" UNIQUE KEY ");
661 m_buf (
" CONSTRAINT ");
663 m_buf (
" PRIMARY KEY ");
666 m_buf (
" CONSTRAINT ");
668 m_buf (
" FOREIGN KEY ");
691 for (attribute_p = constraint.
attributes; *attribute_p; attribute_p++)
697 for (attribute_p = constraint.
attributes; k < n_attrs; attribute_p++)
724 if (*prefix_length != -1)
726 m_buf (
"(%d)", *prefix_length);
762 m_buf (
" REFERENCES ");
767 for (c = ref_cls->constraints; c; c = c->
next)
773 for (k = 0; k < n_attrs; k++)
778 if (k != (n_attrs - 1))
809 m_buf (
" INVISIBLE");
816 m_buf (
" IN PROGRESS");
836 m_buf (
"inherit CLASS ");
955 const char *tde_algo_str;
959 #if 0 //what do we do in case of error??? 980 m_buf (
"CREATE TABLE %s", class_descr.
name);
987 for (line_ptr = class_descr.
supers; *line_ptr !=
NULL; line_ptr++)
989 if (line_ptr != class_descr.
supers)
993 m_buf (
"%s", (*line_ptr));
1000 m_buf (
" CLASS ATTRIBUTE (");
1008 m_buf (
"%s", *line_ptr);
1021 for (line_ptr = class_descr.
attributes; *line_ptr !=
NULL; line_ptr++)
1027 m_buf (
"%s", *line_ptr);
1033 for (line_ptr = class_descr.
constraints; *line_ptr !=
NULL; line_ptr++)
1039 m_buf (
"%s", *line_ptr);
1049 m_buf (
" REUSE_OID");
1053 m_buf (
" DONT_REUSE_OID");
1069 m_buf (
" ENCRYPT=%s", tde_algo_str);
1080 for (line_ptr = class_descr.
methods; *line_ptr !=
NULL; line_ptr++)
1082 if (line_ptr != class_descr.
methods)
1086 m_buf (
"%s", *line_ptr);
1098 m_buf (
" CLASS %s", *line_ptr);
1114 m_buf (
"'%s'", *line_ptr);
1121 m_buf (
" INHERIT ");
1123 for (line_ptr = class_descr.
resolutions; *line_ptr !=
NULL; line_ptr++)
1129 m_buf (
"%s", *line_ptr);
1138 size_t len = class_descr.
partition.size ();
1143 for (
size_t i=2;
i<len; ++
i)
1158 m_buf (
" COMMENT=");
1180 m_buf (
"PARTITION BY ");
1195 char *tmp = (
char *) partinfo.
expr;
1198 char *ptr = tmp ? strstr (tmp,
"SELECT ") :
NULL;
1202 char *ptr2 = strstr (ptr + 7,
" FROM ");
1205 strncpy (col_name, ptr + 7,
CAST_STRLEN (ptr2 - (ptr + 7)));
1207 m_buf (
"%s) ", col_name);
void describe_class(struct db_object *class_op)
#define DB_GET_ENUM_ELEM_STRING(elem)
char * ustr_upper(char *s)
#define LANG_SYS_COLLATION
SM_FOREIGN_KEY_INFO * fk_info
const char * db_get_class_name(DB_OBJECT *class_)
std::vector< char * > partition
MOP ws_mop(const OID *oid, MOP class_mop)
SM_PREDICATE_INFO * filter_predicate
#define DB_MAX_STRING_LENGTH
struct tr_activity * condition
int db_get_int(const DB_VALUE *value)
struct tp_domain * setdomain
const char * tr_time_as_string(DB_TRIGGER_TIME time)
void describe_partition_parts(const sm_partition &parts, class_description::type prt_type)
void describe_method(const struct db_object &op, const sm_method &method_p, class_description::type prt_type)
SM_DEFAULT_VALUE default_value
void describe_attribute(const struct db_object &class_p, const sm_attribute &attribute_p, bool is_inherited, class_description::type prt_type, bool force_print_collation)
SM_FUNCTION_INFO * func_index_info
const char * db_default_expression_string(DB_DEFAULT_EXPR_TYPE default_expr_type)
static const char * describe_trigger_condition_time(const tr_trigger &trigger)
SM_METHOD_ARGUMENT * value
struct sm_class_constraint * next
int set_size(DB_COLLECTION *set)
SM_FOREIGN_KEY_ACTION update_action
void describe_value(const db_value *value)
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)
void describe_method_file(const struct db_object &obj, const sm_method_file &file)
int init(const char *name)
DB_DEFAULT_EXPR default_expr
const char * tde_get_algorithm_name(TDE_ALGORITHM tde_algo)
void describe_resolution(const sm_resolution &resolution, class_description::type prt_type)
const char * sm_ch_name(const MOBJ clobj)
struct tr_activity * action
#define NULL_DEFAULT_EXPRESSION_OPERATOR
#define DB_MAX_NUMERIC_PRECISION
#define PT_ERRORmf2(parser, node, setNo, msgNo, arg1, arg2)
int * attrs_prefix_length
#define MSGCAT_SET_PARSER_RUNTIME
const char * db_json_get_schema_raw_from_validator(JSON_VALIDATOR *val)
#define DB_MAX_IDENTIFIER_LENGTH
#define DOM_GET_ENUM_ELEM(dom, idx)
#define DOM_GET_ENUM_ELEMS_COUNT(dom)
int sm_filter_domain(TP_DOMAIN *domain, int *changes)
const char * sm_get_ch_name(MOP op)
const char * function_name
#define TP_DOMAIN_TYPE(dom)
#define NUMERIC_MAX_STRING_SIZE
const char * er_msg(void)
SM_METHOD_SIGNATURE * signatures
void describe_constraint(const sm_class &class_p, const sm_class_constraint &constraint_p, class_description::type prt_type)
void describe_domain(tp_domain &domain, class_description::type prt_type, bool force_print_collation)
#define PT_ERRORc(parser, node, msg)
int set_get_element(DB_COLLECTION *set, int index, DB_VALUE *value)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int pr_clear_value(DB_VALUE *value)
void describe_class_trigger(const tr_trigger &trigger)
static void error(const char *msg)
void describe_comment(const char *comment)
DB_DEFAULT_EXPR_TYPE on_update_default_expr
#define DB_GET_ENUM_ELEM_STRING_SIZE(elem)
char * numeric_db_value_print(const DB_VALUE *val, char *buf)
const char * default_expr_format
const char * tr_event_as_string(DB_TRIGGER_EVENT event)
#define ER_AU_SELECT_FAILURE
SM_FOREIGN_KEY_ACTION delete_action
bool sm_is_reuse_oid_class(MOP op)
void describe_partition_info(const sm_partition &partinfo)
int db_get(DB_OBJECT *object, const char *attpath, DB_VALUE *value)
SM_ATTRIBUTE ** attributes
JSON_VALIDATOR * json_validator
SM_METHOD_ARGUMENT * args
#define TP_FLOATING_PRECISION_VALUE
#define SM_IS_CONSTRAINT_REVERSE_INDEX_FAMILY(c)
void describe_identifier(const char *identifier, class_description::type prt_type)
int db_make_null(DB_VALUE *value)
static const char * describe_trigger_action_time(const tr_trigger &trigger)
#define DB_IS_NULL(value)
SM_INDEX_STATUS index_status
#define MSGCAT_RUNTIME_IS_NOT_AUTHORIZED_ON
void describe_signature(const sm_method_signature &signature_p, class_description::type prt_type)
struct db_object * class_mop
void describe_argument(const sm_method_argument &argument, class_description::type prt_type)
int sm_get_class_tde_algorithm(MOP classop, TDE_ALGORITHM *tde_algo)
char * classobj_describe_foreign_key_action(SM_FOREIGN_KEY_ACTION action)
void add_bytes(size_t len, const char *bytes)
int au_fetch_class_force(MOP op, SM_CLASS **class_, AU_FETCHMODE fetchmode)
struct sm_method_argument * next