CUBRID Engine  latest
schema_manager.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "dbtype.h"
#include "authenticate.h"
#include "string_opfunc.h"
#include "schema_manager.h"
#include "porting.h"
#include "chartype.h"
#include "dynamic_load.h"
#include "error_manager.h"
#include "work_space.h"
#include "object_primitive.h"
#include "class_object.h"
#include "message_catalog.h"
#include "memory_alloc.h"
#include "environment_variable.h"
#include "language_support.h"
#include "object_representation.h"
#include "object_domain.h"
#include "set_object.h"
#include "virtual_object.h"
#include "transform_cl.h"
#include "locator_cl.h"
#include "statistics.h"
#include "network_interface_cl.h"
#include "parser.h"
#include "trigger_manager.h"
#include "storage_common.h"
#include "transform.h"
#include "system_parameter.h"
#include "object_template.h"
#include "execute_schema.h"
#include "release_string.h"
#include "execute_statement.h"
#include "crypt_opfunc.h"
#include "db.h"
#include "object_accessor.h"
#include "boot_cl.h"
#include <nlist.h>

Go to the source code of this file.

Classes

struct  schema_def
 
struct  static_method
 
struct  method_link
 
struct  sm_candidate
 

Macros

#define SM_ADD_CONSTRAINT_SAVEPOINT_NAME   "aDDcONSTRAINT"
 
#define SM_ADD_UNIQUE_CONSTRAINT_SAVEPOINT_NAME   "aDDuNIQUEcONSTRAINT"
 
#define SM_DROP_CLASS_MOP_SAVEPOINT_NAME   "dELETEcLASSmOP"
 
#define SM_TRUNCATE_SAVEPOINT_NAME   "SmtRUnCATE"
 
#define WC_PERIOD   L'.'
 
#define MAX_ATTR_IN_AUTO_GEN_NAME   30
 

Typedefs

typedef struct schema_def SCHEMA_DEF
 
typedef struct static_method STATIC_METHOD
 
typedef struct method_link METHOD_LINK
 
typedef struct sm_candidate SM_CANDIDATE
 

Enumerations

enum  DOMAIN_COMP { DC_INCOMPATIBLE, DC_EQUAL, DC_LESS_SPECIFIC, DC_MORE_SPECIFIC }
 

Functions

static int domain_search (MOP dclass_mop, MOP class_mop)
 
static int annotate_method_files (MOP classmop, SM_CLASS *class_)
 
static int alter_trigger_cache (SM_CLASS *class_, const char *attribute, int class_attribute, DB_OBJECT *trigger, int drop_it)
 
static int alter_trigger_hierarchy (DB_OBJECT *classop, const char *attribute, int class_attribute, DB_OBJECT *target_class, DB_OBJECT *trigger, int drop_it)
 
static int find_attribute_op (MOP op, const char *name, SM_CLASS **classp, SM_ATTRIBUTE **attp)
 
static int fetch_descriptor_class (MOP op, SM_DESCRIPTOR *desc, int for_update, SM_CLASS **class_)
 
static STATIC_METHODsm_find_static_method (const char *name)
 
static int sm_count_tokens (const char *string, int *maxcharp)
 
static int sm_split_loader_commands (const char *string, const char ***command_ptr)
 
static void sm_free_loader_commands (char **commands)
 
static void sm_free_method_links (METHOD_LINK *links)
 
static int sm_link_static_method (SM_METHOD *method, METHOD_LINK **link_ptr)
 
static int sm_link_static_methods (SM_CLASS *class_, METHOD_LINK **links_ptr)
 
static int sm_expand_method_files (SM_METHOD_FILE *files)
 
static int sm_build_function_nlist (METHOD_LINK *links, struct nlist **nlist_ptr)
 
static void sm_free_function_nlist (struct nlist *namelist)
 
static int sm_file_extension (const char *path, const char *ext)
 
static int sm_dynamic_link_class (SM_CLASS *class_, METHOD_LINK *links)
 
static int sm_link_methods (SM_CLASS *class_)
 
static int check_resolution_target (SM_TEMPLATE *template_, SM_RESOLUTION *res, int *valid_ptr)
 
static const char * template_classname (SM_TEMPLATE *template_)
 
static const char * candidate_source_name (SM_TEMPLATE *template_, SM_CANDIDATE *candidate)
 
static int find_superclass (DB_OBJECT *classop, SM_TEMPLATE *temp, DB_OBJECT *super)
 
static DOMAIN_COMP compare_domains (TP_DOMAIN *d1, TP_DOMAIN *d2)
 
static SM_METHOD_ARGUMENTfind_argument (SM_METHOD_SIGNATURE *sig, int argnum)
 
static DOMAIN_COMP compare_argument_domains (SM_METHOD *m1, SM_METHOD *m2)
 
static DOMAIN_COMP compare_component_domains (SM_COMPONENT *c1, SM_COMPONENT *c2)
 
static SM_CANDIDATEmake_candidate_from_component (SM_COMPONENT *comp, MOP source)
 
static void free_candidates (SM_CANDIDATE *candidates)
 
static SM_CANDIDATEprune_candidate (SM_CANDIDATE **clist_pointer)
 
static void add_candidate (SM_CANDIDATE **candlist, SM_COMPONENT *comp, int order, MOP source, SM_RESOLUTION *resolutions)
 
static SM_COMPONENTmake_component_from_candidate (MOP classop, SM_CANDIDATE *cand)
 
