CUBRID Engine  latest
schema_manager.h File Reference
#include "language_support.h"
#include "storage_common.h"
#include "object_domain.h"
#include "work_space.h"
#include "class_object.h"
#include "schema_template.h"
#include "trigger_manager.h"
#include "tde.h"
Include dependency graph for schema_manager.h:

Go to the source code of this file.

Classes

struct  sm_constraint_info
 

Typedefs

typedef SM_CLASS ROOT_CLASS
 
typedef struct sm_constraint_info SM_CONSTRAINT_INFO
 

Functions

int sm_finish_class (SM_TEMPLATE *template_, MOP *classmop)
 
int sm_update_class (SM_TEMPLATE *template_, MOP *classmop)
 
int sm_update_class_with_auth (SM_TEMPLATE *template_, MOP *classmop, DB_AUTH auth, bool lock_hierarchy)
 
int sm_update_class_auto (SM_TEMPLATE *template_, MOP *classmop)
 
int sm_delete_class_mop (MOP op, bool is_cascade_constraints)
 
int ib_get_thread_count ()
 
int sm_get_index (MOP classop, const char *attname, BTID *index)
 
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)
 
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)
 
char * sm_produce_constraint_name_tmpl (SM_TEMPLATE *tmpl, DB_CONSTRAINT_TYPE constraint_type, const char **att_names, const int *asc_desc, const char *given_name)
 
int 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 *predicate_info, SM_FUNCTION_INFO *fi_info, const char *comment, SM_INDEX_STATUS index_status)
 
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 sm_drop_index (MOP classop, const char *constraint_name)
 
int sm_exist_index (MOP classop, const char *idxname, BTID *btid)
 
int sm_rename_class (MOP op, const char *new_name)
 
void sm_mark_system_classes (void)
 
int sm_update_all_catalog_statistics (bool with_fullscan)
 
int sm_update_catalog_statistics (const char *class_name, bool with_fullscan)
 
int sm_force_write_all_classes (void)
 
int sm_mark_system_class (MOP classop, int on_or_off)
 
int sm_is_system_class (MOP op)
 
bool sm_is_reuse_oid_class (MOP op)
 
int sm_check_reuse_oid_class (MOP op)
 
int sm_is_partitioned_class (MOP op)
 
int sm_partitioned_class_type (DB_OBJECT *classop, int *partition_type, char *keyattr, MOP **partitions)
 
int sm_set_class_flag (MOP classop, SM_CLASS_FLAG flag, int onoff)
 
int sm_set_class_tde_algorithm (MOP classop, TDE_ALGORITHM tde_algo)
 
int sm_get_class_tde_algorithm (MOP classop, TDE_ALGORITHM *tde_algo)
 
int sm_get_class_flag (MOP op, SM_CLASS_FLAG flag)
 
int sm_set_class_collation (MOP classop, int collation_id)
 
int sm_get_class_collation (MOP classop, int *collation_id)
 
int sm_set_class_comment (MOP classop, const char *comment)
 
int sm_destroy_representations (MOP op)
 
void sm_add_static_method (const char *name, void(*function)())
 
void sm_delete_static_method (const char *name)
 
void sm_flush_static_methods (void)
 
int sm_link_method (SM_CLASS *class_, SM_METHOD *method)
 
int sm_prelink_methods (DB_OBJLIST *classes)
 
int sm_force_method_link (MOP obj)
 
char * sm_get_method_source_file (MOP obj, const char *name)
 
int sm_truncate_class (MOP class_mop)
 
int sm_save_constraint_info (SM_CONSTRAINT_INFO **save_info, const SM_CLASS_CONSTRAINT *const c)
 
int sm_save_function_index_info (SM_FUNCTION_INFO **save_info, SM_FUNCTION_INFO *func_index_info)
 
int sm_save_filter_index_info (SM_PREDICATE_INFO **save_info, SM_PREDICATE_INFO *filter_index_info)
 
void sm_free_constraint_info (SM_CONSTRAINT_INFO **save_info)
 
int sm_check_name (const char *name)
 
int sm_check_catalog_rep_dir (MOP classmop, SM_CLASS *class_)
 
SM_NAME_SPACE sm_resolution_space (SM_NAME_SPACE name_space)
 
MOP sm_get_class (MOP obj)
 
SM_CLASS_TYPE sm_get_class_type (SM_CLASS *class_)
 
DB_OBJLISTsm_fetch_all_classes (int external_list, DB_FETCH_MODE purpose)
 
DB_OBJLISTsm_fetch_all_base_classes (int external_list, DB_FETCH_MODE purpose)
 
DB_OBJLISTsm_fetch_all_objects (DB_OBJECT *op, DB_FETCH_MODE purpose)
 
DB_OBJLISTsm_fetch_all_objects_of_dirty_version (DB_OBJECT *op, DB_FETCH_MODE purpose)
 
int sm_filter_domain (TP_DOMAIN *domain, int *changes)
 
int sm_check_class_domain (TP_DOMAIN *domain, MOP class_)
 
int sm_check_object_domain (TP_DOMAIN *domain, MOP object)
 
int sm_coerce_object_domain (TP_DOMAIN *domain, MOP object, MOP *dest_object)
 
int sm_clean_class (MOP classmop, SM_CLASS *class_)
 
int sm_touch_class (MOP classmop)
 
SM_CLASSsm_get_class_with_statistics (MOP classop)
 
CLASS_STATSsm_get_statistics_force (MOP classop)
 
int sm_update_statistics (MOP classop, bool with_fullscan)
 
int sm_update_all_statistics (bool with_fullscan)
 
const char * sm_get_ch_name (MOP op)
 
HFIDsm_get_ch_heap (MOP classmop)
 
int sm_is_subclass (MOP classmop, MOP supermop)
 
int sm_is_partition (MOP classmop, MOP supermop)
 
