CUBRID Engine  latest
schema_template.h File Reference
#include "work_space.h"
#include "class_object.h"
Include dependency graph for schema_template.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SM_TEMPLATEsmt_def_class (const char *name)
 
SM_TEMPLATEsmt_edit_class_mop (MOP class_, DB_AUTH db_auth_type)
 
SM_TEMPLATEsmt_copy_class_mop (const char *name, MOP op, SM_CLASS **class_)
 
SM_TEMPLATEsmt_copy_class (const char *new_name, const char *existing_name, SM_CLASS **class_)
 
int smt_quit (SM_TEMPLATE *template_)
 
SM_TEMPLATEsmt_def_typed_class (const char *name, SM_CLASS_TYPE ct)
 
SM_CLASS_TYPE smt_get_class_type (SM_TEMPLATE *template_)
 
int smt_add_attribute_w_dflt (DB_CTMPL *def, const char *name, const char *domain_string, DB_DOMAIN *domain, DB_VALUE *default_value, const SM_NAME_SPACE name_space, DB_DEFAULT_EXPR *default_expr, DB_DEFAULT_EXPR_TYPE *on_update, const char *comment)
 
int smt_add_attribute_w_dflt_w_order (DB_CTMPL *def, const char *name, const char *domain_string, DB_DOMAIN *domain, DB_VALUE *default_value, const SM_NAME_SPACE name_space, const bool add_first, const char *add_after_attribute, DB_DEFAULT_EXPR *default_expr, DB_DEFAULT_EXPR_TYPE *on_update, const char *comment)
 
int smt_add_attribute_any (SM_TEMPLATE *template_, const char *name, const char *domain_string, DB_DOMAIN *domain, const SM_NAME_SPACE name_space, const bool add_first, const char *add_after_attribute, const char *comment)
 
int smt_add_attribute (SM_TEMPLATE *template_, const char *name, const char *domain_string, DB_DOMAIN *domain)
 
int smt_add_set_attribute_domain (SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain)
 
int smt_delete_set_attribute_domain (SM_TEMPLATE *template_, const char *name, int class_attribute, const char *domain_string, DB_DOMAIN *domain)
 
int smt_reset_attribute_domain (SM_TEMPLATE *template_, const char *name, int class_attribute)
 
int smt_set_attribute_default (SM_TEMPLATE *template_, const char *name, int class_attribute, DB_VALUE *value, DB_DEFAULT_EXPR *default_expr)
 
int smt_set_attribute_on_update (SM_TEMPLATE *template_, const char *name, int class_attribute, DB_DEFAULT_EXPR_TYPE on_update)
 
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 *attr_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 smt_drop_constraint (SM_TEMPLATE *template_, const char **att_names, const char *constraint_name, int class_attribute, SM_ATTRIBUTE_FLAG constraint)
 
int smt_add_index (SM_TEMPLATE *template_, const char *name, int on_or_off)
 
int smt_find_attribute (SM_TEMPLATE *template_, const char *name, int class_attribute, SM_ATTRIBUTE **attp)
 
int smt_add_method_any (SM_TEMPLATE *template_, const char *name, const char *implementation, SM_NAME_SPACE name_space)
 
int smt_add_method (SM_TEMPLATE *template_, const char *name, const char *implementation)
 
int smt_add_class_method (SM_TEMPLATE *template_, const char *name, const char *implementation)
 
int smt_change_method_implementation (SM_TEMPLATE *template_, const char *name, int class_method, const char *implementation)
 
int smt_assign_argument_domain (SM_TEMPLATE *template_, const char *name, int class_method, const char *implementation, int index, const char *domain_string, DB_DOMAIN *domain)
 
int smt_add_set_argument_domain (SM_TEMPLATE *template_, const char *name, int class_method, const char *implementation, int index, const char *domain_string, DB_DOMAIN *domain)
 
int smt_rename_any (SM_TEMPLATE *template_, const char *name, const bool class_namespace, const char *new_name)
 
int smt_change_constraint_comment (SM_TEMPLATE *ctemplate, const char *index_name, const char *comment)
 
int smt_change_constraint_status (SM_TEMPLATE *ctemplate, const char *index_name, SM_INDEX_STATUS index_status)
 
int smt_delete_any (SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE name_space)
 
int smt_add_super (SM_TEMPLATE *template_, MOP super_class)
 
int smt_delete_super (SM_TEMPLATE *template_, MOP super_class)
 
int smt_delete_super_connect (SM_TEMPLATE *template_, MOP super_class)
 