static SM_CANDIDATEget_candidates (SM_TEMPLATE *def, SM_TEMPLATE *flat, SM_NAME_SPACE name_space)
 
static int check_attribute_method_overlap (SM_TEMPLATE *template_, SM_CANDIDATE *candidates)
 
static int check_alias_conflict (SM_TEMPLATE *template_, SM_CANDIDATE *candidates)
 
static int check_alias_domains (SM_TEMPLATE *template_, SM_CANDIDATE *candidates, SM_CANDIDATE **most_specific)
 
static void auto_resolve_conflict (SM_CANDIDATE *candidate, SM_RESOLUTION **resolutions, SM_NAME_SPACE resspace)
 
static int resolve_candidates (SM_TEMPLATE *template_, SM_CANDIDATE *candidates, int auto_resolve, SM_CANDIDATE **winner_return)
 
static void insert_attribute (SM_ATTRIBUTE **attlist, SM_ATTRIBUTE *att)
 
static void insert_method (SM_METHOD **methlist, SM_METHOD *method)
 
static int flatten_components (SM_TEMPLATE *def, SM_TEMPLATE *flat, SM_NAME_SPACE name_space, int auto_res)
 
static int flatten_method_files (SM_TEMPLATE *def, SM_TEMPLATE *flat)
 
static int flatten_query_spec_lists (SM_TEMPLATE *def, SM_TEMPLATE *flat)
 
static void filter_component_resolutions (SM_TEMPLATE *template_, const char *name, SM_NAME_SPACE resspace)
 
static void remove_shadowed_resolutions (SM_TEMPLATE *original, SM_TEMPLATE *flat)
 
static void filter_reslist (SM_RESOLUTION **reslist, MOP deleted_class)
 
static int check_invalid_resolutions (SM_TEMPLATE *template_, SM_RESOLUTION **resolutions, SM_RESOLUTION *original_list)
 
static int filter_resolutions (SM_TEMPLATE *def, SM_TEMPLATE *flat, MOP deleted_class)
 
static SM_ATTRIBUTEfind_matching_att (SM_ATTRIBUTE *list, SM_ATTRIBUTE *att, int idmatch)
 
static int retain_former_ids (SM_TEMPLATE *flat)
 
static int flatten_trigger_cache (SM_TEMPLATE *def, SM_TEMPLATE *flat)
 
static int flatten_properties (SM_TEMPLATE *def, SM_TEMPLATE *flat)
 
static int flatten_template (SM_TEMPLATE *def, MOP deleted_class, SM_TEMPLATE **flatp, int auto_res)
 
static void assign_attribute_id (SM_CLASS *class_, SM_ATTRIBUTE *att, int class_attribute)
 
static void assign_method_id (SM_CLASS *class_, SM_METHOD *method, bool class_method)
 
static SM_ATTRIBUTEorder_atts_by_alignment (SM_ATTRIBUTE *atts)
 
static int build_storage_order (SM_CLASS *class_, SM_TEMPLATE *flat)
 
static void fixup_component_classes (MOP classop, SM_TEMPLATE *flat)
 
static void fixup_self_domain (TP_DOMAIN *domain, MOP self)
 
static void fixup_method_self_domains (SM_METHOD *meth, MOP self)
 
static void fixup_attribute_self_domain (SM_ATTRIBUTE *att, MOP self)
 
static void fixup_self_reference_domains (MOP classop, SM_TEMPLATE *flat)
 
static TP_DOMAINconstruct_index_key_domain (int n_atts, SM_ATTRIBUTE **atts, const int *asc_desc, const int *prefix_lengths, int func_col_id, TP_DOMAIN *func_domain)
 
static int collect_hier_class_info (MOP classop, DB_OBJLIST *subclasses, const char *constraint_name, int reverse, int *n_classes, int n_attrs, OID *oids, int *attr_ids, HFID *hfids)
 
static int allocate_index (MOP classop, SM_CLASS *class_, DB_OBJLIST *subclasses, SM_ATTRIBUTE **attrs, const int *asc_desc, const int *attrs_prefix_length, int unique_pk, int not_null, int reverse, const char *constraint_name, BTID *index, OID *fk_refcls_oid, BTID *fk_refcls_pk_btid, const char *fk_name, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, SM_INDEX_STATUS index_status)
 
static int deallocate_index (SM_CLASS_CONSTRAINT *cons, BTID *index)
 
static int rem_class_from_index (OID *oid, BTID *index, HFID *heap)
 
static int check_fk_validity (MOP classop, SM_CLASS *class_, SM_ATTRIBUTE **key_attrs, const int *asc_desc, OID *pk_cls_oid, BTID *pk_btid, char *fk_name)
 
static int update_foreign_key_ref (MOP ref_clsop, SM_FOREIGN_KEY_INFO *fk_info)
 