int sm_object_size_quick (SM_CLASS *class_, MOBJ obj)
 
SM_CLASS_CONSTRAINTsm_class_constraints (MOP classop)
 
const char * sm_ch_name (const MOBJ clobj)
 
HFIDsm_ch_heap (MOBJ clobj)
 
OIDsm_ch_rep_dir (MOBJ clobj)
 
bool sm_has_indexes (MOBJ class_)
 
void sm_downcase_name (const char *name, char *buf, int maxlen)
 
MOP sm_find_class (const char *name)
 
MOP sm_find_class_with_purpose (const char *name, bool for_update)
 
const char * sm_get_att_name (MOP classop, int id)
 
int sm_att_id (MOP classop, const char *name)
 
DB_TYPE sm_att_type_id (MOP classop, const char *name)
 
MOP sm_att_class (MOP classop, const char *name)
 
int sm_att_info (MOP classop, const char *name, int *idp, TP_DOMAIN **domainp, int *sharedp, int class_attr)
 
int sm_att_constrained (MOP classop, const char *name, SM_ATTRIBUTE_FLAG cons)
 
bool sm_att_auto_increment (MOP classop, const char *name)
 
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_class_check_uniques (MOP classop)
 
BTIDsm_find_index (MOP classop, char **att_names, int num_atts, bool unique_index_only, bool skip_prefix_length_index, BTID *btid)
 
int sm_get_class_repid (MOP classop)
 
unsigned int sm_local_schema_version (void)
 
void sm_bump_local_schema_version (void)
 
unsigned int sm_global_schema_version (void)
 
void sm_bump_global_schema_version (void)
 
struct parser_contextsm_virtual_queries (struct parser_context *parser, DB_OBJECT *class_object)
 
int sm_flush_objects (MOP obj)
 
int sm_decache_mop (MOP mop, void *info)
 
int sm_decache_instances_after_query_executed_with_commit (MOP class_mop)
 
int sm_flush_and_decache_objects (MOP obj, int decache)
 
int sm_flush_for_multi_update (MOP class_mop)
 
int sm_issystem (SM_CLASS *class_)
 
int sm_class_has_triggers (DB_OBJECT *classop, int *status, DB_TRIGGER_EVENT event_type)
 
int sm_get_trigger_cache (DB_OBJECT *class_, const char *attribute, int class_attribute, void **cache)
 
int sm_invalidate_trigger_cache (DB_OBJECT *classop)
 
int sm_add_trigger (DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *trigger)
 
int sm_drop_trigger (DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *trigger)
 
int sm_active_triggers (MOP class_mop, SM_CLASS *class_, DB_TRIGGER_EVENT event_type)
 
int sm_get_attribute_descriptor (DB_OBJECT *op, const char *name, int class_attribute, int for_update, SM_DESCRIPTOR **desc)
 
int sm_get_method_descriptor (DB_OBJECT *op, const char *name, int class_method, SM_DESCRIPTOR **desc)
 
void sm_free_descriptor (SM_DESCRIPTOR *desc)
 
int sm_get_descriptor_component (MOP op, SM_DESCRIPTOR *desc, int for_update, SM_CLASS **class_ptr, SM_COMPONENT **comp_ptr)
 
void sm_fee_resident_classes_virtual_query_cache (void)
 
void sm_final (void)
 
void sm_transaction_boundary (void)
 
void sm_create_root (OID *rootclass_oid, HFID *rootclass_hfid)
 
void sm_init (OID *rootclass_oid, HFID *rootclass_hfid)
 
int sm_class_has_unique_constraint (MOBJ classobj, MOP classop, bool check_subclasses, bool *has_unique)
 
int sm_att_unique_constrained (MOP classop, const char *name)
 
int sm_att_in_unique_filter_constraint_predicate (MOP classop, const char *name)
 
int sm_att_fk_constrained (MOP classop, const char *name)
 
bool classobj_is_exist_foreign_key_ref (MOP refop, SM_FOREIGN_KEY_INFO *fk_info)
 
int classobj_put_foreign_key_ref (DB_SEQ **properties, SM_FOREIGN_KEY_INFO *fk_info)
 
int classobj_drop_foreign_key_ref (DB_SEQ **properties, const BTID *btid, const char *name)
 
int sc_set_current_schema (MOP user)
 
int sm_has_non_null_attribute (SM_ATTRIBUTE **attrs)
 
void sm_free_function_index_info (SM_FUNCTION_INFO *func_index_info)
 
void sm_free_filter_index_info (SM_PREDICATE_INFO *filter_index_info)
 
int sm_is_global_only_constraint (MOP classmop, SM_CLASS_CONSTRAINT *constraint, int *is_global, SM_TEMPLATE *template_)
 
int sm_find_subclass_in_hierarchy (MOP hierarchy, MOP class_mop, bool *found)
 
bool sm_is_index_visible (SM_CLASS_CONSTRAINT *constraint_list, BTID btid)
 
SM_DOMAINsm_domain_alloc ()
 
void sm_domain_free (SM_DOMAIN *ptr)
 
SM_DOMAINsm_domain_copy (SM_DOMAIN *ptr)
 

Variables

ROOT_CLASS sm_Root_class
 
const char TEXT_CONSTRAINT_PREFIX []
 
MOP sm_Root_class_mop
 
HFIDsm_Root_class_hfid
 
const char * sm_Root_class_name
 

Typedef Documentation

Definition at line 57 of file schema_manager.h.

Definition at line 65 of file schema_manager.h.

Function Documentation

int ib_get_thread_count ( )

Definition at line 15379 of file execute_schema.c.

References ib_thread_count.

Referenced by btree_load_index().

Here is the caller graph for this function:

int sc_set_current_schema ( MOP  user)

Definition at line 478 of file schema_manager.c.