int smt_add_method_file (SM_TEMPLATE *template_, const char *filename)
 
int smt_drop_method_file (SM_TEMPLATE *template_, const char *filename)
 
int smt_reset_method_files (SM_TEMPLATE *template_)
 
int smt_rename_method_file (SM_TEMPLATE *template_, const char *old_name, const char *new_name)
 
int smt_set_loader_commands (SM_TEMPLATE *template_, const char *commands)
 
int smt_add_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias)
 
int smt_add_class_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name, const char *alias)
 
int smt_delete_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name)
 
int smt_delete_class_resolution (SM_TEMPLATE *template_, MOP super_class, const char *name)
 
int smt_add_query_spec (SM_TEMPLATE *template_, const char *specification)
 
int smt_drop_query_spec (SM_TEMPLATE *template_, const int index)
 
int smt_reset_query_spec (SM_TEMPLATE *template_)
 
int smt_change_query_spec (SM_TEMPLATE *def, const char *query, const int index)
 
int smt_change_attribute_w_dflt_w_order (DB_CTMPL *def, const char *name, const char *new_name, const char *new_domain_string, DB_DOMAIN *new_domain, const SM_NAME_SPACE name_space, DB_VALUE *new_default_value, DB_DEFAULT_EXPR *new_def_expr, DB_DEFAULT_EXPR_TYPE new_on_update_expr, const bool change_first, const char *change_after_attribute, SM_ATTRIBUTE **found_att)
 
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)
 

Function Documentation

int smt_add_attribute_w_dflt ( DB_CTMPL def,
const char *  name,
const char *  domain_string,
DB_DOMAIN domain,
DB_VALUE default_value,
const SM_NAME_SPACE  name_space,
DB_DEFAULT_EXPR default_expr,
DB_DEFAULT_EXPR_TYPE on_update,
const char *  comment 
)
int smt_add_attribute_w_dflt_w_order ( DB_CTMPL def,
const char *  name,
const char *  domain_string,
DB_DOMAIN domain,
DB_VALUE default_value,
const SM_NAME_SPACE  name_space,
const bool  add_first,
const char *  add_after_attribute,
DB_DEFAULT_EXPR default_expr,
DB_DEFAULT_EXPR_TYPE on_update,
const char *  comment 
)

Definition at line 927 of file schema_template.c.

References error(), ID_CLASS_ATTRIBUTE, NO_ERROR, NULL, smt_add_attribute_any(), smt_set_attribute_default(), and smt_set_attribute_on_update().

Referenced by do_add_attribute(), and smt_add_attribute_w_dflt().

Here is the caller graph for this function:

int smt_add_class_method ( SM_TEMPLATE template_,
const char *  name,
const char *  implementation 
)

Definition at line 2373 of file schema_template.c.

References ID_CLASS_METHOD, and smt_add_method_any().

Referenced by au_add_method_check_authorization(), au_install(), and boot_define_serial().

Here is the caller graph for this function:

int smt_add_class_resolution ( SM_TEMPLATE template_,
MOP  super_class,
const char *  name,
const char *  alias 
)

Definition at line 3912 of file schema_template.c.

References add_resolution(), and ID_CLASS.

Referenced by db_add_class_resolution(), and dbt_add_class_resolution().

Here is the caller graph for this function:

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 *  attr_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 
)

Definition at line 1936 of file schema_template.c.