static int allocate_unique_constraint (MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
 
static int allocate_foreign_key (MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses)
 
static int allocate_disk_structures_index (MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *con, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
 
static int allocate_disk_structures (MOP classop, SM_CLASS *class_, DB_OBJLIST *subclasses, SM_TEMPLATE *template_)
 
static int drop_foreign_key_ref (MOP classop, SM_CLASS *class_, SM_CLASS_CONSTRAINT *flat_cons, SM_CLASS_CONSTRAINT **cons)
 
static int drop_foreign_key_ref_internal (MOP classop, SM_CLASS_CONSTRAINT *flat_cons, SM_CLASS_CONSTRAINT *cons)
 
static bool is_index_owner (MOP classop, SM_CLASS_CONSTRAINT *con)
 
static int inherit_constraint (MOP classop, SM_CLASS_CONSTRAINT *con)
 
static int transfer_disk_structures (MOP classop, SM_CLASS *class_, SM_TEMPLATE *flat)
 
static void save_previous_value (SM_ATTRIBUTE *old, SM_ATTRIBUTE *new_)
 
static void check_inherited_attributes (MOP classmop, SM_CLASS *class_, SM_TEMPLATE *flat)
 
static void invalidate_unused_triggers (MOP class_mop, SM_CLASS *class_, SM_TEMPLATE *flat)
 
static int install_new_representation (MOP classop, SM_CLASS *class_, SM_TEMPLATE *flat)
 
static int lock_supers (SM_TEMPLATE *def, DB_OBJLIST *current, DB_OBJLIST **oldlist, DB_OBJLIST **newlist)
 
static int update_supers (MOP classop, DB_OBJLIST *oldsupers, DB_OBJLIST *newsupers)
 
static int lock_supers_drop (DB_OBJLIST *supers)
 
static int update_supers_drop (MOP classop, DB_OBJLIST *supers)
 
static int lock_subclasses_internal (SM_TEMPLATE *def, MOP op, DB_OBJLIST *newsupers, DB_OBJLIST **newsubs)
 
static int lock_subclasses (SM_TEMPLATE *def, DB_OBJLIST *newsupers, DB_OBJLIST *cursubs, DB_OBJLIST **newsubs)
 
static int flatten_subclasses (DB_OBJLIST *subclasses, MOP deleted_class)
 
static void abort_subclasses (DB_OBJLIST *subclasses)
 
static int update_subclasses (DB_OBJLIST *subclasses)
 
static int lockhint_subclasses (SM_TEMPLATE *temp, SM_CLASS *class_)
 
static int update_class (SM_TEMPLATE *template_, MOP *classmop, int auto_res, DB_AUTH auth, bool needs_hierarchy_lock)
 
static int remove_class_triggers (MOP classop, SM_CLASS *class_)
 
static int sm_drop_cascade_foreign_key (SM_CLASS *class_)
 
static char * sm_default_constraint_name (const char *class_name, DB_CONSTRAINT_TYPE type, const char **att_names, const int *asc_desc)
 
static int sm_load_online_index (MOP classmop, const char *constraint_name)
 
static const char * sm_locate_method_file (SM_CLASS *class_, const char *function)
 
static int sm_check_index_exist (MOP classop, char **out_shared_cons_name, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const SM_PREDICATE_INFO *filter_index, const SM_FUNCTION_INFO *func_info)
 
static void sm_reset_descriptors (MOP class_)
 
static bool sm_is_possible_to_recreate_constraint (MOP class_mop, const SM_CLASS *const class_, const SM_CLASS_CONSTRAINT *const constraint)
 
static bool sm_filter_index_pred_have_invalid_attrs (SM_CLASS_CONSTRAINT *constraint, char *class_name, SM_ATTRIBUTE *old_atts, SM_ATTRIBUTE *new_atts)
 
static int sm_truncate_using_delete (MOP class_mop)
 
static int sm_save_nested_view_versions (PARSER_CONTEXT *parser, DB_OBJECT *class_object, SM_CLASS *class_)
 
static bool sm_is_nested_view_recached (PARSER_CONTEXT *parser)
 
static int filter_local_constraints (SM_TEMPLATE *template_, SM_CLASS *super_class)
 
static int update_fk_ref_partitioned_class (SM_TEMPLATE *ctemplate, SM_FOREIGN_KEY_INFO *fk_info, const BTID *btid, const char *old_name, const char *new_name)
 
static int flatten_partition_info (SM_TEMPLATE *def, SM_TEMPLATE *flat)
 
static DB_OBJLISTsm_fetch_all_objects_internal (DB_OBJECT *op, DB_FETCH_MODE purpose, LC_FETCH_VERSION_TYPE *force_fetch_version_type)
 
static int sm_flush_and_decache_objects_internal (MOP obj, MOP obj_class_mop, int decache)
 
static void sm_free_resident_classes_virtual_query_cache (void)
 
int sc_set_current_schema (MOP user)
 
void sm_add_static_method (const char *name, void(*function)())
 
void sm_delete_static_method (const char *name)
 
void sm_flush_static_methods ()
 
int sm_link_method (SM_CLASS *class_, SM_METHOD *method)
 
int sm_force_method_link (MOP obj)
 
int sm_prelink_methods (DB_OBJLIST *classes)
 
char * sm_get_method_source_file (MOP obj, const char *name)
 
void sm_init (OID *rootclass_oid, HFID *rootclass_hfid)
 
void sm_create_root (OID *rootclass_oid, HFID *rootclass_hfid)
 
void sm_final ()
 
void sm_transaction_boundary (void)
 
int sm_check_name (const char *name)
 
void sm_downcase_name (const char *name, char *buf, int maxlen)
 
SM_NAME_SPACE sm_resolution_space (SM_NAME_SPACE name_space)
 
MOP sm_get_class (MOP obj)
 
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_rename_class (MOP op, const char *new_name)
 
void sm_mark_system_classes (void)
 
int sm_mark_system_class (MOP classop, int on_or_off)
 
int sm_set_class_flag (MOP classop, SM_CLASS_FLAG flag, int on_or_off)
 
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_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_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_get_class_flag (MOP op, SM_CLASS_FLAG flag)
 
int sm_force_write_all_classes (void)
 
int sm_destroy_representations (MOP op)
 
int sm_filter_domain (TP_DOMAIN *domain, int *changes)
 
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_check_class_domain (TP_DOMAIN *domain, MOP class_)
 
int sm_clean_class (MOP classmop, SM_CLASS *class_)
 
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)
 
int sm_update_all_catalog_statistics (bool with_fullscan)
 
int sm_update_catalog_statistics (const char *class_name, bool with_fullscan)
 
int sm_get_trigger_cache (DB_OBJECT *classop, const char *attribute, int class_attribute, void **cache)
 
int sm_active_triggers (MOP class_mop, SM_CLASS *class_, DB_TRIGGER_EVENT event_type)
 
int sm_class_has_triggers (DB_OBJECT *classop, int *status_ptr, DB_TRIGGER_EVENT event_type)
 
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)
 