References au_get_user_name(), ER_FAILED, error(), intl_identifier_lower(), schema_def::name, NO_ERROR, NULL, schema_def::owner, and ws_free_string().

Referenced by au_set_user().

Here is the caller graph for this function:

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 predicate_info,
SM_FUNCTION_INFO fi_info,
const char *  comment,
SM_INDEX_STATUS  index_status 
)

Definition at line 14618 of file schema_manager.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, AU_ALTER, AU_INDEX, sm_template::current, DB_CONSTRAINT_INDEX, DB_CONSTRAINT_NOT_NULL, DB_CONSTRAINT_PRIMARY_KEY, DB_CONSTRAINT_REVERSE_INDEX, DB_CONSTRAINT_REVERSE_UNIQUE, DB_CONSTRAINT_UNIQUE, DB_IS_CONSTRAINT_UNIQUE_FAMILY, DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, do_check_fk_constraints(), ER_ERROR_SEVERITY, ER_LK_UNILATERALLY_ABORTED, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_SM_INDEX_PREFIX_LENGTH_ON_PARTITIONED_CLASS, ER_SM_ONLINE_INDEX_ON_HIERARCHY, ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED, error(), ERROR0, free_and_init, i, sm_class::inheritance, IX_LOCK, db_object::lock, NO_ERROR, NULL, SM_ADD_CONSTRAINT_SAVEPOINT_NAME, sm_add_secondary_index_on_partition(), sm_load_online_index(), SM_NORMAL_INDEX, SM_ONLINE_INDEX_BUILDING_IN_PROGRESS, sm_partitioned_class_type(), sm_update_class(), sm_update_class_with_auth(), sm_update_statistics(), smt_add_constraint(), smt_change_constraint_status(), smt_check_index_exist(), smt_edit_class_mop(), smt_quit(), STATS_WITH_SAMPLING, tran_abort_upto_system_savepoint(), tran_system_savepoint(), and sm_class::users.

Referenced by create_or_drop_index_helper(), db_add_constraint(), do_alter_clause_change_attribute(), do_alter_index_rebuild(), do_copy_indexes(), do_create_partition_constraint(), do_recreate_att_constraints(), do_recreate_renamed_class_indexes(), do_recreate_saved_indexes(), sm_add_secondary_index_on_partition(), and sm_truncate_class().

Here is the caller graph for this function:

void sm_add_static_method ( const char *  name,
void(*)()  function 
)
int sm_add_trigger ( DB_OBJECT classop,
const char *  attribute,
int  class_attribute,
DB_OBJECT trigger 
)

Definition at line 4494 of file schema_manager.c.

References alter_trigger_hierarchy(), AU_ALTER, au_fetch_class(), AU_FETCH_UPDATE, error(), NO_ERROR, and NULL.

Referenced by tr_create_trigger().

Here is the caller graph for this function:

bool sm_att_auto_increment ( MOP  classop,
const char *  name 
)

Definition at line 5437 of file schema_manager.c.

References find_attribute_op(), sm_attribute::flags, NO_ERROR, NULL, rc, and SM_ATTFLAG_AUTO_INCREMENT.

Referenced by check_for_cons().

Here is the caller graph for this function:

MOP sm_att_class ( MOP  classop,
const char *  name 
)

Definition at line 5246 of file schema_manager.c.

References tp_domain::class_mop, sm_attribute::domain, find_attribute_op(), NO_ERROR, NULL, sm_filter_domain(), tp_Type_object, and tp_domain::type.

Referenced by db_get_attribute_class().

Here is the caller graph for this function:

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_att_fk_constrained ( MOP  classop,
const char *  name 
)

Definition at line 5537 of file schema_manager.c.

References db_attribute_is_foreign_key(), find_attribute_op(), NO_ERROR, and NULL.

Referenced by create_or_drop_index_helper().

Here is the caller graph for this function:

int sm_att_id ( MOP  classop,
const char *  name 
)
int sm_att_info ( MOP  classop,
const char *  name,
int *  idp,
TP_DOMAIN **  domainp,
int *  sharedp,
int  class_attr 
)
DB_TYPE sm_att_type_id ( MOP  classop,
const char *  name 
)
int sm_att_unique_constrained ( MOP  classop,
const char *  name 
)

Definition at line 5608 of file schema_manager.c.

References classobj_has_unique_constraint(), sm_attribute::constraints, find_attribute_op(), NO_ERROR, NULL, and rc.

Referenced by check_for_cons(), and create_or_drop_index_helper().

Here is the caller graph for this function:

void sm_bump_global_schema_version ( void  )

Definition at line 6232 of file schema_manager.c.

References global_schema_version.

Referenced by tf_disk_to_class().

Here is the caller graph for this function:

void sm_bump_local_schema_version ( void  )

Definition at line 6210 of file schema_manager.c.

References local_schema_version.

Referenced by au_grant(), au_perform_login(), au_revoke(), sm_delete_class_mop(), and update_class().

Here is the caller graph for this function:

const char* sm_ch_name ( const MOBJ  clobj)

Definition at line 4815 of file schema_manager.c.

References assert, sm_class_header::ch_name, sm_class_header::ch_type, NULL, SM_META_CLASS, and SM_META_ROOT.