References ARG_FILE_LINE, assert, sm_template::class_type, DB_CONSTRAINT_INDEX, DB_CONSTRAINT_PRIMARY_KEY, DB_CONSTRAINT_REVERSE_INDEX, DB_IS_NULL, DB_TYPE_BLOB, DB_TYPE_CLOB, default_value, do_check_rows_for_null(), er_clear(), ER_ERROR_SEVERITY, ER_FK_CANT_ON_SHARED_ATTRIBUTE, ER_OBJ_INVALID_ARGUMENTS, ER_OUT_OF_VIRTUAL_MEMORY, ER_REGU_NOT_IMPLEMENTED, er_set(), ER_SM_ATTR_NOT_NULL, ER_SM_CONSTRAINT_EXISTS, ER_SM_INDEX_ATTR_DUPLICATED, ER_SM_INDEX_ON_SHARED, ER_SM_INHERITED_ATTRIBUTE, ER_SM_INVALID_ARGUMENTS, ER_SM_INVALID_CONSTRAINT, ER_SM_INVALID_INDEX_TYPE, ER_SM_INVALID_INDEX_WITH_PREFIX_TYPE, ER_SM_INVALID_PREFIX_LENGTH, ER_SM_INVALID_UNIQUE_TYPE, ER_SM_NOT_NULL_NOT_ALLOWED, ER_SM_NOT_NULL_ON_VCLASS, ER_SM_NOT_NULL_WRONG_NUM_ATTS, ER_SM_UNIQUE_ON_VCLASS, error(), ERROR0, ERROR1, ERROR2, sm_attribute::flags, free_and_init, sm_attribute::header, i, pr_type::id, sm_attribute::id, ID_ATTRIBUTE, ID_SHARED_ATTRIBUTE, intl_identifier_casecmp(), sm_component::name, sm_component::name_space, NO_ERROR, NULL, sm_template::op, pr_type_name(), rel_major_release_string(), SM_ATTFLAG_FOREIGN_KEY, SM_ATTFLAG_INDEX, SM_ATTFLAG_NON_NULL, SM_ATTFLAG_PRIMARY_KEY, SM_ATTFLAG_REVERSE_INDEX, SM_CLASS_CT, SM_GET_CONSTRAINT_STRING, SM_IS_ATTFLAG_INDEX_FAMILY, SM_IS_ATTFLAG_UNIQUE_FAMILY, SM_MAP_CONSTRAINT_TO_ATTFLAG, SM_MAP_INDEX_ATTFLAG_TO_CONSTRAINT, smt_add_constraint_to_property(), smt_check_foreign_key(), smt_check_index_exist(), smt_find_attribute(), TEXT_CONSTRAINT_PREFIX, TP_IS_BIT_TYPE, TP_IS_CHAR_TYPE, tp_valid_indextype(), and sm_attribute::type.

Referenced by classobj_copy_constraint_like(), dbt_add_constraint(), dbt_add_foreign_key(), do_add_constraints(), and sm_add_constraint().

Here is the caller graph for this function:

int smt_add_index ( SM_TEMPLATE template_,
const char *  name,
int  on_or_off 
)
int smt_add_method ( SM_TEMPLATE template_,
const char *  name,
const char *  implementation 
)

Definition at line 2367 of file schema_template.c.

References ID_METHOD, and smt_add_method_any().

Referenced by au_install().

Here is the caller graph for this function:

int smt_add_method_file ( SM_TEMPLATE template_,
const char *  filename 
)

Definition at line 3457 of file schema_template.c.

References assert, sm_method_file::class_mop, classobj_make_method_file(), er_errid(), error(), sm_template::method_files, NLIST_FIND, NO_ERROR, NULL, and WS_LIST_APPEND.

Referenced by db_add_method_file(), and dbt_add_method_file().

Here is the caller graph for this function:

int smt_add_query_spec ( SM_TEMPLATE template_,
const char *  specification 
)
int smt_add_resolution ( SM_TEMPLATE template_,
MOP  super_class,
const char *  name,
const char *  alias 
)

Definition at line 3906 of file schema_template.c.

References add_resolution(), and ID_INSTANCE.

Referenced by db_add_resolution(), and dbt_add_resolution().

Here is the caller graph for this function:

int smt_add_set_argument_domain ( SM_TEMPLATE template_,
const char *  name,
int  class_method,
const char *  implementation,
int  index,
const char *  domain_string,
DB_DOMAIN domain 
)
int smt_add_set_attribute_domain ( SM_TEMPLATE template_,
const char *  name,
int  class_attribute,
const char *  domain_string,
DB_DOMAIN domain 
)
int smt_assign_argument_domain ( SM_TEMPLATE template_,
const char *  name,
int  class_method,
const char *  implementation,
int  index,
const char *  domain_string,
DB_DOMAIN domain 
)
int smt_change_attribute_w_dflt_w_order ( DB_CTMPL def,
const char *  name,
const char *  new_name,
const char *  new_domain_string,
DB_DOMAIN new_domain,
const SM_NAME_SPACE  name_space,
DB_VALUE new_default_value,
DB_DEFAULT_EXPR new_def_expr,
DB_DEFAULT_EXPR_TYPE  new_on_update_expr,
const bool  change_first,
const char *  change_after_attribute,
SM_ATTRIBUTE **  found_att 
)
int smt_change_constraint_comment ( SM_TEMPLATE ctemplate,
const char *  index_name,
const char *  comment 
)
int smt_change_constraint_status ( SM_TEMPLATE ctemplate,
const char *  index_name,
SM_INDEX_STATUS  index_status 
)
int smt_check_index_exist ( SM_TEMPLATE template_,
char **  out_shared_cons_name,
DB_CONSTRAINT_TYPE  constraint_type,
const char *  constraint_name,
const char **  att_names,
const int *  asc_desc,
const SM_PREDICATE_INFO filter_index,
const SM_FUNCTION_INFO function_index 
)
SM_TEMPLATE* smt_copy_class ( const char *  new_name,
const char *  existing_name,
SM_CLASS **  class_ 
)