const char * sm_get_ch_name (MOP op)
 
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)
 
const char * sm_ch_name (const MOBJ clobj)
 
HFIDsm_ch_heap (MOBJ clobj)
 
OIDsm_ch_rep_dir (MOBJ clobj)
 
HFIDsm_get_ch_heap (MOP classmop)
 
bool sm_has_indexes (MOBJ classobj)
 
SM_CLASS_CONSTRAINTsm_class_constraints (MOP classop)
 
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)
 
BTIDsm_find_index (MOP classop, char **att_names, int num_atts, bool unique_index_only, bool skip_prefix_index, BTID *btid)
 
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_att_constrained (MOP classop, const char *name, SM_ATTRIBUTE_FLAG cons)
 
int sm_att_fk_constrained (MOP classop, const char *name)
 
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_class_check_uniques (MOP classop)
 
int sm_get_class_repid (MOP classop)
 
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_)
 
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 (PARSER_CONTEXT *parser, DB_OBJECT *class_object)
 
int sm_get_attribute_descriptor (DB_OBJECT *op, const char *name, int class_attribute, int for_update, SM_DESCRIPTOR **desc_ptr)
 
int sm_get_method_descriptor (DB_OBJECT *op, const char *name, int class_method, SM_DESCRIPTOR **desc_ptr)
 
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)
 
int sm_check_catalog_rep_dir (MOP classmop, SM_CLASS *class_)
 
static bool sm_constraint_belongs_to_class (const SM_CLASS_CONSTRAINT *const con, MOP const mop)
 
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 needs_hierarchy_lock)
 
int sm_update_class_auto (SM_TEMPLATE *template_, MOP *classmop)
 
int sm_delete_class_mop (MOP op, bool is_cascade_constraints)
 
int sm_exist_index (MOP classop, const char *idxname, BTID *btid)
 
int sm_drop_index (MOP classop, const char *constraint_name)
 
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)
 
static int sm_add_secondary_index_on_partition (MOP classop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const int *attrs_prefix_length, int class_attributes, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status, MOP *sub_partitions)
 
int sm_add_constraint (MOP classop, DB_CONSTRAINT_TYPE constraint_type, const char *constraint_name, const char **att_names, const int *asc_desc, const int *attrs_prefix_length, int class_attributes, SM_PREDICATE_INFO *filter_index, SM_FUNCTION_INFO *function_index, const char *comment, SM_INDEX_STATUS index_status)
 
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)
 
void sm_free_constraint_info (SM_CONSTRAINT_INFO **save_info)
 
int sm_touch_class (MOP classmop)
 
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)
 
int sm_truncate_class (MOP class_mop)
 
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)
 
void sm_domain_free (SM_DOMAIN *ptr)
 
SM_DOMAINsm_domain_alloc ()
 
SM_DOMAINsm_domain_copy (SM_DOMAIN *ptr)
 

Variables

static SCHEMA_DEF Current_Schema = { {'\0'}, NULL, NULL, NULL, NULL }
 
static STATIC_METHODStatic_method_table = NULL
 
SM_DESCRIPTORsm_Descriptors = NULL
 
ROOT_CLASS sm_Root_class
 
MOP sm_Root_class_mop = NULL
 
const char * sm_Root_class_name = ROOTCLASS_NAME
 
HFIDsm_Root_class_hfid = &sm_Root_class.header.ch_heap
 
static unsigned int local_schema_version = 0
 
static unsigned int global_schema_version = 0
 

Macro Definition Documentation

#define MAX_ATTR_IN_AUTO_GEN_NAME   30
#define SM_ADD_CONSTRAINT_SAVEPOINT_NAME   "aDDcONSTRAINT"

Definition at line 82 of file schema_manager.c.

Referenced by sm_add_constraint().

#define SM_ADD_UNIQUE_CONSTRAINT_SAVEPOINT_NAME   "aDDuNIQUEcONSTRAINT"

Definition at line 83 of file schema_manager.c.

Referenced by update_class().

#define SM_DROP_CLASS_MOP_SAVEPOINT_NAME   "dELETEcLASSmOP"

Definition at line 84 of file schema_manager.c.

Referenced by sm_delete_class_mop().

#define SM_TRUNCATE_SAVEPOINT_NAME   "SmtRUnCATE"

Definition at line 85 of file schema_manager.c.

Referenced by sm_truncate_class().

#define WC_PERIOD   L'.'

Definition at line 136 of file schema_manager.c.

Referenced by sm_expand_method_files().