Referenced by allocate_foreign_key(), check_domain_class_type(), classobj_cache_class_constraints(), classobj_class_size(), classobj_copy_constraint_like(), classobj_filter_components(), classobj_make_template_like(), compactdb_start(), object_printer::describe_constraint(), disk_to_class(), do_coalesce_partition_pre(), do_copy_indexes(), do_create_partition_constraint(), do_drop_partition_list(), do_promote_partition(), do_promote_partition_list(), do_reclaim_class_addresses(), do_recreate_renamed_class_indexes(), do_remove_partition_pre(), do_rename_partition(), drop_foreign_key_ref_internal(), extract_objects(), flatten_subclasses(), get_desc_old(), get_old(), help_describe_mop(), object_description::init(), class_description::init(), is_protected_class(), la_flush_repl_items(), locator_assign_permanent_oid(), locator_remove_class(), lockhint_subclasses(), obt_apply_assignments(), obt_check_missing_assignments(), process_class(), process_value(), put_class_attributes(), put_class_varinfo(), root_size(), root_to_disk(), sl_print_select(), sl_write_insert_sql(), sl_write_update_sql(), sm_check_index_exist(), sm_delete_class_mop(), sm_get_ch_name(), sm_rename_class(), sm_save_constraint_info(), smt_check_foreign_key(), smt_is_change_status_allowed(), tf_class_size(), transfer_disk_structures(), unloaddb(), update_class(), update_foreign_key_ref(), ws_add_classname(), ws_cache(), ws_clear_hints(), ws_decache(), ws_drop_classname(), ws_dump(), and ws_set_lock().

OID* sm_ch_rep_dir ( MOBJ  clobj)

Definition at line 4869 of file schema_manager.c.

References sm_class_header::ch_rep_dir, and NULL.

Referenced by au_fetch_class_internal(), disk_to_class(), disk_to_root(), locator_create_heap_if_needed(), put_class_attributes(), root_to_disk(), and sm_get_ch_heap().

Here is the caller graph for this function:

int sm_check_catalog_rep_dir ( MOP  classmop,
SM_CLASS class_ 
)
int sm_check_object_domain ( TP_DOMAIN domain,
MOP  object 
)
int sm_check_reuse_oid_class ( MOP  op)

Definition at line 3049 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_READ, error(), sm_class::flags, NO_ERROR, NULL, and SM_CLASSFLAG_REUSE_OID.

Referenced by pt_is_reference_to_reusable_oid().

Here is the caller graph for this function:

int sm_class_has_unique_constraint ( MOBJ  classobj,
MOP  classop,
bool  check_subclasses,
bool has_unique 
)
int sm_coerce_object_domain ( TP_DOMAIN domain,
MOP  object,
MOP dest_object 
)
int sm_decache_mop ( MOP  mop,
void *  info 
)

Definition at line 5958 of file schema_manager.c.

References NO_ERROR, vid_decache_instance(), ws_decache(), and WS_ISVID.

Referenced by locator_mflush(), and sm_decache_instances_after_query_executed_with_commit().

Here is the caller graph for this function:

int sm_delete_class_mop ( MOP  op,
bool  is_cascade_constraints 
)

Definition at line 13019 of file schema_manager.c.

References abort_subclasses(), assert, AU_ALTER, au_delete_auth_of_dropping_table(), AU_DISABLE, AU_ENABLE, au_fetch_class(), AU_FETCH_WRITE, sm_attribute::auto_increment, sm_class::class_type, classobj_find_cons_primary_key(), classobj_free_template(), classobj_is_pk_referred(), classobj_make_template(), sm_class::constraints, COPY_OID, DB_FETCH_WRITE, db_get(), db_get_string(), DB_PARTITIONED_CLASS, db_value_clear(), DECACHE, do_drop_partitioned_class(), er_errid(), ER_FAILED, ER_FK_CANT_DROP_PK_REFERRED, ER_LK_UNILATERALLY_ABORTED, ER_OBJ_NOT_A_CLASS, ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED, error(), ERROR0, ERROR2, sm_class_constraint::fk_info, flatten_subclasses(), sm_class::inheritance, is_class(), locator_flush_all_instances(), locator_is_class(), locator_remove_class(), lock_subclasses(), lock_supers_drop(), lockhint_subclasses(), ml_copy(), ml_free(), sm_class_constraint::name, NO_ERROR, NULL, obj_delete(), sm_attribute::order_link, sm_class::ordered_attributes, remove_class_triggers(), serial_decache(), sm_bump_local_schema_version(), sm_ch_name(), SM_CLASS_CT, sm_delete_class_mop(), sm_drop_cascade_foreign_key(), SM_DROP_CLASS_MOP_SAVEPOINT_NAME, sm_find_class(), sm_get_ch_name(), sm_partitioned_class_type(), SM_VCLASS_CT, tran_abort_upto_system_savepoint(), tran_system_savepoint(), transfer_disk_structures(), UNIQUE_PARTITION_SAVEPOINT_DROP, update_subclasses(), update_supers_drop(), sm_class::users, vid_flush_all_instances(), ws_identifier(), ws_mark_instances_deleted(), and ws_remove_resident_class().

Referenced by db_drop_class_ex(), do_coalesce_partition_post(), do_drop_partition_list(), do_drop_partitioned_class(), do_remove_partition_post(), do_reorganize_partition_post(), and sm_delete_class_mop().

Here is the caller graph for this function:

void sm_delete_static_method ( const char *  name)

Definition at line 587 of file schema_manager.c.

References free_and_init, static_method::name, static_method::next, and NULL.

Referenced by db_unlink_static_methods().

Here is the caller graph for this function:

int sm_destroy_representations ( MOP  op)

Definition at line 3347 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_UPDATE, classobj_free_representation(), error(), NO_ERROR, NULL, sm_class::representations, and ws_list_free().

Referenced by compactdb_start(), and process_class().

Here is the caller graph for this function:

SM_DOMAIN* sm_domain_alloc ( )

Definition at line 16701 of file schema_manager.c.

Referenced by pt_get_src_domain(), pt_set_domain_class_list(), and sm_domain_copy().

Here is the caller graph for this function:

void sm_domain_free ( SM_DOMAIN ptr)

Definition at line 16690 of file schema_manager.c.

References free_and_init, tp_domain::next, NULL, tp_domain::setdomain, and sm_domain_free().

Referenced by db_free_query_format(), db_unpack_prepare_info(), sm_domain_copy(), and sm_domain_free().