Definition at line 871 of file schema_template.c.

References NULL, sm_check_name(), sm_find_class(), and smt_copy_class_mop().

Referenced by dbt_copy_class().

Here is the caller graph for this function:

SM_TEMPLATE* smt_copy_class_mop ( const char *  name,
MOP  op,
SM_CLASS **  class_ 
)
SM_TEMPLATE* smt_def_class ( const char *  name)

Definition at line 733 of file schema_template.c.

References def_class_internal(), and SM_CLASS_CT.

Referenced by classobj_make_template_like(), db_create_class(), and dbt_create_class().

Here is the caller graph for this function:

SM_TEMPLATE* smt_def_typed_class ( const char *  name,
SM_CLASS_TYPE  ct 
)

Definition at line 4058 of file schema_template.c.

References def_class_internal().

Referenced by db_create_vclass(), and dbt_create_vclass().

Here is the caller graph for this function:

int smt_delete_class_resolution ( SM_TEMPLATE template_,
MOP  super_class,
const char *  name 
)

Definition at line 3936 of file schema_template.c.

References delete_resolution(), and ID_CLASS.

Referenced by db_drop_class_resolution(), and dbt_drop_class_resolution().

Here is the caller graph for this function:

int smt_delete_resolution ( SM_TEMPLATE template_,
MOP  super_class,
const char *  name 
)

Definition at line 3930 of file schema_template.c.

References delete_resolution(), and ID_INSTANCE.

Referenced by db_drop_resolution(), and dbt_drop_resolution().

Here is the caller graph for this function:

int smt_delete_set_attribute_domain ( SM_TEMPLATE template_,
const char *  name,
int  class_attribute,
const char *  domain_string,
DB_DOMAIN domain 
)
int smt_delete_super ( SM_TEMPLATE template_,
MOP  super_class 
)

Definition at line 3394 of file schema_template.c.

References ER_SM_SUPER_NOT_FOUND, error(), ERROR0, sm_template::inheritance, ml_remove(), and NO_ERROR.

Referenced by db_drop_super(), and dbt_drop_super().

Here is the caller graph for this function:

int smt_delete_super_connect ( SM_TEMPLATE template_,
MOP  super_class 
)
int smt_drop_method_file ( SM_TEMPLATE template_,
const char *  filename 
)
int smt_drop_query_spec ( SM_TEMPLATE template_,
const int  index 
)
SM_TEMPLATE* smt_edit_class_mop ( MOP  class_,
DB_AUTH  db_auth_type 
)

Definition at line 751 of file schema_template.c.

References ARG_FILE_LINE, au_fetch_class(), AU_FETCH_WRITE, classobj_make_template(), DB_FETCH_WRITE, ER_OBJ_NOT_A_CLASS, er_set(), ER_WARNING_SEVERITY, is_class(), locator_is_class(), NO_ERROR, NULL, sm_check_name(), sm_clean_class(), sm_find_class(), sm_get_ch_name(), and smt_edit_class_mop().

Referenced by add_arg_domain(), add_method_internal(), au_add_method_check_authorization(), au_install(), boot_define_attribute(), boot_define_charsets(), boot_define_class(), boot_define_class_authorization(), boot_define_collations(), boot_define_data_type(), boot_define_domain(), boot_define_dual(), boot_define_ha_apply_info(), boot_define_index(), boot_define_index_key(), boot_define_meth_argument(), boot_define_meth_file(), boot_define_meth_sig(), boot_define_method(), boot_define_partition(), boot_define_query_spec(), boot_define_serial(), boot_define_stored_procedure(), boot_define_stored_procedure_arguments(), change_constraints_comment_partitioned_class(), change_constraints_status_partitioned_class(), db_add_attribute_internal(), db_add_class_resolution(), db_add_method_file(), db_add_query_spec(), db_add_resolution(), db_add_set_attribute_domain(), db_add_super_internal(), db_change_default(), db_change_method_implementation(), db_change_query_spec(), db_drop_class_resolution(), db_drop_method_file(), db_drop_method_files(), db_drop_query_spec(), db_drop_resolution(), db_drop_set_attribute_domain(), db_drop_super(), db_drop_super_connect(), db_rename_internal(), db_set_loader_commands(), dbt_edit_class(), do_alter_index_comment(), do_alter_index_rebuild(), do_alter_index_status(), drop_internal(), sm_add_constraint(), sm_drop_constraint(), smt_edit_class_mop(), smt_rename_any(), and update_fk_ref_partitioned_class().

