File type_checking.c
FileList > cubrid > src > parser > type_checking.c
Go to the source code of this file
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <vector>
#include <sys/time.h>
#include "authenticate.h"
#include "error_manager.h"
#include "parser.h"
#include "parser_message.h"
#include "parse_type.hpp"
#include "set_object.h"
#include "arithmetic.h"
#include "string_opfunc.h"
#include "object_domain.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "semantic_check.h"
#include "xasl_generation.h"
#include "language_support.h"
#include "schema_manager.h"
#include "system_parameter.h"
#include "network_interface_cl.h"
#include "object_template.h"
#include "db.h"
#include "tz_support.h"
#include "func_type.hpp"
#include "dbtype.h"
Classes
Public Types
Public Static Attributes
Public Functions
| Type |
Name |
| PT_NODE * |
pt_append_query_select_list (PARSER_CONTEXT * parser, PT_NODE * query, PT_NODE * attrs)
|
| int |
pt_between_to_comp_op (PT_OP_TYPE between, PT_OP_TYPE * left, PT_OP_TYPE * right)
|
| bool |
pt_check_not_null_constraint (PARSER_CONTEXT * parser, PT_NODE * from, PT_NODE * node)
|
| PT_NODE * |
pt_coerce_node_collation (PARSER_CONTEXT * parser, PT_NODE * node, const int coll_id, const INTL_CODESET codeset, bool force_mode, bool use_collate_modifier, PT_TYPE_ENUM wrap_type_for_maybe, PT_TYPE_ENUM wrap_type_collection)
|
| int |
pt_coerce_value (PARSER_CONTEXT * parser, PT_NODE * src, PT_NODE * dest, PT_TYPE_ENUM desired_type, PT_NODE * data_type)
|
| int |
pt_coerce_value_explicit (PARSER_CONTEXT * parser, PT_NODE * src, PT_NODE * dest, PT_TYPE_ENUM desired_type, PT_NODE * data_type)
|
| int |
pt_coerce_value_for_default_value (PARSER_CONTEXT * parser, PT_NODE * src, PT_NODE * dest, PT_TYPE_ENUM desired_type, PT_NODE * data_type, DB_DEFAULT_EXPR_TYPE default_expr_type, bool check_string_precision)
|
| int |
pt_common_collation (PT_COLL_INFER * arg1_coll_infer, PT_COLL_INFER * arg2_coll_infer, PT_COLL_INFER * arg3_coll_infer, const int args_w_coll, bool op_has_3_args, int * common_coll, INTL_CODESET * common_cs)
|
| PT_TYPE_ENUM |
pt_common_type (PT_TYPE_ENUM arg1_type, PT_TYPE_ENUM arg2_type)
|
| int |
pt_comp_to_between_op (PT_OP_TYPE left, PT_OP_TYPE right, PT_COMP_TO_BETWEEN_OP_CODE_TYPE type, PT_OP_TYPE * between)
|
| PT_OP_TYPE |
pt_converse_op (PT_OP_TYPE op)
|
| int |
pt_evaluate_db_value_expr (PARSER_CONTEXT * parser, PT_NODE * expr, PT_OP_TYPE op, DB_VALUE * arg1, DB_VALUE * arg2, DB_VALUE * arg3, DB_VALUE * result, TP_DOMAIN * domain, PT_NODE * o1, PT_NODE * o2, PT_NODE * o3, PT_MISC_TYPE qualifier)
|
| int |
pt_evaluate_function (PARSER_CONTEXT * parser, PT_NODE * func, DB_VALUE * dbval_res)
|
| int |
pt_evaluate_function_w_args (PARSER_CONTEXT * parser, FUNC_CODE fcode, DB_VALUE * args, const int num_args, DB_VALUE * result)
|
| bool |
pt_false_search_condition (PARSER_CONTEXT * parser, const PT_NODE * node)
|
| bool |
pt_false_where (PARSER_CONTEXT * parser, PT_NODE * node)
|
| bool |
pt_get_collation_info (const PT_NODE * node, PT_COLL_INFER * coll_infer)
|
| int |
pt_is_between_range_op (PT_OP_TYPE op)
|
| int |
pt_is_comp_op (PT_OP_TYPE op)
|
| bool |
pt_is_op_hv_late_bind (PT_OP_TYPE op)
|
| bool |
pt_is_symmetric_op (const PT_OP_TYPE op)
|
| PT_OP_TYPE |
pt_negate_op (PT_OP_TYPE op)
|
| void |
pt_preset_hostvar (PARSER_CONTEXT * parser, PT_NODE * hv_node)
|
| PT_NODE * |
pt_semantic_type (PARSER_CONTEXT * parser, PT_NODE * tree, SEMANTIC_CHK_INFO * sc_info_ptr)
|
| void |
pt_set_expected_domain (PT_NODE * node, TP_DOMAIN * domain)
|
| PT_TYPE_ENUM |
pt_to_variable_size_type (PT_TYPE_ENUM type_enum)
|
| int |
pt_type_generic_func (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_NODE * |
pt_where_type (PARSER_CONTEXT * parser, PT_NODE * where)
|
| PT_NODE * |
pt_where_type_keep_true (PARSER_CONTEXT * parser, PT_NODE * where)
|
| PT_NODE * |
pt_wrap_collection_with_cast_op (PARSER_CONTEXT * parser, PT_NODE * arg, PT_TYPE_ENUM set_type, PT_NODE * set_data, bool for_collation)
|
| int |
pt_wrap_select_list_with_cast_op (PARSER_CONTEXT * parser, PT_NODE * query, PT_TYPE_ENUM new_type, int p, int s, PT_NODE * data_type, bool force_wrap)
|
| PT_NODE * |
pt_wrap_with_cast_op (PARSER_CONTEXT * parser, PT_NODE * arg, PT_TYPE_ENUM new_type, int p, int s, PT_NODE * desired_dt)
|
Public Static Functions
| Type |
Name |
| bool |
does_op_specially_treat_null_arg (PT_OP_TYPE op)
|
| int |
generic_func_casecmp (const void * a, const void * b)
|
| void |
init_generic_funcs (void)
|
| int |
pt_apply_expressions_definition (PARSER_CONTEXT * parser, PT_NODE ** expr)
|
| bool |
pt_are_unmatchable_types (const PT_ARG_TYPE def_type, const PT_TYPE_ENUM op_type)
|
| bool |
pt_cast_needs_wrap_for_collation (PT_NODE * node, const INTL_CODESET codeset)
|
| int |
pt_character_length_for_node (PT_NODE * node, const PT_TYPE_ENUM coerce_type)
|
| int |
pt_check_and_coerce_to_date (PARSER_CONTEXT * parser, PT_NODE * src)
|
| int |
pt_check_and_coerce_to_time (PARSER_CONTEXT * parser, PT_NODE * src)
|
| bool |
pt_check_const_fold_op_w_args (PT_OP_TYPE op, DB_VALUE * arg1, DB_VALUE * arg2, DB_VALUE * arg3, TP_DOMAIN * domain)
|
| int |
pt_check_expr_collation (PARSER_CONTEXT * parser, PT_NODE ** node)
|
| int |
pt_check_recursive_expr_collation (PARSER_CONTEXT * parser, PT_NODE ** node)
|
| void |
pt_chop_to_one_select_item (PARSER_CONTEXT * parser, PT_NODE * node)
|
| const char * |
pt_class_name (const PT_NODE * type)
|
| int |
pt_coerce_3args (PARSER_CONTEXT * parser, PT_NODE * arg1, PT_NODE * arg2, PT_NODE * arg3)
|
| PT_NODE * |
pt_coerce_expr_arguments (PARSER_CONTEXT * parser, PT_NODE * expr, PT_NODE * arg1, PT_NODE * arg2, PT_NODE * arg3, EXPRESSION_SIGNATURE sig)
|
| int |
pt_coerce_expression_argument (PARSER_CONTEXT * parser, PT_NODE * expr, PT_NODE ** arg, const PT_TYPE_ENUM arg_type, PT_NODE * data_type)
|
| PT_NODE * |
pt_coerce_node_collection_of_collection (PARSER_CONTEXT * parser, PT_NODE * node, const int coll_id, const INTL_CODESET codeset, bool force_mode, bool use_collate_modifier, PT_TYPE_ENUM wrap_type_for_maybe, PT_TYPE_ENUM wrap_type_collection)
|
| PT_NODE * |
pt_coerce_range_expr_arguments (PARSER_CONTEXT * parser, PT_NODE * expr, PT_NODE * arg1, PT_NODE * arg2, PT_NODE * arg3, EXPRESSION_SIGNATURE sig)
|
| int |
pt_coerce_str_to_time_date_utime_datetime (PARSER_CONTEXT * parser, PT_NODE * src, PT_TYPE_ENUM * result_type)
|
| int |
pt_coerce_value_internal (PARSER_CONTEXT * parser, PT_NODE * src, PT_NODE * dest, PT_TYPE_ENUM desired_type, PT_NODE * data_type, bool check_string_precision, bool implicit_coercion)
|
| PT_TYPE_ENUM |
pt_common_type_op (PT_TYPE_ENUM t1, PT_OP_TYPE op, PT_TYPE_ENUM t2)
|
| PT_NODE * |
pt_compare_bounds_to_value (PARSER_CONTEXT * parser, PT_NODE * expr, PT_OP_TYPE op, PT_TYPE_ENUM lhs_type, DB_VALUE * rhs_val, PT_TYPE_ENUM rhs_type)
|
| int |
pt_difference_sets (PARSER_CONTEXT * parser, TP_DOMAIN * domain, DB_VALUE * set1, DB_VALUE * set2, DB_VALUE * result, PT_NODE * o2)
|
| PT_NODE * |
pt_eval_expr_type (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_NODE * |
pt_eval_function_type (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_NODE * |
pt_eval_method_call_type (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_NODE * |
pt_eval_opt_type (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_NODE * |
pt_eval_recursive_expr_type (PARSER_CONTEXT * parser, PT_NODE * gl_expr)
|
| PT_NODE * |
pt_eval_type (PARSER_CONTEXT * parser, PT_NODE * node, void * arg, int * continue_walk)
|
| PT_NODE * |
pt_eval_type_pre (PARSER_CONTEXT * parser, PT_NODE * node, void * arg, int * continue_walk)
|
| PT_NODE * |
pt_evaluate_new_data_type (const PT_TYPE_ENUM old_type, const PT_TYPE_ENUM new_type, PT_NODE * data_type)
|
| PT_TYPE_ENUM |
pt_expr_get_return_type (PT_NODE * expr, const EXPRESSION_SIGNATURE sig)
|
| void |
pt_fix_arguments_collation_flag (PT_NODE * expr)
|
| PT_NODE * |
pt_fix_enumeration_comparison (PARSER_CONTEXT * parser, PT_NODE * expr)
|
| PT_NODE * |
pt_fold_const_expr (PARSER_CONTEXT * parser, PT_NODE * expr, void * arg)
|
| PT_NODE * |
pt_fold_const_function (PARSER_CONTEXT * parser, PT_NODE * func)
|
| PT_NODE * |
pt_fold_constants_post (PARSER_CONTEXT * parser, PT_NODE * node, void * arg, int * continue_walk)
|
| PT_NODE * |
pt_fold_constants_pre (PARSER_CONTEXT * parser, PT_NODE * node, void * arg, int * continue_walk)
|
| COLLATION_RESULT |
pt_get_collation_info_for_collection_type (PARSER_CONTEXT * parser, const PT_NODE * node, PT_COLL_INFER * coll_infer)
|
| COLLATION_RESULT |
pt_get_collation_of_collection (PARSER_CONTEXT * parser, const PT_NODE * node, PT_COLL_INFER * coll_infer, const bool is_inner_collection, bool * is_first_element)
|
| PT_TYPE_ENUM |
pt_get_common_arg_type_of_width_bucket (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_TYPE_ENUM |
pt_get_common_collection_type (const PT_NODE * set, bool * is_multitype)
|
| PT_TYPE_ENUM |
pt_get_common_datetime_type (PARSER_CONTEXT * parser, PT_TYPE_ENUM common_type, PT_TYPE_ENUM arg1_type, PT_TYPE_ENUM arg2_type, PT_NODE * arg1, PT_NODE * arg2)
|
| PT_TYPE_ENUM |
pt_get_equivalent_type_with_op (const PT_ARG_TYPE def_type, const PT_TYPE_ENUM arg_type, PT_OP_TYPE op)
|
| bool |
pt_get_expression_definition (const PT_OP_TYPE op, EXPRESSION_DEFINITION * def)
|
| void |
pt_hv_consistent_data_type_with_domain (PARSER_CONTEXT * parser, PT_NODE * node)
|
| PT_TYPE_ENUM |
pt_infer_common_type (const PT_OP_TYPE op, PT_TYPE_ENUM * arg1, PT_TYPE_ENUM * arg2, PT_TYPE_ENUM * arg3, const TP_DOMAIN * expected_domain)
|
| bool |
pt_is_able_to_determine_return_type (const PT_OP_TYPE op)
|
| bool |
pt_is_collection_of_type (const PT_NODE * collection, const PT_TYPE_ENUM collection_type, const PT_TYPE_ENUM element_type)
|
| bool |
pt_is_const_foldable_width_bucket (PARSER_CONTEXT * parser, PT_NODE * expr)
|
| bool |
pt_is_dblink_related (PT_NODE * p)
|
| bool |
pt_is_enumeration_special_comparison (PT_NODE * arg1, PT_OP_TYPE op, PT_NODE * arg2)
|
| bool |
pt_is_explicit_coerce_allowed_for_default_value (PARSER_CONTEXT * parser, PT_TYPE_ENUM data_type, PT_TYPE_ENUM desired_type)
|
| bool |
pt_is_op_w_collation (const PT_OP_TYPE op)
|
| bool |
pt_is_op_with_forced_common_type (PT_OP_TYPE op)
|
| bool |
pt_is_range_comp_op (const PT_OP_TYPE op)
|
| bool |
pt_is_range_expression (const PT_OP_TYPE op)
|
| bool |
pt_is_range_or_comp (PT_OP_TYPE op)
|
| bool |
pt_is_symmetric_type (const PT_TYPE_ENUM type_enum)
|
| PT_NODE * |
pt_node_to_enumeration_expr (PARSER_CONTEXT * parser, PT_NODE * data_type, PT_NODE * node)
|
| int |
pt_product_sets (PARSER_CONTEXT * parser, TP_DOMAIN * domain, DB_VALUE * set1, DB_VALUE * set2, DB_VALUE * result, PT_NODE * o2)
|
| PT_NODE * |
pt_propagate_types (PARSER_CONTEXT * parser, PT_NODE * expr, PT_NODE * otype1, PT_NODE * otype2)
|
| PT_NODE * |
pt_select_list_to_enumeration_expr (PARSER_CONTEXT * parser, PT_NODE * data_type, PT_NODE * node)
|
| int |
pt_set_default_data_type (PARSER_CONTEXT * parser, PT_TYPE_ENUM type, PT_NODE ** dtp)
|
| PT_NODE * |
pt_set_expr_removable_flag (PARSER_CONTEXT * parser, PT_NODE * expr, void * arg, int * continue_walk)
|
| PT_NODE * |
pt_set_flag_do_not_fold_for_dblink (PARSER_CONTEXT * parser, PT_NODE * expr, void * arg, int * continue_walk)
|
| PT_NODE * |
pt_to_false_subquery (PARSER_CONTEXT * parser, PT_NODE * node)
|
| int |
pt_union_sets (PARSER_CONTEXT * parser, TP_DOMAIN * domain, DB_VALUE * set1, DB_VALUE * set2, DB_VALUE * result, PT_NODE * o2)
|
| int |
pt_upd_domain_info (PARSER_CONTEXT * parser, PT_NODE * arg1, PT_NODE * arg2, PT_OP_TYPE op, PT_TYPE_ENUM common_type, PT_NODE * node)
|
| void |
pt_update_host_var_data_type (PARSER_CONTEXT * parser, PT_NODE * hv_node)
|
| PT_NODE * |
pt_wrap_expr_w_exp_dom_cast (PARSER_CONTEXT * parser, PT_NODE * expr)
|
| int |
pt_wrap_logical_arglist_with_integer (PARSER_CONTEXT * parser, PT_NODE * node, PT_NODE * arg_list)
|
| PT_TYPE_ENUM |
pt_wrap_type_for_collation (const PT_NODE * arg1, const PT_NODE * arg2, const PT_NODE * arg3, PT_TYPE_ENUM * wrap_type_collection)
|
Macros
| Type |
Name |
| define |
COMPARE_BETWEEN_OPERATOR_COUNT /* multi line expression */
|
| define |
MAX_OVERLOADS 16
|
| define |
MORE_COERCIBLE (arg1_coll_infer, arg2_coll_infer) /* multi line expression */
|
| define |
PT_ARE_COMPARABLE (typ1, typ2) (([**typ1**](broker__monitor_8c.md#function-timeout) == [**typ2**](broker__monitor_8c.md#function-timeout)) \|\| [**PT\_ARE\_COMPARABLE\_CHAR\_TYPE**](type__checking_8c.md#define-pt_are_comparable_char_type)([**typ1**](broker__monitor_8c.md#function-timeout), [**typ2**](broker__monitor_8c.md#function-timeout)) \|\| [**PT\_ARE\_COMPARABLE\_NUMERIC\_TYPE**](type__checking_8c.md#define-pt_are_comparable_numeric_type) ([**typ1**](broker__monitor_8c.md#function-timeout), [**typ2**](broker__monitor_8c.md#function-timeout)))
|
| define |
PT_ARE_COMPARABLE_CHAR_TYPE (typ1, typ2) ([**PT\_IS\_SIMPLE\_CHAR\_STRING\_TYPE**](parse__tree_8h.md#define-pt_is_simple_char_string_type) ([**typ1**](broker__monitor_8c.md#function-timeout)) && [**PT\_IS\_SIMPLE\_CHAR\_STRING\_TYPE**](parse__tree_8h.md#define-pt_is_simple_char_string_type) ([**typ2**](broker__monitor_8c.md#function-timeout)))
|
| define |
PT_ARE_COMPARABLE_NO_CHAR (typ1, typ2) (([**typ1**](broker__monitor_8c.md#function-timeout) == [**typ2**](broker__monitor_8c.md#function-timeout)) \|\| [**PT\_ARE\_COMPARABLE\_NUMERIC\_TYPE**](type__checking_8c.md#define-pt_are_comparable_numeric_type) ([**typ1**](broker__monitor_8c.md#function-timeout), [**typ2**](broker__monitor_8c.md#function-timeout)))
|
| define |
PT_ARE_COMPARABLE_NUMERIC_TYPE (typ1, typ2) /* multi line expression */
|
| define |
PT_COLL_WRAP_TYPE_FOR_MAYBE (type) (([**PT\_IS\_CHAR\_STRING\_TYPE**](parse__tree_8h.md#define-pt_is_char_string_type) (type)) ? (type) : PT\_TYPE\_VARCHAR)
|
| define |
PT_IS_LEFT_RECURSIVE_EXPRESSION (node) ((node)->info.expr.op == PT\_GREATEST \|\| (node)->info.expr.op == PT\_LEAST \|\| (node)->info.expr.op == PT\_COALESCE)
|
| define |
PT_IS_RECURSIVE_EXPRESSION (node) ((node)->node\_type == PT\_EXPR && ([**PT\_IS\_LEFT\_RECURSIVE\_EXPRESSION**](type__checking_8c.md#define-pt_is_left_recursive_expression) (node) \|\| [**PT\_IS\_RIGHT\_RECURSIVE\_EXPRESSION**](type__checking_8c.md#define-pt_is_right_recursive_expression) (node)))
|
| define |
PT_IS_RIGHT_RECURSIVE_EXPRESSION (node) ((node)->info.expr.op == PT\_CASE \|\| (node)->info.expr.op == PT\_DECODE)
|
| define |
PT_NODE_IS_SESSION_VARIABLE (node) /* multi line expression */
|
| define |
SET_EXPECTED_DOMAIN (node, dom) /* multi line expression */
|
Public Types Documentation
typedef COLLATION_RESULT
typedef enum collation_result COLLATION_RESULT;
typedef COMPARE_BETWEEN_OPERATOR
typedef struct compare_between_operator COMPARE_BETWEEN_OPERATOR;
typedef EXPRESSION_DEFINITION
typedef struct expression_definition EXPRESSION_DEFINITION;
typedef EXPRESSION_SIGNATURE
typedef struct expression_signature EXPRESSION_SIGNATURE;
typedef GENERIC_FUNCTION_RECORD
typedef struct generic_function_record GENERIC_FUNCTION_RECORD;
enum collation_result
enum collation_result {
ERROR_COLLATION = -1,
NO_COLLATION = 0,
HAS_COLLATION = 1
};
Public Static Attributes Documentation
variable pt_Compare_between_operator_table
COMPARE_BETWEEN_OPERATOR pt_Compare_between_operator_table[];
variable pt_Generic_functions
GENERIC_FUNCTION_RECORD pt_Generic_functions[];
variable pt_Generic_functions_sorted
int pt_Generic_functions_sorted;
Public Functions Documentation
function pt_append_query_select_list
PT_NODE * pt_append_query_select_list (
PARSER_CONTEXT * parser,
PT_NODE * query,
PT_NODE * attrs
)
function pt_between_to_comp_op
int pt_between_to_comp_op (
PT_OP_TYPE between,
PT_OP_TYPE * left,
PT_OP_TYPE * right
)
function pt_check_not_null_constraint
bool pt_check_not_null_constraint (
PARSER_CONTEXT * parser,
PT_NODE * from,
PT_NODE * node
)
function pt_coerce_node_collation
PT_NODE * pt_coerce_node_collation (
PARSER_CONTEXT * parser,
PT_NODE * node,
const int coll_id,
const INTL_CODESET codeset,
bool force_mode,
bool use_collate_modifier,
PT_TYPE_ENUM wrap_type_for_maybe,
PT_TYPE_ENUM wrap_type_collection
)
function pt_coerce_value
int pt_coerce_value (
PARSER_CONTEXT * parser,
PT_NODE * src,
PT_NODE * dest,
PT_TYPE_ENUM desired_type,
PT_NODE * data_type
)
function pt_coerce_value_explicit
int pt_coerce_value_explicit (
PARSER_CONTEXT * parser,
PT_NODE * src,
PT_NODE * dest,
PT_TYPE_ENUM desired_type,
PT_NODE * data_type
)
function pt_coerce_value_for_default_value
int pt_coerce_value_for_default_value (
PARSER_CONTEXT * parser,
PT_NODE * src,
PT_NODE * dest,
PT_TYPE_ENUM desired_type,
PT_NODE * data_type,
DB_DEFAULT_EXPR_TYPE default_expr_type,
bool check_string_precision
)
function pt_common_collation
int pt_common_collation (
PT_COLL_INFER * arg1_coll_infer,
PT_COLL_INFER * arg2_coll_infer,
PT_COLL_INFER * arg3_coll_infer,
const int args_w_coll,
bool op_has_3_args,
int * common_coll,
INTL_CODESET * common_cs
)
function pt_common_type
PT_TYPE_ENUM pt_common_type (
PT_TYPE_ENUM arg1_type,
PT_TYPE_ENUM arg2_type
)
function pt_comp_to_between_op
int pt_comp_to_between_op (
PT_OP_TYPE left,
PT_OP_TYPE right,
PT_COMP_TO_BETWEEN_OP_CODE_TYPE type,
PT_OP_TYPE * between
)
function pt_converse_op
PT_OP_TYPE pt_converse_op (
PT_OP_TYPE op
)
function pt_evaluate_db_value_expr
int pt_evaluate_db_value_expr (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_OP_TYPE op,
DB_VALUE * arg1,
DB_VALUE * arg2,
DB_VALUE * arg3,
DB_VALUE * result,
TP_DOMAIN * domain,
PT_NODE * o1,
PT_NODE * o2,
PT_NODE * o3,
PT_MISC_TYPE qualifier
)
function pt_evaluate_function
int pt_evaluate_function (
PARSER_CONTEXT * parser,
PT_NODE * func,
DB_VALUE * dbval_res
)
function pt_evaluate_function_w_args
int pt_evaluate_function_w_args (
PARSER_CONTEXT * parser,
FUNC_CODE fcode,
DB_VALUE * args,
const int num_args,
DB_VALUE * result
)
function pt_false_search_condition
bool pt_false_search_condition (
PARSER_CONTEXT * parser,
const PT_NODE * node
)
function pt_false_where
bool pt_false_where (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_get_collation_info
bool pt_get_collation_info (
const PT_NODE * node,
PT_COLL_INFER * coll_infer
)
function pt_is_between_range_op
int pt_is_between_range_op (
PT_OP_TYPE op
)
function pt_is_comp_op
int pt_is_comp_op (
PT_OP_TYPE op
)
function pt_is_op_hv_late_bind
bool pt_is_op_hv_late_bind (
PT_OP_TYPE op
)
function pt_is_symmetric_op
bool pt_is_symmetric_op (
const PT_OP_TYPE op
)
function pt_negate_op
PT_OP_TYPE pt_negate_op (
PT_OP_TYPE op
)
function pt_preset_hostvar
void pt_preset_hostvar (
PARSER_CONTEXT * parser,
PT_NODE * hv_node
)
function pt_semantic_type
PT_NODE * pt_semantic_type (
PARSER_CONTEXT * parser,
PT_NODE * tree,
SEMANTIC_CHK_INFO * sc_info_ptr
)
function pt_set_expected_domain
void pt_set_expected_domain (
PT_NODE * node,
TP_DOMAIN * domain
)
function pt_to_variable_size_type
PT_TYPE_ENUM pt_to_variable_size_type (
PT_TYPE_ENUM type_enum
)
function pt_type_generic_func
int pt_type_generic_func (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_where_type
PT_NODE * pt_where_type (
PARSER_CONTEXT * parser,
PT_NODE * where
)
function pt_where_type_keep_true
PT_NODE * pt_where_type_keep_true (
PARSER_CONTEXT * parser,
PT_NODE * where
)
function pt_wrap_collection_with_cast_op
PT_NODE * pt_wrap_collection_with_cast_op (
PARSER_CONTEXT * parser,
PT_NODE * arg,
PT_TYPE_ENUM set_type,
PT_NODE * set_data,
bool for_collation
)
function pt_wrap_select_list_with_cast_op
int pt_wrap_select_list_with_cast_op (
PARSER_CONTEXT * parser,
PT_NODE * query,
PT_TYPE_ENUM new_type,
int p,
int s,
PT_NODE * data_type,
bool force_wrap
)
function pt_wrap_with_cast_op
PT_NODE * pt_wrap_with_cast_op (
PARSER_CONTEXT * parser,
PT_NODE * arg,
PT_TYPE_ENUM new_type,
int p,
int s,
PT_NODE * desired_dt
)
Public Static Functions Documentation
function does_op_specially_treat_null_arg
static bool does_op_specially_treat_null_arg (
PT_OP_TYPE op
)
function generic_func_casecmp
static int generic_func_casecmp (
const void * a,
const void * b
)
function init_generic_funcs
static void init_generic_funcs (
void
)
function pt_apply_expressions_definition
static int pt_apply_expressions_definition (
PARSER_CONTEXT * parser,
PT_NODE ** expr
)
function pt_are_unmatchable_types
static bool pt_are_unmatchable_types (
const PT_ARG_TYPE def_type,
const PT_TYPE_ENUM op_type
)
function pt_cast_needs_wrap_for_collation
static bool pt_cast_needs_wrap_for_collation (
PT_NODE * node,
const INTL_CODESET codeset
)
function pt_character_length_for_node
static int pt_character_length_for_node (
PT_NODE * node,
const PT_TYPE_ENUM coerce_type
)
function pt_check_and_coerce_to_date
static int pt_check_and_coerce_to_date (
PARSER_CONTEXT * parser,
PT_NODE * src
)
function pt_check_and_coerce_to_time
static int pt_check_and_coerce_to_time (
PARSER_CONTEXT * parser,
PT_NODE * src
)
function pt_check_const_fold_op_w_args
static bool pt_check_const_fold_op_w_args (
PT_OP_TYPE op,
DB_VALUE * arg1,
DB_VALUE * arg2,
DB_VALUE * arg3,
TP_DOMAIN * domain
)
function pt_check_expr_collation
static int pt_check_expr_collation (
PARSER_CONTEXT * parser,
PT_NODE ** node
)
function pt_check_recursive_expr_collation
static int pt_check_recursive_expr_collation (
PARSER_CONTEXT * parser,
PT_NODE ** node
)
function pt_chop_to_one_select_item
static void pt_chop_to_one_select_item (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_class_name
static const char * pt_class_name (
const PT_NODE * type
)
function pt_coerce_3args
static int pt_coerce_3args (
PARSER_CONTEXT * parser,
PT_NODE * arg1,
PT_NODE * arg2,
PT_NODE * arg3
)
function pt_coerce_expr_arguments
static PT_NODE * pt_coerce_expr_arguments (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_NODE * arg1,
PT_NODE * arg2,
PT_NODE * arg3,
EXPRESSION_SIGNATURE sig
)
function pt_coerce_expression_argument
static int pt_coerce_expression_argument (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_NODE ** arg,
const PT_TYPE_ENUM arg_type,
PT_NODE * data_type
)
function pt_coerce_node_collection_of_collection
static PT_NODE * pt_coerce_node_collection_of_collection (
PARSER_CONTEXT * parser,
PT_NODE * node,
const int coll_id,
const INTL_CODESET codeset,
bool force_mode,
bool use_collate_modifier,
PT_TYPE_ENUM wrap_type_for_maybe,
PT_TYPE_ENUM wrap_type_collection
)
function pt_coerce_range_expr_arguments
static PT_NODE * pt_coerce_range_expr_arguments (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_NODE * arg1,
PT_NODE * arg2,
PT_NODE * arg3,
EXPRESSION_SIGNATURE sig
)
function pt_coerce_str_to_time_date_utime_datetime
static int pt_coerce_str_to_time_date_utime_datetime (
PARSER_CONTEXT * parser,
PT_NODE * src,
PT_TYPE_ENUM * result_type
)
function pt_coerce_value_internal
static int pt_coerce_value_internal (
PARSER_CONTEXT * parser,
PT_NODE * src,
PT_NODE * dest,
PT_TYPE_ENUM desired_type,
PT_NODE * data_type,
bool check_string_precision,
bool implicit_coercion
)
function pt_common_type_op
static PT_TYPE_ENUM pt_common_type_op (
PT_TYPE_ENUM t1,
PT_OP_TYPE op,
PT_TYPE_ENUM t2
)
function pt_compare_bounds_to_value
static PT_NODE * pt_compare_bounds_to_value (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_OP_TYPE op,
PT_TYPE_ENUM lhs_type,
DB_VALUE * rhs_val,
PT_TYPE_ENUM rhs_type
)
function pt_difference_sets
static int pt_difference_sets (
PARSER_CONTEXT * parser,
TP_DOMAIN * domain,
DB_VALUE * set1,
DB_VALUE * set2,
DB_VALUE * result,
PT_NODE * o2
)
function pt_eval_expr_type
static PT_NODE * pt_eval_expr_type (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_eval_function_type
static PT_NODE * pt_eval_function_type (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_eval_method_call_type
static PT_NODE * pt_eval_method_call_type (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_eval_opt_type
static PT_NODE * pt_eval_opt_type (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_eval_recursive_expr_type
static PT_NODE * pt_eval_recursive_expr_type (
PARSER_CONTEXT * parser,
PT_NODE * gl_expr
)
function pt_eval_type
static PT_NODE * pt_eval_type (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * arg,
int * continue_walk
)
function pt_eval_type_pre
static PT_NODE * pt_eval_type_pre (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * arg,
int * continue_walk
)
function pt_evaluate_new_data_type
static PT_NODE * pt_evaluate_new_data_type (
const PT_TYPE_ENUM old_type,
const PT_TYPE_ENUM new_type,
PT_NODE * data_type
)
function pt_expr_get_return_type
static PT_TYPE_ENUM pt_expr_get_return_type (
PT_NODE * expr,
const EXPRESSION_SIGNATURE sig
)
function pt_fix_arguments_collation_flag
static void pt_fix_arguments_collation_flag (
PT_NODE * expr
)
function pt_fix_enumeration_comparison
static PT_NODE * pt_fix_enumeration_comparison (
PARSER_CONTEXT * parser,
PT_NODE * expr
)
function pt_fold_const_expr
static PT_NODE * pt_fold_const_expr (
PARSER_CONTEXT * parser,
PT_NODE * expr,
void * arg
)
function pt_fold_const_function
static PT_NODE * pt_fold_const_function (
PARSER_CONTEXT * parser,
PT_NODE * func
)
function pt_fold_constants_post
static PT_NODE * pt_fold_constants_post (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * arg,
int * continue_walk
)
function pt_fold_constants_pre
static PT_NODE * pt_fold_constants_pre (
PARSER_CONTEXT * parser,
PT_NODE * node,
void * arg,
int * continue_walk
)
function pt_get_collation_info_for_collection_type
static COLLATION_RESULT pt_get_collation_info_for_collection_type (
PARSER_CONTEXT * parser,
const PT_NODE * node,
PT_COLL_INFER * coll_infer
)
function pt_get_collation_of_collection
static COLLATION_RESULT pt_get_collation_of_collection (
PARSER_CONTEXT * parser,
const PT_NODE * node,
PT_COLL_INFER * coll_infer,
const bool is_inner_collection,
bool * is_first_element
)
function pt_get_common_arg_type_of_width_bucket
static PT_TYPE_ENUM pt_get_common_arg_type_of_width_bucket (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_get_common_collection_type
static PT_TYPE_ENUM pt_get_common_collection_type (
const PT_NODE * set,
bool * is_multitype
)
function pt_get_common_datetime_type
static PT_TYPE_ENUM pt_get_common_datetime_type (
PARSER_CONTEXT * parser,
PT_TYPE_ENUM common_type,
PT_TYPE_ENUM arg1_type,
PT_TYPE_ENUM arg2_type,
PT_NODE * arg1,
PT_NODE * arg2
)
function pt_get_equivalent_type_with_op
static PT_TYPE_ENUM pt_get_equivalent_type_with_op (
const PT_ARG_TYPE def_type,
const PT_TYPE_ENUM arg_type,
PT_OP_TYPE op
)
function pt_get_expression_definition
static bool pt_get_expression_definition (
const PT_OP_TYPE op,
EXPRESSION_DEFINITION * def
)
function pt_hv_consistent_data_type_with_domain
static void pt_hv_consistent_data_type_with_domain (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_infer_common_type
static PT_TYPE_ENUM pt_infer_common_type (
const PT_OP_TYPE op,
PT_TYPE_ENUM * arg1,
PT_TYPE_ENUM * arg2,
PT_TYPE_ENUM * arg3,
const TP_DOMAIN * expected_domain
)
function pt_is_able_to_determine_return_type
static bool pt_is_able_to_determine_return_type (
const PT_OP_TYPE op
)
function pt_is_collection_of_type
static bool pt_is_collection_of_type (
const PT_NODE * collection,
const PT_TYPE_ENUM collection_type,
const PT_TYPE_ENUM element_type
)
function pt_is_const_foldable_width_bucket
static bool pt_is_const_foldable_width_bucket (
PARSER_CONTEXT * parser,
PT_NODE * expr
)
static bool pt_is_dblink_related (
PT_NODE * p
)
function pt_is_enumeration_special_comparison
static bool pt_is_enumeration_special_comparison (
PT_NODE * arg1,
PT_OP_TYPE op,
PT_NODE * arg2
)
function pt_is_explicit_coerce_allowed_for_default_value
static bool pt_is_explicit_coerce_allowed_for_default_value (
PARSER_CONTEXT * parser,
PT_TYPE_ENUM data_type,
PT_TYPE_ENUM desired_type
)
function pt_is_op_w_collation
static bool pt_is_op_w_collation (
const PT_OP_TYPE op
)
function pt_is_op_with_forced_common_type
static bool pt_is_op_with_forced_common_type (
PT_OP_TYPE op
)
function pt_is_range_comp_op
static bool pt_is_range_comp_op (
const PT_OP_TYPE op
)
function pt_is_range_expression
static bool pt_is_range_expression (
const PT_OP_TYPE op
)
function pt_is_range_or_comp
static bool pt_is_range_or_comp (
PT_OP_TYPE op
)
function pt_is_symmetric_type
static bool pt_is_symmetric_type (
const PT_TYPE_ENUM type_enum
)
function pt_node_to_enumeration_expr
static PT_NODE * pt_node_to_enumeration_expr (
PARSER_CONTEXT * parser,
PT_NODE * data_type,
PT_NODE * node
)
function pt_product_sets
static int pt_product_sets (
PARSER_CONTEXT * parser,
TP_DOMAIN * domain,
DB_VALUE * set1,
DB_VALUE * set2,
DB_VALUE * result,
PT_NODE * o2
)
function pt_propagate_types
static PT_NODE * pt_propagate_types (
PARSER_CONTEXT * parser,
PT_NODE * expr,
PT_NODE * otype1,
PT_NODE * otype2
)
function pt_select_list_to_enumeration_expr
static PT_NODE * pt_select_list_to_enumeration_expr (
PARSER_CONTEXT * parser,
PT_NODE * data_type,
PT_NODE * node
)
function pt_set_default_data_type
static int pt_set_default_data_type (
PARSER_CONTEXT * parser,
PT_TYPE_ENUM type,
PT_NODE ** dtp
)
function pt_set_expr_removable_flag
static PT_NODE * pt_set_expr_removable_flag (
PARSER_CONTEXT * parser,
PT_NODE * expr,
void * arg,
int * continue_walk
)
function pt_set_flag_do_not_fold_for_dblink
static PT_NODE * pt_set_flag_do_not_fold_for_dblink (
PARSER_CONTEXT * parser,
PT_NODE * expr,
void * arg,
int * continue_walk
)
function pt_to_false_subquery
static PT_NODE * pt_to_false_subquery (
PARSER_CONTEXT * parser,
PT_NODE * node
)
function pt_union_sets
static int pt_union_sets (
PARSER_CONTEXT * parser,
TP_DOMAIN * domain,
DB_VALUE * set1,
DB_VALUE * set2,
DB_VALUE * result,
PT_NODE * o2
)
function pt_upd_domain_info
static int pt_upd_domain_info (
PARSER_CONTEXT * parser,
PT_NODE * arg1,
PT_NODE * arg2,
PT_OP_TYPE op,
PT_TYPE_ENUM common_type,
PT_NODE * node
)
function pt_update_host_var_data_type
static void pt_update_host_var_data_type (
PARSER_CONTEXT * parser,
PT_NODE * hv_node
)
function pt_wrap_expr_w_exp_dom_cast
static PT_NODE * pt_wrap_expr_w_exp_dom_cast (
PARSER_CONTEXT * parser,
PT_NODE * expr
)
function pt_wrap_logical_arglist_with_integer
static int pt_wrap_logical_arglist_with_integer (
PARSER_CONTEXT * parser,
PT_NODE * node,
PT_NODE * arg_list
)
function pt_wrap_type_for_collation
static PT_TYPE_ENUM pt_wrap_type_for_collation (
const PT_NODE * arg1,
const PT_NODE * arg2,
const PT_NODE * arg3,
PT_TYPE_ENUM * wrap_type_collection
)
Macro Definition Documentation
define COMPARE_BETWEEN_OPERATOR_COUNT
#define COMPARE_BETWEEN_OPERATOR_COUNT `sizeof ( pt_Compare_between_operator_table ) / \ sizeof ( COMPARE_BETWEEN_OPERATOR )`
define MAX_OVERLOADS
#define MAX_OVERLOADS `16`
define MORE_COERCIBLE
#define MORE_COERCIBLE (
arg1_coll_infer,
arg2_coll_infer
) `/* multi line expression */`
define PT_ARE_COMPARABLE
#define PT_ARE_COMPARABLE (
typ1,
typ2
) `(( typ1 == typ2 ) || PT_ARE_COMPARABLE_CHAR_TYPE ( typ1 , typ2 ) || PT_ARE_COMPARABLE_NUMERIC_TYPE ( typ1 , typ2 ))`
define PT_ARE_COMPARABLE_CHAR_TYPE
#define PT_ARE_COMPARABLE_CHAR_TYPE (
typ1,
typ2
) `( PT_IS_SIMPLE_CHAR_STRING_TYPE ( typ1 ) && PT_IS_SIMPLE_CHAR_STRING_TYPE ( typ2 ))`
define PT_ARE_COMPARABLE_NO_CHAR
#define PT_ARE_COMPARABLE_NO_CHAR (
typ1,
typ2
) `(( typ1 == typ2 ) || PT_ARE_COMPARABLE_NUMERIC_TYPE ( typ1 , typ2 ))`
define PT_ARE_COMPARABLE_NUMERIC_TYPE
#define PT_ARE_COMPARABLE_NUMERIC_TYPE (
typ1,
typ2
) `/* multi line expression */`
define PT_COLL_WRAP_TYPE_FOR_MAYBE
#define PT_COLL_WRAP_TYPE_FOR_MAYBE (
type
) `(( PT_IS_CHAR_STRING_TYPE (type)) ? (type) : PT_TYPE_VARCHAR )`
define PT_IS_LEFT_RECURSIVE_EXPRESSION
#define PT_IS_LEFT_RECURSIVE_EXPRESSION (
node
) `((node)->info.expr.op == PT_GREATEST || (node)->info.expr.op == PT_LEAST || (node)->info.expr.op == PT_COALESCE )`
define PT_IS_RECURSIVE_EXPRESSION
#define PT_IS_RECURSIVE_EXPRESSION (
node
) `((node)->node_type == PT_EXPR && ( PT_IS_LEFT_RECURSIVE_EXPRESSION (node) || PT_IS_RIGHT_RECURSIVE_EXPRESSION (node)))`
define PT_IS_RIGHT_RECURSIVE_EXPRESSION
#define PT_IS_RIGHT_RECURSIVE_EXPRESSION (
node
) `((node)->info.expr.op == PT_CASE || (node)->info.expr.op == PT_DECODE )`
define PT_NODE_IS_SESSION_VARIABLE
#define PT_NODE_IS_SESSION_VARIABLE (
node
) `/* multi line expression */`
define SET_EXPECTED_DOMAIN
#define SET_EXPECTED_DOMAIN (
node,
dom
) `/* multi line expression */`
The documentation for this class was generated from the following file cubrid/src/parser/type_checking.c