Here is the caller graph for this function:

int sm_drop_trigger ( DB_OBJECT classop,
const char *  attribute,
int  class_attribute,
DB_OBJECT trigger 
)

Definition at line 4526 of file schema_manager.c.

References alter_trigger_hierarchy(), AU_ALTER, au_fetch_class(), AU_FETCH_UPDATE, ER_HEAP_UNKNOWN_OBJECT, error(), NO_ERROR, and NULL.

Referenced by tr_drop_trigger_internal().

Here is the caller graph for this function:

int sm_exist_index ( MOP  classop,
const char *  idxname,
BTID btid 
)

Definition at line 13382 of file schema_manager.c.

References allocate_index(), ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, au_fetch_class(), au_fetch_class_by_classmop(), AU_FETCH_EXCLUSIVE_SCAN, AU_FETCH_READ, AU_INDEX, AU_SELECT, BTID_COPY, BTID_IS_NULL, BTID_SET_NULL, classobj_cache_class_constraints(), classobj_cache_constraints(), classobj_decache_class_constraints(), classobj_find_attribute(), classobj_find_class_index(), classobj_find_constraint_by_name(), classobj_put_index(), sm_class::constraints, DB_CONSTRAINT_INDEX, DB_CONSTRAINT_REVERSE_INDEX, db_constraint_type(), DECACHE, db_object::decached, do_recreate_filter_index_constr(), do_recreate_func_index_constr(), er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_LK_UNILATERALLY_ABORTED, ER_OUT_OF_VIRTUAL_MEMORY, ER_REGU_NOT_IMPLEMENTED, er_set(), ER_SM_ATTRIBUTE_NOT_FOUND, ER_SM_INDEX_EXISTS, ER_SM_INDEX_ON_SHARED, ER_SM_INDEX_PREFIX_LENGTH_ON_PARTITIONED_CLASS, error(), ERROR1, free_and_init, i, ID_ATTRIBUTE, ID_SHARED_ATTRIBUTE, sm_class_constraint::index_btid, locator_flush_all_instances(), locator_flush_class(), locator_update_class(), NO_ERROR, NULL, sm_predicate_info::num_attrs, sm_class::properties, rel_major_release_string(), sm_check_index_exist(), sm_exist_index(), sm_free_filter_index_info(), sm_free_function_index_info(), sm_get_ch_name(), SM_IS_CONSTRAINT_REVERSE_INDEX_FAMILY, SM_MAP_DB_INDEX_CONSTRAINT_TO_SM_CONSTRAINT, sm_partitioned_class_type(), sm_save_filter_index_info(), sm_save_function_index_info(), sm_update_statistics(), STATS_WITH_SAMPLING, TEXT_CONSTRAINT_PREFIX, tran_abort_upto_system_savepoint(), tran_system_savepoint(), tran_unilaterally_abort(), and UNIQUE_PARTITION_SAVEPOINT_INDEX.

Referenced by sm_add_secondary_index_on_partition(), sm_drop_index(), sm_exist_index(), smt_rename_any(), and transfer_disk_structures().

Here is the caller graph for this function:

void sm_fee_resident_classes_virtual_query_cache ( void  )
DB_OBJLIST* sm_fetch_all_objects ( DB_OBJECT op,
DB_FETCH_MODE  purpose 
)

Definition at line 2469 of file schema_manager.c.

References NULL, and sm_fetch_all_objects_internal().

Referenced by au_force_write_new_auth(), db_fetch_all_objects(), db_get_all_objects(), sm_fetch_all_objects_internal(), and tr_get_class_name().

Here is the caller graph for this function:

DB_OBJLIST* sm_fetch_all_objects_of_dirty_version ( DB_OBJECT op,
DB_FETCH_MODE  purpose 
)

Definition at line 2484 of file schema_manager.c.

References LC_FETCH_DIRTY_VERSION, and sm_fetch_all_objects_internal().

void sm_final ( void  )

Definition at line 2081 of file schema_manager.c.

References sm_descriptor::next, NULL, sm_free_descriptor(), and sm_free_resident_classes_virtual_query_cache().

Referenced by boot_client_all_finalize(), boot_initialize_client(), and boot_restart_client().

Here is the caller graph for this function:

MOP sm_find_class ( const char *  name)

Definition at line 5040 of file schema_manager.c.

References locator_find_class(), sm_downcase_name(), and SM_MAX_IDENTIFIER_LENGTH.

Referenced by au_change_owner_method(), au_change_serial_owner_method(), au_check_authorization_method(), au_force_write_new_auth(), au_get_owner_method(), au_make_user(), au_set_new_auth(), au_set_password_internal(), au_start(), boot_client_find_and_cache_class_oids(), build_query_graph_function_index(), db_find_class(), db_get_schema_def_dbval(), db_get_serial_current_value(), db_get_serial_next_value_ex(), db_preload_classes(), disk_to_class(), do_add_attribute_from_select_column(), do_alter_serial(), do_change_att_schema_only(), do_coalesce_partition_post(), do_coalesce_partition_pre(), do_create_auto_increment_serial(), do_create_serial(), do_create_serial_internal(), do_drop_partition_list(), do_drop_serial(), do_find_auto_increment_serial(), do_promote_partition(), do_promote_partition_by_name(), do_promote_partition_list(), do_redistribute_partitions_data(), do_remove_partition_post(), do_reorganize_partition_post(), do_update_maxvalue_of_auto_increment_serial(), graph_size_for_entity(), class_description::init(), obj_create_by_name(), populate_auto_increment(), pt_check_access_status(), pt_check_show_index(), pt_check_table_in_show_heap(), pt_help_show_create_table(), pt_resolve_serial(), pt_to_aggregate_node(), sm_delete_class_mop(), smt_check_foreign_key(), smt_copy_class(), smt_edit_class_mop(), stats_dump(), tr_get_class_name(), and tr_is_trigger().

