File execute_schema.c¶
FileList > cubrid > src > query > execute_schema.c
Go to the source code of this file
#include "error_code.h"#include "config.h"#include <stdarg.h>#include <ctype.h>#include <assert.h>#include "authenticate.h"#include "error_manager.h"#include "parser.h"#include "parser_message.h"#include "db.h"#include "dbi.h"#include "semantic_check.h"#include "execute_schema.h"#include "execute_statement.h"#include "schema_manager.h"#include "transaction_cl.h"#include "system_parameter.h"#include "xasl_generation.h"#include "memory_alloc.h"#include "schema_system_catalog_constants.h"#include "transform.h"#include "set_object.h"#include "object_accessor.h"#include "object_primitive.h"#include "object_representation.h"#include "memory_hash.h"#include "locator_cl.h"#include "network_interface_cl.h"#include "view_transform.h"#include "xasl_to_stream.h"#include "parser_support.h"#include "dbtype.h"#include "jsp_cl.h"#include "msgcat_glossary.hpp"#include "histogram_cl.hpp"
Classes¶
| Type | Name |
|---|---|
| struct | db_value_slist |
| struct | part_class_info |
| struct | sm_attr_properties_chg |
| struct | sm_partition_alter_info |
Public Types¶
| Type | Name |
|---|---|
| typedef struct db_value_slist | DB_VALUE_SLIST |
| enum | DO_INDEX |
| typedef struct part_class_info | PART_CLASS_INFO |
| enum | SM_ATTR_CHG_SOL |
| typedef struct sm_attr_properties_chg | SM_ATTR_PROP_CHG |
| typedef struct sm_partition_alter_info | SM_PARTITION_ALTER_INFO |
| enum | execute__schema_8c_1a1812ab31015cef0a41c6d4f3ae07f13d |
| enum | execute__schema_8c_1af38129fd1797a5cfd7d746065784a44f |
Public Attributes¶
| Type | Name |
|---|---|
| int | ib_thread_count = 0 |
Public Functions¶
Public Static Functions¶
Macros¶
| Type | Name |
|---|---|
| define | GET_NAME (n) (([**char**](broker__monitor_8c.md#function-timeout) \*) (n)->info.name.original) |
| define | GET_STRING (n) (([**char**](broker__monitor_8c.md#function-timeout) \*) (n)->info.value.data\_value.str->bytes) |
| define | IS_NAME (n) ((n)->node\_type == PT\_NAME) |
| define | IS_STRING (n) /* multi line expression */ |
| define | MAX_FILTER_PREDICATE_STRING_LENGTH (1073741823) |
| define | MAX_FUNCTION_EXPRESSION_STRING_LENGTH 1024 |
| define | QUERY_MAX_SIZE 1024 \* 1024 |
| define | UNIQUE_SAVEPOINT_ADD_ATTR_MTHD "aDDaTTRmTHD" |
| define | UNIQUE_SAVEPOINT_ALTER_INDEX "aLTERiNDEX" |
| define | UNIQUE_SAVEPOINT_ALTER_USER_ENTITY "aLTERuSEReNTITY" |
| define | UNIQUE_SAVEPOINT_CHANGE_ATTR "cHANGEaTTR" |
| define | UNIQUE_SAVEPOINT_CHANGE_COLUMN_COMMENT "cHANGEcOLUMNcOMMENT" |
| define | UNIQUE_SAVEPOINT_CHANGE_DEF_COLL "cHANGEdEFAULTcOLL" |
| define | UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT "cHANGEtBLcOMMENT" |
| define | UNIQUE_SAVEPOINT_CREATE_ENTITY "cREATEeNTITY" |
| define | UNIQUE_SAVEPOINT_CREATE_USER_ENTITY "cREATEuSEReNTITY" |
| define | UNIQUE_SAVEPOINT_DROP_ENTITY "dROPeNTITY" |
| define | UNIQUE_SAVEPOINT_DROP_USER_ENTITY "dROPuSEReNTITY" |
| define | UNIQUE_SAVEPOINT_GRANT_USER "gRANTuSER" |
| define | UNIQUE_SAVEPOINT_MULTIPLE_ALTER "mULTIPLEaLTER" |
| define | UNIQUE_SAVEPOINT_RENAME "rENAME" |
| define | UNIQUE_SAVEPOINT_REPLACE_VIEW "rEPlACE" |
| define | UNIQUE_SAVEPOINT_REVOKE_USER "rEVOKEuSER" |
| define | UNIQUE_SAVEPOINT_TRUNCATE "tRUnCATE" |
Public Types Documentation¶
typedef DB_VALUE_SLIST¶
enum DO_INDEX¶
typedef PART_CLASS_INFO¶
enum SM_ATTR_CHG_SOL¶
enum SM_ATTR_CHG_SOL {
SM_ATTR_CHG_NOT_NEEDED = 0,
SM_ATTR_CHG_ONLY_SCHEMA = 1,
SM_ATTR_CHG_WITH_ROW_UPDATE = 2,
SM_ATTR_CHG_BEST_EFFORT = 3
};
typedef SM_ATTR_PROP_CHG¶
typedef SM_PARTITION_ALTER_INFO¶
enum execute__schema_8c_1a1812ab31015cef0a41c6d4f3ae07f13d¶
enum execute__schema_8c_1a1812ab31015cef0a41c6d4f3ae07f13d {
P_NAME = 0,
P_NOT_NULL,
P_DEFAULT_VALUE,
P_ON_UPDATE_EXPR,
P_CONSTR_CHECK,
P_DEFFERABLE,
P_ORDER,
P_AUTO_INCR,
P_INVISIBLE,
P_CONSTR_FK,
P_S_CONSTR_PK,
P_M_CONSTR_PK,
P_S_CONSTR_UNI,
P_M_CONSTR_UNI,
P_CONSTR_NON_UNI,
P_PREFIX_INDEX,
P_TYPE,
P_IS_PARTITION_COL,
P_COMMENT,
NUM_ATT_CHG_PROP
};
enum execute__schema_8c_1af38129fd1797a5cfd7d746065784a44f¶
enum execute__schema_8c_1af38129fd1797a5cfd7d746065784a44f {
ATT_CHG_PROPERTY_PRESENT_OLD = 0x1,
ATT_CHG_PROPERTY_PRESENT_NEW = 0x2,
ATT_CHG_PROPERTY_LOST = 0x4,
ATT_CHG_PROPERTY_GAINED = 0x8,
ATT_CHG_PROPERTY_UNCHANGED = 0x10,
ATT_CHG_PROPERTY_DIFF = 0x20,
ATT_CHG_TYPE_PREC_INCR = 0x100,
ATT_CHG_TYPE_SET_CLS_COMPAT = 0x200,
ATT_CHG_TYPE_UPGRADE = 0x400,
ATT_CHG_TYPE_NEED_ROW_CHECK = 0x800,
ATT_CHG_TYPE_PSEUDO_UPGRADE = 0x1000,
ATT_CHG_TYPE_NOT_SUPPORTED_WITH_CFG = 0x2000,
ATT_CHG_TYPE_NOT_SUPPORTED = 0x4000,
ATT_CHG_PROPERTY_NOT_CHECKED = 0x10000
};
Public Attributes Documentation¶
variable ib_thread_count¶
Public Functions Documentation¶
function do_add_attributes¶
int do_add_attributes (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * atts,
PT_NODE * constraints,
DB_QUERY_TYPE * create_select_columns
)
function do_add_constraints¶
function do_add_method_files¶
int do_add_method_files (
const PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * method_files
)
function do_add_methods¶
function do_add_queries¶
function do_add_resolutions¶
int do_add_resolutions (
const PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
const PT_NODE * resolution
)
function do_add_supers¶
function do_alter¶
function do_alter_index¶
function do_alter_user¶
function do_check_fk_constraints¶
function do_check_partitioned_class¶
function do_check_rows_for_null¶
function do_create_entity¶
function do_create_index¶
function do_create_local¶
int do_create_local (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * pt_node,
DB_QUERY_TYPE * create_select_columns
)
function do_create_user¶
function do_drop¶
function do_drop_histogram¶
do_drop_histogram () - drop a histogram on a class. return: Error code if it fails parser(in): Parser context statement(in): Parse tree of a create histogram statement
function do_drop_index¶
function do_drop_partition_list¶
function do_drop_partitioned_class¶
function do_drop_user¶
function do_get_partition_keycol¶
function do_get_partition_parent¶
function do_get_partition_size¶
function do_grant¶
function do_is_partitioned_subclass¶
function do_recreate_filter_index_constr¶
int do_recreate_filter_index_constr (
PARSER_CONTEXT * parser,
SM_PREDICATE_INFO * filter_index_info,
PT_NODE * alter,
const char * src_cls_name,
const char * new_cls_name
)
function do_recreate_func_index_constr¶
int do_recreate_func_index_constr (
PARSER_CONTEXT * parser,
SM_CONSTRAINT_INFO * constr,
SM_FUNCTION_INFO * func_index_info,
PT_NODE * alter,
const char * src_cls_name,
const char * new_cls_name
)
function do_rename¶
function do_rename_partition¶
function do_revoke¶
function do_set_object_id¶
int do_set_object_id (
const PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * object_id_list
)
function do_show_histogram¶
do_show_histogram() - Show a histogram on a class. return: Error code if it fails parser(in): Parser context statement(in): Parse tree of a show histogram statement
function do_truncate¶
function do_update_histogram¶
do_update_histogram() - Create or Update a histogram on a class. return: Error code if it fails parser(in): Parser context statement(in): Parse tree of a create histogram statement
function ib_get_thread_count¶
function update_or_drop_histogram_helper¶
int update_or_drop_histogram_helper (
PARSER_CONTEXT * parser,
DB_OBJECT * const obj,
PT_HISTOGRAM_INFO * const histogram_info,
DO_HISTOGRAM do_histogram
)
Public Static Functions Documentation¶
function acquire_locks_for_multiple_rename¶
function add_foreign_key¶
function add_query_to_virtual_class¶
static int add_query_to_virtual_class (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
const PT_NODE * queries
)
function add_union_query¶
function adjust_partition_range¶
function adjust_partition_size¶
function build_att_coll_change_map¶
static int build_att_coll_change_map (
TP_DOMAIN * curr_domain,
TP_DOMAIN * req_domain,
SM_ATTR_PROP_CHG * attr_chg_properties
)
function build_att_type_change_map¶
static int build_att_type_change_map (
TP_DOMAIN * curr_domain,
TP_DOMAIN * req_domain,
SM_ATTR_PROP_CHG * attr_chg_properties
)
function build_attr_change_map¶
static int build_attr_change_map (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * attr_def,
PT_NODE * attr_old_name,
PT_NODE * constraints,
SM_ATTR_PROP_CHG * attr_chg_properties
)
function check_att_chg_allowed¶
static int check_att_chg_allowed (
const char * att_name,
const PT_TYPE_ENUM t,
const SM_ATTR_PROP_CHG * attr_chg_prop,
SM_ATTR_CHG_SOL chg_how,
bool log_error_allowed,
bool * new_attempt
)
function check_change_attribute¶
static int check_change_attribute (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * attribute,
PT_NODE * old_name_node,
PT_NODE ** pointer_constraints,
SM_ATTR_PROP_CHG * attr_chg_prop,
SM_ATTR_CHG_SOL * change_mode
)
function check_change_class_collation¶
static int check_change_class_collation (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_ALTER_INFO * alter,
bool * need_update,
int * collation_id
)
function check_default_on_update_clause¶
function compile_partition_expression¶
static SM_FUNCTION_INFO * compile_partition_expression (
PARSER_CONTEXT * parser,
PT_NODE * entity_name,
PT_NODE * pinfo
)
function create_or_drop_index_helper¶
static int create_or_drop_index_helper (
PARSER_CONTEXT * parser,
const char * const constraint_name,
const bool is_reverse,
const bool is_unique,
const PT_INDEX_INFO * idx_info,
DB_OBJECT * const obj,
DO_INDEX do_index
)
function create_select_to_insert_into¶
static PT_NODE * create_select_to_insert_into (
PARSER_CONTEXT * parser,
const char * class_name,
PT_NODE * create_select,
PT_CREATE_SELECT_ACTION create_select_action,
DB_QUERY_TYPE * query_columns
)
function do_add_attribute¶
static int do_add_attribute (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * atts,
PT_NODE * constraints,
bool error_on_not_normal
)
function do_add_attribute_from_select_column¶
static int do_add_attribute_from_select_column (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
DB_QUERY_TYPE * column
)
function do_alter_change_auto_increment¶
function do_alter_change_col_comment¶
function do_alter_change_default_cs_coll¶
function do_alter_change_owner¶
function do_alter_change_tbl_comment¶
function do_alter_clause_add_index¶
function do_alter_clause_change_attribute¶
static int do_alter_clause_change_attribute (
PARSER_CONTEXT * const parser,
PT_NODE * const alter
)
function do_alter_clause_drop_index¶
function do_alter_clause_rename_entity¶
function do_alter_index_comment¶
function do_alter_index_rebuild¶
function do_alter_index_status¶
function do_alter_one_clause_with_template¶
function do_alter_partitioning_post¶
static int do_alter_partitioning_post (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_alter_partitioning_pre¶
static int do_alter_partitioning_pre (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_analyze_partition¶
static int do_analyze_partition (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_cache_empty_histogram¶
function do_change_att_schema_only¶
static int do_change_att_schema_only (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
PT_NODE * attribute,
PT_NODE * old_name_node,
PT_NODE * constraints,
SM_ATTR_PROP_CHG * attr_chg_prop,
SM_ATTR_CHG_SOL * change_mode
)
function do_check_fk_constraints_internal¶
static int do_check_fk_constraints_internal (
DB_CTMPL * ctemplate,
PT_NODE * constraints,
bool is_partitioned
)
function do_coalesce_partition_post¶
static int do_coalesce_partition_post (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_coalesce_partition_pre¶
static int do_coalesce_partition_pre (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_copy_indexes¶
function do_create_partition¶
static int do_create_partition (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_create_partition_constraint¶
static int do_create_partition_constraint (
PT_NODE * alter,
SM_CLASS * root_class,
SM_CLASS_CONSTRAINT * constraint,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_create_partition_constraints¶
static int do_create_partition_constraints (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_drop_att_constraints¶
function do_drop_saved_indexes¶
function do_find_auto_increment_serial¶
static int do_find_auto_increment_serial (
MOP * auto_increment_obj,
const char * class_name,
const char * attr_name
)
function do_promote_partition¶
function do_promote_partition_by_name¶
static int do_promote_partition_by_name (
const char * class_name,
const char * part_num,
char ** partition_name
)
function do_promote_partition_list¶
static int do_promote_partition_list (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_recreate_att_constraints¶
function do_recreate_renamed_class_indexes¶
static int do_recreate_renamed_class_indexes (
const PARSER_CONTEXT * parser,
const char * const old_class_name,
const char * const class_name
)
function do_recreate_saved_indexes¶
function do_redistribute_partitions_data¶
static int do_redistribute_partitions_data (
const char * class_name,
const char * keyname,
char ** promoted,
int promoted_count,
PT_ALTER_CODE alter_op,
bool should_update,
bool should_insert
)
function do_remove_partition_post¶
static int do_remove_partition_post (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_remove_partition_pre¶
static int do_remove_partition_pre (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_rename_internal¶
function do_reorganize_partition_post¶
static int do_reorganize_partition_post (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_reorganize_partition_pre¶
static int do_reorganize_partition_pre (
PARSER_CONTEXT * parser,
PT_NODE * alter,
SM_PARTITION_ALTER_INFO * pinfo
)
function do_run_update_query_for_class¶
function do_run_update_query_for_new_default_expression_fields¶
static int do_run_update_query_for_new_default_expression_fields (
PARSER_CONTEXT * parser,
PT_NODE * alter,
PT_NODE * attr_list,
int attr_count,
MOP class_mop
)
function do_run_update_query_for_new_notnull_fields¶
static int do_run_update_query_for_new_notnull_fields (
PARSER_CONTEXT * parser,
PT_NODE * alter,
PT_NODE * attr_list,
int attr_count,
MOP class_mop
)
function do_run_upgrade_instances_domain¶
static int do_run_upgrade_instances_domain (
PARSER_CONTEXT * parser,
OID * p_class_oid,
int att_id
)
function do_save_all_indexes¶
function do_set_auto_increment¶
static int do_set_auto_increment (
PARSER_CONTEXT * parser,
DB_CTMPL * ctemplate,
const char * attr_name,
PT_NODE * attribute,
SM_ATTRIBUTE ** attr
)
function do_update_new_cols_with_default_expression¶
static int do_update_new_cols_with_default_expression (
PARSER_CONTEXT * parser,
PT_NODE * alter,
MOP class_mop
)
function do_update_new_notnull_cols_without_default¶
static int do_update_new_notnull_cols_without_default (
PARSER_CONTEXT * parser,
PT_NODE * alter,
MOP class_mop
)
function drop_class_name¶
function execute_create_select_query¶
static int execute_create_select_query (
PARSER_CONTEXT * parser,
const char * const class_name,
PT_NODE * create_select,
PT_CREATE_SELECT_ACTION create_select_action,
DB_QUERY_TYPE * query_columns,
PT_NODE * flagged_statement
)
function get_att_default_from_def¶
static int get_att_default_from_def (
PARSER_CONTEXT * parser,
PT_NODE * attribute,
DB_VALUE ** default_value,
const char * classname
)
function get_att_order_from_def¶
static int get_att_order_from_def (
PT_NODE * attribute,
bool * ord_first,
const char ** ord_after_name
)
function get_attr_name¶
function get_attribute_with_name¶
function get_hard_default_for_type¶
function get_index_type_qualifiers¶
static int get_index_type_qualifiers (
MOP obj,
bool * is_reverse,
bool * is_unique,
const char * index_name
)
function get_reverse_unique_index_type¶
static DB_CONSTRAINT_TYPE get_reverse_unique_index_type (
const bool is_reverse,
const bool is_unique
)
function is_att_change_needed¶
function is_att_prop_set¶
function is_att_property_structure_checked¶
function is_attribute_primary_key¶
function lob_process_dir_add_attr¶
function lob_process_dir_drop_attr¶
function map_pt_to_sm_action¶
function pt_node_to_function_index¶
static SM_FUNCTION_INFO * pt_node_to_function_index (
PARSER_CONTEXT * parser,
PT_NODE * spec,
PT_NODE * sort_spec,
DO_INDEX do_index
)
function pt_node_to_partition_info¶
static SM_PARTITION * pt_node_to_partition_info (
PARSER_CONTEXT * parser,
PT_NODE * node,
PT_NODE * entity_name,
char * class_name,
char * partition_name,
DB_VALUE * minval
)
function pt_replace_names_index_expr¶
static PT_NODE * pt_replace_names_index_expr (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * void_arg,
int * continue_walk
)
function query_get_column_with_name¶
static DB_QUERY_TYPE * query_get_column_with_name (
DB_QUERY_TYPE * query_columns,
const char * name
)
function replace_names_alter_chg_attr¶
static PT_NODE * replace_names_alter_chg_attr (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * void_arg,
int * continue_walk
)
function reset_att_property_structure¶
function save_constraint_info_from_pt_node¶
static int save_constraint_info_from_pt_node (
SM_CONSTRAINT_INFO ** save_info,
const PT_NODE * const pt_constr
)
function sort_constr_info_list¶
function truncate_class_name¶
function update_locksets_for_multiple_rename¶
static int update_locksets_for_multiple_rename (
const char * class_name,
int * num_mops,
MOP * mop_set,
int * num_names,
char ** name_set,
bool error_on_misssing_class
)
function validate_attribute_domain¶
static int validate_attribute_domain (
PARSER_CONTEXT * parser,
PT_NODE * attribute,
const bool check_zero_precision
)
Macro Definition Documentation¶
define GET_NAME¶
define GET_STRING¶
define IS_NAME¶
define IS_STRING¶
define MAX_FILTER_PREDICATE_STRING_LENGTH¶
define MAX_FUNCTION_EXPRESSION_STRING_LENGTH¶
define QUERY_MAX_SIZE¶
define UNIQUE_SAVEPOINT_ADD_ATTR_MTHD¶
define UNIQUE_SAVEPOINT_ALTER_INDEX¶
define UNIQUE_SAVEPOINT_ALTER_USER_ENTITY¶
define UNIQUE_SAVEPOINT_CHANGE_ATTR¶
define UNIQUE_SAVEPOINT_CHANGE_COLUMN_COMMENT¶
define UNIQUE_SAVEPOINT_CHANGE_DEF_COLL¶
define UNIQUE_SAVEPOINT_CHANGE_TBL_COMMENT¶
define UNIQUE_SAVEPOINT_CREATE_ENTITY¶
define UNIQUE_SAVEPOINT_CREATE_USER_ENTITY¶
define UNIQUE_SAVEPOINT_DROP_ENTITY¶
define UNIQUE_SAVEPOINT_DROP_USER_ENTITY¶
define UNIQUE_SAVEPOINT_GRANT_USER¶
define UNIQUE_SAVEPOINT_MULTIPLE_ALTER¶
define UNIQUE_SAVEPOINT_RENAME¶
define UNIQUE_SAVEPOINT_REPLACE_VIEW¶
define UNIQUE_SAVEPOINT_REVOKE_USER¶
define UNIQUE_SAVEPOINT_TRUNCATE¶
The documentation for this class was generated from the following file cubrid/src/query/execute_schema.c