Typedef Documentation

typedef struct method_link METHOD_LINK

Definition at line 157 of file schema_manager.c.

typedef struct schema_def SCHEMA_DEF
typedef struct sm_candidate SM_CANDIDATE

Definition at line 186 of file schema_manager.c.

typedef struct static_method STATIC_METHOD

Definition at line 143 of file schema_manager.c.

Enumeration Type Documentation

Enumerator
DC_INCOMPATIBLE 
DC_EQUAL 
DC_LESS_SPECIFIC 
DC_MORE_SPECIFIC 

Definition at line 169 of file schema_manager.c.

Function Documentation

static void abort_subclasses ( DB_OBJLIST subclasses)
static

Definition at line 12391 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_WRITE, classobj_free_template(), sm_class::new_, db_objlist::next, NO_ERROR, NULL, and db_objlist::op.

Referenced by sm_delete_class_mop(), and update_class().

Here is the caller graph for this function:

static void add_candidate ( SM_CANDIDATE **  candlist,
SM_COMPONENT comp,
int  order,
MOP  source,
SM_RESOLUTION resolutions 
)
static
static int allocate_index ( MOP  classop,
SM_CLASS class_,
DB_OBJLIST subclasses,
SM_ATTRIBUTE **  attrs,
const int *  asc_desc,
const int *  attrs_prefix_length,
int  unique_pk,
int  not_null,
int  reverse,
const char *  constraint_name,
BTID index,
OID fk_refcls_oid,
BTID fk_refcls_pk_btid,
const char *  fk_name,
SM_PREDICATE_INFO filter_index,
SM_FUNCTION_INFO function_index,
SM_INDEX_STATUS  index_status 
)
static
static int alter_trigger_cache ( SM_CLASS class_,
const char *  attribute,
int  class_attribute,
DB_OBJECT trigger,
int  drop_it 
)
static
static int alter_trigger_hierarchy ( DB_OBJECT classop,
const char *  attribute,
int  class_attribute,
DB_OBJECT target_class,
DB_OBJECT trigger,
int  drop_it 
)
static
static int annotate_method_files ( MOP  classmop,
SM_CLASS class_ 
)
static
static void assign_attribute_id ( SM_CLASS class_,
SM_ATTRIBUTE att,
int  class_attribute 
)
static
static void assign_method_id ( SM_CLASS class_,
SM_METHOD method,
bool  class_method 
)
static
static void auto_resolve_conflict ( SM_CANDIDATE candidate,
SM_RESOLUTION **  resolutions,
SM_NAME_SPACE  resspace 
)
static
static const char * candidate_source_name ( SM_TEMPLATE template_,
SM_CANDIDATE candidate 
)
static
static int check_alias_domains ( SM_TEMPLATE template_,
SM_CANDIDATE candidates,
SM_CANDIDATE **  most_specific 
)
static
static int check_attribute_method_overlap ( SM_TEMPLATE template_,
SM_CANDIDATE candidates 
)
static
static int check_fk_validity ( MOP  classop,
SM_CLASS class_,
SM_ATTRIBUTE **  key_attrs,
const int *  asc_desc,
OID pk_cls_oid,
BTID pk_btid,
char *  fk_name 
)
static
static void check_inherited_attributes ( MOP  classmop,
SM_CLASS class_,
SM_TEMPLATE flat 
)
static
static int check_invalid_resolutions ( SM_TEMPLATE template_,
SM_RESOLUTION **  resolutions,
SM_RESOLUTION original_list 
)
static
static DOMAIN_COMP compare_argument_domains ( SM_METHOD m1,
SM_METHOD m2 
)
static

Definition at line 7180 of file schema_manager.c.

References compare_domains(), DC_EQUAL, DC_INCOMPATIBLE, sm_method_argument::domain, find_argument(), i, NULL, sm_method_signature::num_args, and sm_method::signatures.

Referenced by compare_component_domains().

Here is the caller graph for this function:

static DOMAIN_COMP compare_domains ( TP_DOMAIN d1,
TP_DOMAIN d2 
)
static
static int deallocate_index ( SM_CLASS_CONSTRAINT cons,
BTID index 
)
static

Definition at line 10309 of file schema_manager.c.

References BTID_IS_EQUAL, btree_delete_index(), error(), sm_class_constraint::index_btid, sm_class_constraint::next, NO_ERROR, and NULL.

Referenced by sm_drop_index(), and transfer_disk_structures().

Here is the caller graph for this function:

static int domain_search ( MOP  dclass_mop,
MOP  class_mop 
)
static

Definition at line 3402 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_READ, sm_class::inheritance, db_objlist::next, NO_ERROR, NULL, and db_objlist::op.

Referenced by sm_check_class_domain(), sm_check_object_domain(), and sm_coerce_object_domain().

Here is the caller graph for this function:

static int fetch_descriptor_class ( MOP  op,
SM_DESCRIPTOR desc,
int  for_update,
SM_CLASS **  class_ 
)
static
static void filter_component_resolutions ( SM_TEMPLATE template_,
const char *  name,
SM_NAME_SPACE  resspace 
)
static
static void filter_reslist ( SM_RESOLUTION **  reslist,
MOP  deleted_class 
)
static

Definition at line 8430 of file schema_manager.c.

References sm_resolution::class_mop, classobj_free_resolution(), sm_resolution::next, and NULL.

Referenced by filter_resolutions().

Here is the caller graph for this function:

static int filter_resolutions ( SM_TEMPLATE def,
SM_TEMPLATE flat,
MOP  deleted_class 
)
static
static SM_METHOD_ARGUMENT * find_argument ( SM_METHOD_SIGNATURE sig,
int  argnum 
)
static

Definition at line 7158 of file schema_manager.c.

References sm_method_signature::args, sm_method_argument::index, sm_method_argument::next, and NULL.

Referenced by compare_argument_domains().

Here is the caller graph for this function:

static SM_ATTRIBUTE * find_matching_att ( SM_ATTRIBUTE list,
SM_ATTRIBUTE att,
int  idmatch 
)
static
static int find_superclass ( DB_OBJECT classop,
SM_TEMPLATE temp,
DB_OBJECT super 
)
static

Definition at line 6980 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_READ, sm_class::inheritance, sm_template::inheritance, sm_class::new_, db_objlist::next, NO_ERROR, NULL, and db_objlist::op.

Referenced by compare_domains().

Here is the caller graph for this function:

static void fixup_attribute_self_domain ( SM_ATTRIBUTE att,
MOP  self 
)
static

Definition at line 9761 of file schema_manager.c.

References sm_attribute::domain, fixup_self_domain(), tp_domain_cache(), tp_Type_null, tp_Type_object, and sm_attribute::type.

Referenced by fixup_self_reference_domains().

Here is the caller graph for this function:

static void fixup_method_self_domains ( SM_METHOD meth,
MOP  self 
)
static
static void fixup_self_domain ( TP_DOMAIN domain,
MOP  self 
)
static
static void fixup_self_reference_domains ( MOP  classop,
SM_TEMPLATE flat 
)
static
static int flatten_partition_info ( SM_TEMPLATE def,
SM_TEMPLATE flat 
)
static

Definition at line 16404 of file schema_manager.c.

References assert, classobj_copy_partition_info(), er_errid(), NO_ERROR, NULL, and sm_template::partition.

Referenced by flatten_template().

Here is the caller graph for this function:

static int flatten_properties ( SM_TEMPLATE def,
SM_TEMPLATE flat 
)
static
static int flatten_query_spec_lists ( SM_TEMPLATE def,
SM_TEMPLATE flat 
)
static

Definition at line 8306 of file schema_manager.c.

References assert, classobj_copy_query_spec_list(), er_errid(), NO_ERROR, NULL, and sm_template::query_spec.

Referenced by flatten_template().

Here is the caller graph for this function:

static int flatten_subclasses ( DB_OBJLIST subclasses,
MOP  deleted_class 
)
static
static void free_candidates ( SM_CANDIDATE candidates)
static

Definition at line 7360 of file schema_manager.c.

References db_ws_free(), sm_candidate::next, and NULL.

Referenced by flatten_components().

Here is the caller graph for this function:

static void insert_attribute ( SM_ATTRIBUTE **  attlist,
SM_ATTRIBUTE att 
)
static

Definition at line 8104 of file schema_manager.c.

References sm_attribute::header, sm_component::next, NULL, and sm_attribute::order.

Referenced by flatten_components().

Here is the caller graph for this function:

static void insert_method ( SM_METHOD **  methlist,
SM_METHOD method 
)
static

Definition at line 8126 of file schema_manager.c.

References sm_method::header, sm_component::next, NULL, and sm_method::order.

Referenced by flatten_components().

Here is the caller graph for this function:

static void invalidate_unused_triggers ( MOP  class_mop,
SM_CLASS class_,
SM_TEMPLATE flat 
)
static
static bool is_index_owner ( MOP  classop,
SM_CLASS_CONSTRAINT con 
)
static

Definition at line 11236 of file schema_manager.c.

References sm_class_constraint::attributes, sm_attribute::class_mop, is_global, NO_ERROR, NULL, and sm_is_global_only_constraint().

Referenced by transfer_disk_structures().

Here is the caller graph for this function:

static int lock_subclasses ( SM_TEMPLATE def,
DB_OBJLIST newsupers,
DB_OBJLIST cursubs,
DB_OBJLIST **  newsubs 
)
static

Definition at line 12262 of file schema_manager.c.

References error(), lock_subclasses_internal(), db_objlist::next, NO_ERROR, NULL, and db_objlist::op.

Referenced by sm_delete_class_mop(), and update_class().

Here is the caller graph for this function:

static int lock_subclasses_internal ( SM_TEMPLATE def,
MOP  op,
DB_OBJLIST newsupers,
DB_OBJLIST **  newsubs 
)
static
static int lock_supers ( SM_TEMPLATE def,
DB_OBJLIST current,
DB_OBJLIST **  oldlist,
DB_OBJLIST **  newlist 
)
static
static int lock_supers_drop ( DB_OBJLIST supers)
static

Definition at line 12118 of file schema_manager.c.

References ASSERT_ERROR, au_fetch_class(), AU_FETCH_WRITE, AU_SELECT, error(), sm_class::inheritance, lock_supers(), db_objlist::next, NO_ERROR, NULL, and db_objlist::op.

Referenced by sm_delete_class_mop().

Here is the caller graph for this function:

static int lockhint_subclasses ( SM_TEMPLATE temp,
SM_CLASS class_ 
)
static
static SM_ATTRIBUTE * order_atts_by_alignment ( SM_ATTRIBUTE atts)
static
static SM_CANDIDATE * prune_candidate ( SM_CANDIDATE **  clist_pointer)
static

Definition at line 7382 of file schema_manager.c.

References sm_candidate::name, nlist_filter(), NULL, and SM_COMPARE_NAMES.

Referenced by flatten_components().

Here is the caller graph for this function:

static int rem_class_from_index ( OID oid,
BTID index,
HFID heap 
)
static

Definition at line 10342 of file schema_manager.c.

References HFID_IS_NULL, locator_remove_class_from_index(), and NO_ERROR.

Referenced by transfer_disk_structures().

Here is the caller graph for this function:

static int remove_class_triggers ( MOP  classop,
SM_CLASS class_ 
)
static
static void remove_shadowed_resolutions ( SM_TEMPLATE original,
SM_TEMPLATE flat 
)
static
static void save_previous_value ( SM_ATTRIBUTE old,
SM_ATTRIBUTE new_ 
)
static
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 filter_index,
SM_FUNCTION_INFO function_index,
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:

static int sm_add_secondary_index_on_partition ( MOP  classop,
DB_CONSTRAINT_TYPE  constraint_type,
const char *  constraint_name,
const char **  att_names,
const int *  asc_desc,
const int *  attrs_prefix_length,
int  class_attributes,
SM_PREDICATE_INFO filter_index,
SM_FUNCTION_INFO function_index,
const char *  comment,
SM_INDEX_STATUS  index_status,
MOP sub_partitions 
)
static
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:

static int sm_build_function_nlist ( METHOD_LINK links,
struct nlist **  nlist_ptr 
)
static
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_ 
)
static int sm_check_index_exist ( MOP  classop,
char **  out_shared_cons_name,
DB_CONSTRAINT_TYPE  constraint_type,
const char *  constraint_name,
const char **  att_names,
const int *  asc_desc,
const SM_PREDICATE_INFO filter_index,
const SM_FUNCTION_INFO func_info 
)
static

Definition at line 14439 of file schema_manager.c.

References au_fetch_class(), AU_FETCH_READ, AU_INDEX, classobj_check_index_exist(), sm_class::constraints, DB_IS_CONSTRAINT_INDEX_FAMILY, error(), NO_ERROR, and sm_ch_name().

Referenced by sm_exist_index().

Here is the caller graph for this function:

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 
)
static bool sm_constraint_belongs_to_class ( const SM_CLASS_CONSTRAINT *const  con,
MOP const  mop 
)
static

Definition at line 12412 of file schema_manager.c.

References assert, sm_class_constraint::attributes, sm_attribute::class_mop, and NULL.

Referenced by sm_is_possible_to_recreate_constraint().

Here is the caller graph for this function:

static int sm_count_tokens ( const char *  string,
int *  maxcharp 
)
static

Definition at line 683 of file schema_manager.c.

References char_isspace(), i, NULL, and strlen.

Referenced by sm_split_loader_commands().

Here is the caller graph for this function:

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:

static int sm_dynamic_link_class ( SM_CLASS class_,
METHOD_LINK links 
)
static
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:

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

static int sm_file_extension ( const char *  path,
const char *  ext 
)
static

Definition at line 1510 of file schema_manager.c.

References strlen.

Referenced by sm_dynamic_link_class().

Here is the caller graph for this function:

bool sm_filter_index_pred_have_invalid_attrs ( SM_CLASS_CONSTRAINT constraint,
char *  class_name,
SM_ATTRIBUTE old_atts,
SM_ATTRIBUTE new_atts 
)
static
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:

static STATIC_METHOD * sm_find_static_method ( const char *  name)
static

Definition at line 651 of file schema_manager.c.

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

Referenced by sm_link_static_method().

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:

static int sm_flush_and_decache_objects_internal ( MOP  obj,
MOP  obj_class_mop,
int  decache 
)
static
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)
static void sm_free_loader_commands ( char **  commands)
static

Definition at line 809 of file schema_manager.c.

References db_ws_free(), i, and NULL.

Referenced by sm_dynamic_link_class().

Here is the caller graph for this function:

static void sm_free_method_links ( METHOD_LINK links)
static

Definition at line 832 of file schema_manager.c.

References db_ws_free(), method_link::next, sm_candidate::next, and NULL.

Referenced by sm_link_method(), sm_link_methods(), and sm_prelink_methods().

Here is the caller graph for this function:

static void sm_free_resident_classes_virtual_query_cache ( void  )
static

Definition at line 2058 of file schema_manager.c.

References if(), mq_free_virtual_query_cache(), db_objlist::next, NULL, db_object::object, db_objlist::op, sm_class::virtual_query_cache, and ws_Resident_classes.

Referenced by sm_final(), and sm_transaction_boundary().

Here is the caller graph for this function:

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_ptr 
)
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  classobj)
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:

static bool sm_is_possible_to_recreate_constraint ( MOP  class_mop,
const SM_CLASS *const  class_,
const SM_CLASS_CONSTRAINT *const  constraint 
)
static
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 
)
static int sm_link_methods ( SM_CLASS class_)
static

Definition at line 1638 of file schema_manager.c.

References error(), sm_class::methods_loaded, NO_ERROR, NULL, sm_dynamic_link_class(), sm_free_method_links(), and sm_link_static_methods().

Referenced by sm_force_method_link().

Here is the caller graph for this function:

static int sm_link_static_methods ( SM_CLASS class_,
METHOD_LINK **  links_ptr 
)
static
int sm_load_online_index ( MOP  classmop,
const char *  constraint_name 
)
static

Definition at line 16424 of file schema_manager.c.

References ARG_FILE_LINE, sm_class_constraint::asc_desc, assert, ASSERT_ERROR, sm_function_info::attr_index_start, sm_class_constraint::attributes, sm_class_constraint::attrs_prefix_length, AU_ALTER, au_fetch_class(), AU_FETCH_UPDATE, BTREE_CONSTRAINT_PRIMARY_KEY, BTREE_CONSTRAINT_UNIQUE, btree_load_index(), classobj_find_constraint_by_name(), sm_function_info::col_id, sm_class::constraints, construct_index_key_domain(), COPY_OID, sm_attribute::domain, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), ER_SM_INVALID_INDEX_TYPE, ER_SM_INVALID_INDEX_WITH_PREFIX_TYPE, ER_SM_INVALID_PREFIX_LENGTH, ER_WARNING_SEVERITY, error(), sm_function_info::expr_stream, sm_function_info::expr_stream_size, sm_function_info::fi_domain, sm_class_constraint::filter_predicate, free_and_init, sm_class_constraint::func_index_info, HFID_COPY, i, pr_type::id, sm_attribute::id, sm_class_constraint::index_btid, sm_class_constraint::index_status, db_objlist::next, NO_ERROR, NULL, db_objlist::op, pr_type_name(), tp_domain::precision, sm_class_constraint::shared_cons_name, sm_ch_heap(), SM_CONSTRAINT_PRIMARY_KEY, SM_CONSTRAINT_REVERSE_INDEX, SM_CONSTRAINT_REVERSE_UNIQUE, SM_CONSTRAINT_UNIQUE, SM_GET_FILTER_PRED_STREAM, SM_GET_FILTER_PRED_STREAM_SIZE, SM_ONLINE_INDEX_BUILDING_IN_PROGRESS, TP_IS_BIT_TYPE, TP_IS_CHAR_TYPE, tp_valid_indextype(), sm_attribute::type, sm_class_constraint::type, sm_class::users, and WS_OID.

Referenced by sm_add_constraint().

Here is the caller graph for this function:

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:

const char * sm_locate_method_file ( SM_CLASS class_,
const char *  function 
)
static

Definition at line 1877 of file schema_manager.c.

References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_PC_UNIMPLEMENTED, er_set(), nlist(), NO_ERROR, NULL, sm_expand_method_files(), and SM_MAX_IDENTIFIER_LENGTH.

Referenced by sm_get_method_source_file().

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:

void sm_reset_descriptors ( MOP  class_)
static
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  on_or_off 
)

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:

static int sm_split_loader_commands ( const char *  string,
const char ***  command_ptr 
)
static

Definition at line 729 of file schema_manager.c.

References assert, char_isspace(), db_ws_alloc(), db_ws_free(), er_errid(), error(), i, NO_ERROR, NULL, sm_count_tokens(), and ws_copy_string().

Referenced by sm_dynamic_link_class().

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

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:

static const char * template_classname ( SM_TEMPLATE template_)
static

Definition at line 6920 of file schema_manager.c.

References schema_def::name, NULL, sm_template::op, and sm_get_ch_name().

Referenced by check_alias_domains(), check_invalid_resolutions(), resolve_candidates(), and sm_produce_constraint_name_tmpl().

Here is the caller graph for this function:

static int transfer_disk_structures ( MOP  classop,
SM_CLASS class_,
SM_TEMPLATE flat 
)
static
static int update_supers ( MOP  classop,
DB_OBJLIST oldsupers,
DB_OBJLIST newsupers 
)
static

Definition at line 12081 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_UPDATE, error(), ml_append(), ml_remove(), db_objlist::next, NO_ERROR, NULL, db_objlist::op, and sm_class::users.

Referenced by update_class().

Here is the caller graph for this function:

static int update_supers_drop ( MOP  classop,
DB_OBJLIST supers 
)
static

Definition at line 12156 of file schema_manager.c.

References au_fetch_class_force(), AU_FETCH_UPDATE, error(), ml_remove(), db_objlist::next, NO_ERROR, NULL, db_objlist::op, and sm_class::users.

Referenced by sm_delete_class_mop().

Here is the caller graph for this function:

Variable Documentation

SCHEMA_DEF Current_Schema = { {'\0'}, NULL, NULL, NULL, NULL }
static

Definition at line 130 of file schema_manager.c.

unsigned int global_schema_version = 0
static

Definition at line 262 of file schema_manager.c.

Referenced by sm_bump_global_schema_version(), and sm_global_schema_version().

unsigned int local_schema_version = 0
static

Definition at line 261 of file schema_manager.c.

Referenced by sm_bump_local_schema_version(), and sm_local_schema_version().

SM_DESCRIPTOR* sm_Descriptors = NULL

Definition at line 246 of file schema_manager.c.

Referenced by sm_get_attribute_descriptor(), and sm_get_method_descriptor().

ROOT_CLASS sm_Root_class
HFID* sm_Root_class_hfid = &sm_Root_class.header.ch_heap

Definition at line 259 of file schema_manager.c.

Referenced by locator_assign_permanent_oid(), and locator_mflush().

const char* sm_Root_class_name = ROOTCLASS_NAME

Definition at line 256 of file schema_manager.c.

Referenced by sm_create_root().

STATIC_METHOD* Static_method_table = NULL
static

Definition at line 211 of file schema_manager.c.

Referenced by sm_add_static_method(), and sm_find_static_method().