MOP sm_find_class_with_purpose ( const char *  name,
bool  for_update 
)

Definition at line 5059 of file schema_manager.c.

References locator_find_class_with_purpose(), sm_downcase_name(), and SM_MAX_IDENTIFIER_LENGTH.

Referenced by db_find_class_with_purpose().

Here is the caller graph for this function:

int sm_find_subclass_in_hierarchy ( MOP  hierarchy,
MOP  class_mop,
bool found 
)
int sm_finish_class ( SM_TEMPLATE template_,
MOP classmop 
)

Definition at line 12866 of file schema_manager.c.

References AU_ALTER, and update_class().

Referenced by dbt_finish_class().

Here is the caller graph for this function:

int sm_flush_for_multi_update ( MOP  class_mop)

Definition at line 6150 of file schema_manager.c.

References assert, er_errid(), error(), locator_flush_for_multi_update(), NO_ERROR, sm_class_check_uniques(), success(), vid_flush_all_instances(), and WS_ISVID.

Referenced by update_objs_for_list_file().

Here is the caller graph for this function:

void sm_flush_static_methods ( void  )

Definition at line 629 of file schema_manager.c.

References free_and_init, static_method::name, static_method::next, sm_candidate::next, and NULL.

Referenced by boot_client_all_finalize(), and db_flush_static_methods().

Here is the caller graph for this function:

int sm_force_method_link ( MOP  obj)

Definition at line 1716 of file schema_manager.c.

References au_fetch_class(), AU_FETCH_READ, AU_SELECT, error(), sm_class::methods_loaded, NO_ERROR, NULL, and sm_link_methods().

Referenced by db_force_method_reload().

Here is the caller graph for this function:

int sm_force_write_all_classes ( void  )
void sm_free_descriptor ( SM_DESCRIPTOR desc)

Definition at line 6630 of file schema_manager.c.

References classobj_free_descriptor(), sm_descriptor::next, and NULL.

Referenced by db_free_attribute_descriptor(), db_free_method_descriptor(), and sm_final().

Here is the caller graph for this function:

void sm_free_filter_index_info ( SM_PREDICATE_INFO filter_index_info)
const char* sm_get_att_name ( MOP  classop,
int  id 
)

Definition at line 5147 of file schema_manager.c.

References au_fetch_class(), AU_FETCH_READ, AU_SELECT, classobj_find_attribute_id(), error(), sm_attribute::header, schema_def::name, sm_component::name, NO_ERROR, and NULL.

Referenced by stats_dump().

Here is the caller graph for this function:

MOP sm_get_class ( MOP  obj)
int sm_get_class_collation ( MOP  classop,
int *  collation_id 
)

Definition at line 2961 of file schema_manager.c.

References assert, au_fetch_class_force(), AU_FETCH_READ, sm_class::collation_id, error(), NO_ERROR, and NULL.

Referenced by pt_check_alter().

Here is the caller graph for this function:

int sm_get_class_flag ( MOP  op,
SM_CLASS_FLAG  flag 
)

Definition at line 3265 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_READ, DB_FETCH_READ, sm_class::flags, locator_is_class(), NO_ERROR, and NULL.

Referenced by emit_schema(), mq_translate_subqueries(), sm_is_system_class(), and test_check_option().

Here is the caller graph for this function:

int sm_get_class_tde_algorithm ( MOP  classop,
TDE_ALGORITHM tde_algo 
)

Definition at line 2914 of file schema_manager.c.

References assert, au_fetch_class_force(), AU_FETCH_READ, error(), NO_ERROR, NULL, sm_class::tde_algorithm, and TDE_ALGORITHM_NONE.

Referenced by object_printer::describe_class().

Here is the caller graph for this function:

int sm_get_method_descriptor ( DB_OBJECT op,
const char *  name,
int  class_method,
SM_DESCRIPTOR **  desc 
)
char* sm_get_method_source_file ( MOP  obj,
const char *  name 
)
CLASS_STATS* sm_get_statistics_force ( MOP  classop)
unsigned int sm_global_schema_version ( void  )

Definition at line 6221 of file schema_manager.c.

References global_schema_version.

Referenced by sm_virtual_queries().

Here is the caller graph for this function:

bool sm_has_indexes ( MOBJ  class_)
int sm_has_non_null_attribute ( SM_ATTRIBUTE **  attrs)

Definition at line 15911 of file schema_manager.c.

References assert, i, NULL, and SM_ATTFLAG_NON_NULL.

void sm_init ( OID rootclass_oid,
HFID rootclass_hfid 
)
int sm_invalidate_trigger_cache ( DB_OBJECT classop)

Definition at line 4308 of file schema_manager.c.

References au_fetch_class(), AU_FETCH_READ, AU_SELECT, error(), NO_ERROR, and sm_class::triggers_validated.

Referenced by tr_set_status().

Here is the caller graph for this function:

bool sm_is_index_visible ( SM_CLASS_CONSTRAINT constraint_list,
BTID  btid 
)

Definition at line 16656 of file schema_manager.c.

References assert, BTID_IS_EQUAL, sm_class_constraint::index_btid, sm_class_constraint::index_status, sm_class_constraint::next, NO_ERROR, NULL, and SM_NORMAL_INDEX.

Referenced by qo_get_attr_info().

Here is the caller graph for this function:

int sm_is_partition ( MOP  classmop,
MOP  supermop 
)

Definition at line 4688 of file schema_manager.c.

References au_fetch_class(), AU_FETCH_READ, AU_SELECT, error(), sm_class::inheritance, NO_ERROR, NULL, db_objlist::op, sm_class::partition, and sm_class::users.

Referenced by db_is_partition().

Here is the caller graph for this function:

int sm_is_subclass ( MOP  classmop,
MOP  supermop 
)

Definition at line 4641 of file schema_manager.c.

References assert, ASSERT_ERROR, au_fetch_class(), AU_FETCH_READ, AU_SELECT, er_errid(), sm_class::inheritance, db_objlist::next, NO_ERROR, NULL, db_objlist::op, and sm_is_subclass().

Referenced by db_is_subclass(), and sm_is_subclass().

Here is the caller graph for this function:

int sm_is_system_class ( MOP  op)

Definition at line 3014 of file schema_manager.c.

References SM_CLASSFLAG_SYSTEM, and sm_get_class_flag().

Referenced by db_is_system_class(), extract_objects(), mq_updatable_local(), tr_dump_selective_triggers(), and tr_status_as_string().

Here is the caller graph for this function:

int sm_issystem ( SM_CLASS class_)

Definition at line 6188 of file schema_manager.c.

References sm_class::flags, and SM_CLASSFLAG_SYSTEM.

Referenced by au_change_owner_method(), and is_protected_class().

Here is the caller graph for this function:

int sm_link_method ( SM_CLASS class_,
SM_METHOD method 
)
unsigned int sm_local_schema_version ( void  )

Definition at line 6199 of file schema_manager.c.

References local_schema_version.

Referenced by make_template(), sm_virtual_queries(), and validate_template().

Here is the caller graph for this function:

void sm_mark_system_classes ( void  )
int sm_partitioned_class_type ( DB_OBJECT classop,
int *  partition_type,
char *  keyattr,
MOP **  partitions 
)

Definition at line 3116 of file schema_manager.c.

References ARG_FILE_LINE, assert, AU_DISABLE, AU_ENABLE, au_fetch_class(), AU_FETCH_READ, AU_SELECT, db_value::data, db_get_string(), DB_IS_NULL, db_make_null(), DB_MAX_IDENTIFIER_LENGTH, DB_NOT_PARTITIONED_CLASS, DB_PARTITION_CLASS, DB_PARTITIONED_CLASS, do_get_partition_parent(), ER_ERROR_SEVERITY, ER_PARTITION_WORK_FAILED, er_set(), error(), free_and_init, i, db_data::i, NO_ERROR, NULL, db_objlist::op, p, sm_class::partition, sm_partition::pname, set_get_element_nocopy(), strlen, sm_class::users, and sm_partition::values.

Referenced by au_change_owner_method(), au_grant(), au_revoke(), change_constraints_comment_partitioned_class(), change_constraints_status_partitioned_class(), create_or_drop_index_helper(), do_alter_change_default_cs_coll(), do_check_for_empty_classes_in_delete(), do_check_partitioned_class(), do_insert_template(), do_set_pruning_type(), get_requested_classes(), insert_subquery_results(), is_server_update_allowed(), la_repl_add_object(), ldr_act_init_context(), locator_mflush(), pt_check_alter(), pt_check_create_entity(), pt_check_create_index(), pt_check_show_index(), pt_check_table_in_show_heap(), pt_link_regu_to_selupd_list(), pt_make_class_access_spec(), pt_to_delete_xasl(), pt_to_insert_xasl(), pt_to_merge_insert_xasl(), pt_to_merge_update_xasl(), pt_to_update_xasl(), sm_add_constraint(), sm_delete_class_mop(), sm_drop_index(), sm_exist_index(), sm_rename_class(), smt_is_change_status_allowed(), smt_rename_any(), and update_fk_ref_partitioned_class().

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

Definition at line 14402 of file schema_manager.c.

References sm_get_ch_name(), and sm_produce_constraint_name().

Referenced by db_add_constraint(), and db_drop_constraint().

Here is the caller graph for this function:

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 
)

Definition at line 14419 of file schema_manager.c.

References sm_produce_constraint_name(), and template_classname().

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

Here is the caller graph for this function:

SM_NAME_SPACE sm_resolution_space ( SM_NAME_SPACE  name_space)

Definition at line 2187 of file schema_manager.c.

References ID_CLASS, ID_CLASS_ATTRIBUTE, ID_CLASS_METHOD, and ID_INSTANCE.

Referenced by check_local_definition(), and resolve_candidates().

Here is the caller graph for this function:

int sm_save_constraint_info ( SM_CONSTRAINT_INFO **  save_info,
const SM_CLASS_CONSTRAINT *const  c 
)

Definition at line 15147 of file schema_manager.c.

References ARG_FILE_LINE, sm_constraint_info::asc_desc, sm_class_constraint::asc_desc, assert, sm_constraint_info::att_names, sm_class_constraint::attributes, sm_class_constraint::attrs_prefix_length, au_fetch_class_force(), AU_FETCH_READ, classobj_find_cons_primary_key(), sm_constraint_info::comment, sm_class_constraint::comment, sm_constraint_info::constraint_type, sm_class::constraints, db_constraint_type(), sm_foreign_key_info::delete_action, er_errid(), ER_ERROR_SEVERITY, ER_FK_REF_CLASS_HAS_NOT_PK, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), sm_constraint_info::filter_predicate, sm_class_constraint::filter_predicate, sm_constraint_info::fk_delete_action, sm_class_constraint::fk_info, sm_constraint_info::fk_update_action, sm_constraint_info::func_index_info, sm_class_constraint::func_index_info, i, sm_constraint_info::index_status, sm_class_constraint::index_status, sm_constraint_info::name, sm_class_constraint::name, sm_constraint_info::next, sm_foreign_key_info::next, NO_ERROR, NULL, sm_constraint_info::prefix_length, sm_constraint_info::ref_attrs, sm_foreign_key_info::ref_class_oid, sm_constraint_info::ref_cls_name, sm_ch_name(), SM_CONSTRAINT_FOREIGN_KEY, sm_free_constraint_info(), sm_save_filter_index_info(), sm_save_function_index_info(), strdup(), strlen, sm_class_constraint::type, sm_foreign_key_info::update_action, and ws_mop().

Referenced by build_attr_change_map(), do_copy_indexes(), do_recreate_renamed_class_indexes(), do_save_all_indexes(), and sm_truncate_class().

Here is the caller graph for this function:

int sm_set_class_collation ( MOP  classop,
int  collation_id 
)

Definition at line 2938 of file schema_manager.c.

References assert, au_fetch_class_force(), AU_FETCH_UPDATE, sm_class::collation_id, error(), NO_ERROR, and NULL.

Referenced by do_alter_change_default_cs_coll(), do_create_entity(), and do_create_partition().

Here is the caller graph for this function:

int sm_set_class_comment ( MOP  classop,
const char *  comment 
)

Definition at line 2986 of file schema_manager.c.

References assert, au_fetch_class_force(), AU_FETCH_UPDATE, sm_class::comment, er_errid(), ER_FAILED, error(), NO_ERROR, NULL, ws_copy_string(), and ws_free_string().

Referenced by do_alter_change_tbl_comment(), and do_create_entity().

Here is the caller graph for this function:

int sm_set_class_flag ( MOP  classop,
SM_CLASS_FLAG  flag,
int  onoff 
)

Definition at line 2856 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_UPDATE, error(), sm_class::flags, NO_ERROR, and NULL.

Referenced by do_create_entity(), and do_create_partition().

Here is the caller graph for this function:

int sm_set_class_tde_algorithm ( MOP  classop,
TDE_ALGORITHM  tde_algo 
)

Definition at line 2888 of file schema_manager.c.

References assert, au_fetch_class_force(), AU_FETCH_UPDATE, error(), NO_ERROR, NULL, sm_class::tde_algorithm, TDE_ALGORITHM_AES, TDE_ALGORITHM_ARIA, and TDE_ALGORITHM_NONE.

Referenced by do_create_entity(), and do_create_partition().

Here is the caller graph for this function:

int sm_touch_class ( MOP  classmop)

Definition at line 15114 of file schema_manager.c.

References assert, dbt_abort_class(), dbt_edit_class(), dbt_finish_class(), er_errid(), error(), NO_ERROR, and NULL.

Referenced by do_run_update_query_for_class().

Here is the caller graph for this function:

void sm_transaction_boundary ( void  )

Definition at line 2114 of file schema_manager.c.

References NULL, sm_free_resident_classes_virtual_query_cache(), and sm_reset_descriptors().

Referenced by tran_abort(), tran_commit(), and tran_internal_abort_upto_savepoint().

Here is the caller graph for this function:

int sm_truncate_class ( MOP  class_mop)

Definition at line 15627 of file schema_manager.c.

References sm_constraint_info::asc_desc, assert, sm_constraint_info::att_names, AU_DISABLE, AU_ENABLE, au_fetch_class(), AU_FETCH_WRITE, parser_context::au_save, sm_attribute::auto_increment, classobj_find_cons_primary_key(), classobj_is_pk_referred(), sm_constraint_info::comment, sm_constraint_info::constraint_type, sm_class::constraints, db_attribute_next(), DB_AUTH_ALTER, db_get_attributes(), dbt_abort_class(), dbt_add_foreign_key(), dbt_drop_constraint(), dbt_edit_class(), dbt_finish_class(), do_reset_auto_increment_serial(), er_errid(), ER_LK_UNILATERALLY_ABORTED, error(), sm_constraint_info::filter_predicate, sm_constraint_info::fk_delete_action, sm_class_constraint::fk_info, sm_constraint_info::fk_update_action, sm_constraint_info::func_index_info, sm_constraint_info::index_status, log_does_allow_replication(), sm_constraint_info::name, sm_constraint_info::next, sm_class_constraint::next, NO_ERROR, NULL, sm_constraint_info::prefix_length, sm_constraint_info::ref_attrs, sm_constraint_info::ref_cls_name, sm_add_constraint(), SM_CONSTRAINT_FOREIGN_KEY, SM_CONSTRAINT_NOT_NULL, SM_CONSTRAINT_PRIMARY_KEY, sm_drop_constraint(), sm_drop_index(), sm_flush_and_decache_objects(), sm_free_constraint_info(), SM_IS_CONSTRAINT_INDEX_FAMILY, SM_IS_CONSTRAINT_UNIQUE_FAMILY, sm_is_possible_to_recreate_constraint(), sm_save_constraint_info(), SM_TRUNCATE_SAVEPOINT_NAME, sm_truncate_using_delete(), tran_abort_upto_system_savepoint(), tran_system_savepoint(), and sm_class_constraint::type.

Referenced by db_truncate_class().

Here is the caller graph for this function:

int sm_update_catalog_statistics ( const char *  class_name,
bool  with_fullscan 
)

Definition at line 4057 of file schema_manager.c.

References assert, db_find_class(), er_errid(), error(), NO_ERROR, NULL, and sm_update_statistics().

Referenced by loaddb_internal(), and sm_update_all_catalog_statistics().

Here is the caller graph for this function:

int sm_update_class_auto ( SM_TEMPLATE template_,
MOP classmop 
)
int sm_update_class_with_auth ( SM_TEMPLATE template_,
MOP classmop,
DB_AUTH  auth,
bool  lock_hierarchy 
)

Definition at line 12886 of file schema_manager.c.

References update_class().

Referenced by sm_add_constraint().

Here is the caller graph for this function:

Variable Documentation

ROOT_CLASS sm_Root_class
HFID* sm_Root_class_hfid

Definition at line 259 of file schema_manager.c.

Referenced by locator_assign_permanent_oid(), and locator_mflush().

const char* sm_Root_class_name

Definition at line 256 of file schema_manager.c.

Referenced by sm_create_root().