SM_CLASS_TYPE smt_get_class_type ( SM_TEMPLATE template_)

Definition at line 4070 of file schema_template.c.

Referenced by do_add_attribute(), and do_change_att_schema_only().

Here is the caller graph for this function:

int smt_rename_any ( SM_TEMPLATE template_,
const char *  name,
const bool  class_namespace,
const char *  new_name 
)

Definition at line 2561 of file schema_template.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, sm_template::attributes, AU_INDEX, check_namespace(), classobj_find_constraint_by_name(), classobj_free_class_constraints(), classobj_make_class_constraints(), classobj_map_constraint_to_property(), db_constraint_type(), DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, er_errid(), ER_ERROR_SEVERITY, ER_NOT_ALLOWED_ACCESS_TO_PARTITION, ER_REGU_NOT_IMPLEMENTED, er_set(), ER_SM_CONSTRAINT_HAS_DIFFERENT_TYPE, ER_SM_CONSTRAINT_NOT_FOUND, ER_SM_INDEX_EXISTS, ER_SM_INHERITED, error(), ERROR1, ERROR2, find_any(), sm_class_constraint::fk_info, free_and_init, i, ID_ATTRIBUTE, ID_CLASS_ATTRIBUTE, ID_SHARED_ATTRIBUTE, sm_class_constraint::index_btid, is_global, sm_component::name, sm_class_constraint::name, sm_template::name, sm_component::name_space, NO_ERROR, NULL, sm_template::op, sm_template::properties, sm_foreign_key_info::ref_class_oid, rel_major_release_string(), sm_check_name(), SM_CONSTRAINT_FOREIGN_KEY, SM_CONSTRAINT_NAME, sm_downcase_name(), sm_exist_index(), sm_get_ch_name(), SM_INDEX_NAME, SM_IS_CONSTRAINT_EXCEPT_INDEX_FAMILY, sm_is_global_only_constraint(), SM_IS_INDEX_FAMILY, SM_MAX_IDENTIFIER_LENGTH, sm_partitioned_class_type(), sm_produce_constraint_name(), sm_update_class(), smt_edit_class_mop(), smt_find_attribute(), smt_find_owner_of_constraint(), smt_quit(), sm_class_constraint::type, ws_copy_string(), ws_free_string(), and ws_mop().

Referenced by db_rename_internal(), and dbt_rename().

Here is the caller graph for this function:

int smt_rename_method_file ( SM_TEMPLATE template_,
const char *  old_name,
const char *  new_name 
)
int smt_reset_attribute_domain ( SM_TEMPLATE template_,
const char *  name,
int  class_attribute 
)
int smt_reset_method_files ( SM_TEMPLATE template_)

Definition at line 3488 of file schema_template.c.

References classobj_free_method_file(), error(), sm_template::method_files, NO_ERROR, NULL, and WS_LIST_FREE.

Referenced by db_drop_method_files(), and dbt_drop_method_files().

Here is the caller graph for this function:

int smt_reset_query_spec ( SM_TEMPLATE template_)

Definition at line 3988 of file schema_template.c.

References classobj_free_query_spec(), error(), NO_ERROR, NULL, sm_template::query_spec, and WS_LIST_FREE.

Referenced by dbt_reset_query_spec().

Here is the caller graph for this function:

int smt_set_attribute_on_update ( SM_TEMPLATE template_,
const char *  name,
int  class_attribute,
DB_DEFAULT_EXPR_TYPE  on_update 
)

Definition at line 1458 of file schema_template.c.

References error(), NO_ERROR, sm_attribute::on_update_default_expr, and smt_find_attribute().

Referenced by smt_add_attribute_w_dflt_w_order(), and smt_change_attribute_w_dflt_w_order().

Here is the caller graph for this function:

int smt_set_loader_commands ( SM_TEMPLATE template_,
const char *  commands 
)

Definition at line 3601 of file schema_template.c.

References sm_template::loader_commands, NO_ERROR, ws_copy_string(), and ws_free_string().

Referenced by db_set_loader_commands(), and dbt_set_loader_commands().

Here is the caller graph for this function: