CUBRID Engine  latest
method_transform.c File Reference
#include "config.h"
#include "authenticate.h"
#include "porting.h"
#include "error_manager.h"
#include "parser.h"
#include "parser_message.h"
#include "view_transform.h"
#include "dbtype.h"
Include dependency graph for method_transform.c:

Go to the source code of this file.

Classes

struct  meth_lambda
 
struct  meth_stmt_info
 
struct  meth_corr_info
 
struct  meth_info
 
struct  meth_info1
 
struct  meth_info2
 
struct  meth_info3
 
struct  meth_info4
 
struct  meth_info5
 
struct  meth_info6
 
struct  meth_info7
 

Typedefs

typedef struct meth_lambda METH_LAMBDA
 
typedef struct meth_stmt_info METH_STMT_INFO
 
typedef struct meth_corr_info METH_CORR_INFO
 
typedef struct meth_info METH_INFO
 
typedef struct meth_info1 METH_INFO1
 
typedef struct meth_info2 METH_INFO2
 
typedef struct meth_info3 METH_INFO3
 
typedef struct meth_info4 METH_INFO4
 
typedef struct meth_info5 METH_INFO5
 
typedef struct meth_info6 METH_INFO6
 
typedef struct meth_info7 METH_INFO7
 

Functions

static PT_NODEmeth_translate_helper (PARSER_CONTEXT *parser, PT_NODE *node)
 
static PT_NODEmeth_translate_local (PARSER_CONTEXT *parser, PT_NODE *statement, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_create_method_list (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_translate_select (PARSER_CONTEXT *parser, PT_NODE *select_statement, PT_NODE *root)
 
static PT_NODEmeth_translate_spec (PARSER_CONTEXT *parser, PT_NODE *spec, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_collapse_nodes (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_get_method_params (PARSER_CONTEXT *parser, UINTPTR spec_id, PT_NODE *method_list, int *num)
 
static PT_NODEmeth_make_unique_range_var (PARSER_CONTEXT *parser, PT_NODE *spec)
 
static PT_NODEmeth_gen_as_attr_list (PARSER_CONTEXT *parser, PT_NODE *range_var, UINTPTR spec_id, PT_NODE *attr_list)
 
static void meth_replace_method_params (PARSER_CONTEXT *parser, UINTPTR spec_id, PT_NODE *method_list, PT_NODE *as_attr_list)
 
static void meth_replace_method_calls (PARSER_CONTEXT *parser, PT_NODE *root, PT_NODE *method_list, PT_NODE *as_attr_list, PT_NODE *new_spec, int num_methods)
 
static PT_NODEmeth_replace_call (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static void meth_replace_referenced_attrs (PARSER_CONTEXT *parser, PT_NODE *root, PT_NODE *attr_list, PT_NODE *as_attr_list, int num)
 
static PT_NODEmeth_find_last_entity (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_find_last_entity_post (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_match_entity (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_find_outside_refs (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static void meth_bump_correlation_level (PARSER_CONTEXT *parser, PT_NODE *node, int increment, int threshold, UINTPTR spec_id)
 
static PT_NODEmeth_bump_corr_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_bump_corr_post (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_find_merge (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_is_method (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_method_path_entities (PARSER_CONTEXT *parser, PT_NODE *paths)
 
static PT_NODEmeth_non_method_path_entities (PARSER_CONTEXT *parser, PT_NODE *paths)
 
static PT_NODEmeth_find_entity (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_find_method (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_find_outside_refs_subquery (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmeth_push_conjuncts (PARSER_CONTEXT *parser, UINTPTR spec_id, PT_NODE **where)
 
static PT_NODEmeth_grab_conj (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static void meth_grab_cnf_conj (PARSER_CONTEXT *parser, PT_NODE **where, METH_INFO5 *info5)
 
static PT_NODEmeth_add_conj (PARSER_CONTEXT *parser, PT_NODE *where, PT_NODE *new_conj)
 
static PT_NODEmeth_replace_id_in_method_names (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static int meth_refs_to_scope (PARSER_CONTEXT *parser, PT_NODE *scope, PT_NODE *tree)
 
static PT_NODEmeth_have_methods (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEmeth_find_hierarchical_op (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static void meth_find_hierarchical_in_method_list (PARSER_CONTEXT *parser, PT_NODE *method_list, bool *has_hierarchical_expr)
 
static void meth_copy_hierarchical_expr_to_list (PARSER_CONTEXT *parser, PT_NODE *src_list, PT_NODE **dst_list_p, int *copy_count)
 
static void meth_move_hierarchical_to_derived (PARSER_CONTEXT *parser, PT_SELECT_INFO *statement_info, PT_SELECT_INFO *derived_info)
 
static void meth_replace_hierarchical_exprs (PARSER_CONTEXT *parser, PT_NODE **select_list_p, PT_NODE *ref_attrs, int num_methods)
 
int pt_statement_have_methods (PARSER_CONTEXT *parser, PT_NODE *statement)
 
PT_NODEmeth_translate (PARSER_CONTEXT *parser, PT_NODE *volatile node)
 

Variables

static int meth_table_number = 0
 
static int meth_attr_number = 0
 

Typedef Documentation

Definition at line 50 of file method_transform.c.

typedef struct meth_info METH_INFO

Definition at line 58 of file method_transform.c.

typedef struct meth_info1 METH_INFO1

Definition at line 67 of file method_transform.c.

typedef struct meth_info2 METH_INFO2

Definition at line 74 of file method_transform.c.

typedef struct meth_info3 METH_INFO3

Definition at line 81 of file method_transform.c.

typedef struct meth_info4 METH_INFO4

Definition at line 88 of file method_transform.c.

typedef struct meth_info5 METH_INFO5

Definition at line 96 of file method_transform.c.

typedef struct meth_info6 METH_INFO6

Definition at line 103 of file method_transform.c.

typedef struct meth_info7 METH_INFO7

Definition at line 110 of file method_transform.c.

typedef struct meth_lambda METH_LAMBDA

Definition at line 35 of file method_transform.c.

Definition at line 43 of file method_transform.c.

Function Documentation

static PT_NODE * meth_add_conj ( PARSER_CONTEXT parser,
PT_NODE where,
PT_NODE new_conj 
)
static
static PT_NODE * meth_bump_corr_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 1770 of file method_transform.c.

References meth_corr_info::corr_threshold, parser_node::node_type, and PT_IS_QUERY_NODE_TYPE.

Referenced by meth_bump_correlation_level().

Here is the caller graph for this function:

static void meth_bump_correlation_level ( PARSER_CONTEXT parser,
PT_NODE node,
int  increment,
int  threshold,
UINTPTR  spec_id 
)
static
static void meth_copy_hierarchical_expr_to_list ( PARSER_CONTEXT parser,
PT_NODE src_list,
PT_NODE **  dst_list_p,
int *  copy_count 
)
static

Definition at line 2390 of file method_transform.c.

References meth_find_hierarchical_op(), parser_node::next, NULL, parser_append_node(), parser_copy_tree(), and parser_walk_tree().

Referenced by meth_translate_spec().

Here is the caller graph for this function:

static PT_NODE * meth_find_entity ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 1903 of file method_transform.c.

References meth_info3::entity, meth_info3::id, pt_spec_info::id, parser_node::info, parser_node::node_type, PT_SPEC, and pt_statement_info::spec.

Referenced by meth_create_method_list().

Here is the caller graph for this function:

static void meth_find_hierarchical_in_method_list ( PARSER_CONTEXT parser,
PT_NODE method_list,
bool has_hierarchical_expr 
)
static
static PT_NODE * meth_find_hierarchical_op ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static
static PT_NODE * meth_find_last_entity_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 1475 of file method_transform.c.

References meth_info::nesting_depth, parser_node::node_type, and PT_SELECT.

Referenced by meth_create_method_list().

Here is the caller graph for this function:

static PT_NODE * meth_find_merge ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * meth_find_method ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * meth_get_method_params ( PARSER_CONTEXT parser,
UINTPTR  spec_id,
PT_NODE method_list,
int *  num 
)
static
static void meth_grab_cnf_conj ( PARSER_CONTEXT parser,
PT_NODE **  where,
METH_INFO5 info5 
)
static
static PT_NODE * meth_have_methods ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static

Definition at line 182 of file method_transform.c.

References parser_node::node_type, PT_CONTINUE_WALK, PT_METHOD_CALL, and PT_STOP_WALK.

Referenced by pt_statement_have_methods().

Here is the caller graph for this function:

static PT_NODE * meth_is_method ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * meth_make_unique_range_var ( PARSER_CONTEXT parser,
PT_NODE spec 
)
static
static PT_NODE * meth_match_entity ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * meth_method_path_entities ( PARSER_CONTEXT parser,
PT_NODE paths 
)
static

Definition at line 1846 of file method_transform.c.

References pt_spec_info::flavor, parser_node::info, parser_node::next, NULL, parser_append_node(), parser_copy_tree(), PT_METHOD_ENTITY, and pt_statement_info::spec.

Referenced by meth_translate_spec().

Here is the caller graph for this function:

static void meth_move_hierarchical_to_derived ( PARSER_CONTEXT parser,
PT_SELECT_INFO statement_info,
PT_SELECT_INFO derived_info 
)
static
static PT_NODE * meth_non_method_path_entities ( PARSER_CONTEXT parser,
PT_NODE paths 
)
static

Definition at line 1875 of file method_transform.c.

References pt_spec_info::flavor, parser_node::info, parser_node::next, NULL, parser_append_node(), parser_copy_tree(), PT_METHOD_ENTITY, and pt_statement_info::spec.

Referenced by meth_translate_spec().

Here is the caller graph for this function:

static int meth_refs_to_scope ( PARSER_CONTEXT parser,
PT_NODE scope,
PT_NODE tree 
)
static
static void meth_replace_hierarchical_exprs ( PARSER_CONTEXT parser,
PT_NODE **  select_list_p,
PT_NODE ref_attrs,
int  num_methods 
)
static

Definition at line 2466 of file method_transform.c.

References i, meth_find_hierarchical_op(), parser_node::next, NULL, parser_copy_tree(), parser_free_tree(), and parser_walk_tree().

Referenced by meth_translate_spec().

Here is the caller graph for this function:

static PT_NODE * meth_replace_id_in_method_names ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static void meth_replace_method_calls ( PARSER_CONTEXT parser,
PT_NODE root,
PT_NODE method_list,
PT_NODE as_attr_list,
PT_NODE new_spec,
int  num_methods 
)
static
static void meth_replace_method_params ( PARSER_CONTEXT parser,
UINTPTR  spec_id,
PT_NODE method_list,
PT_NODE as_attr_list 
)
static
static void meth_replace_referenced_attrs ( PARSER_CONTEXT parser,
PT_NODE root,
PT_NODE attr_list,
PT_NODE as_attr_list,
int  num 
)
static

Definition at line 1366 of file method_transform.c.

References parser_node::next, parser_node::node_type, NULL, PT_INTERNAL_ERROR, pt_lambda(), pt_length_of_list(), and PT_NAME.

Referenced by meth_collapse_nodes(), and meth_translate_spec().

Here is the caller graph for this function:

PT_NODE* meth_translate ( PARSER_CONTEXT parser,
PT_NODE *volatile  node 
)

Definition at line 225 of file method_transform.c.

References meth_find_merge(), meth_translate_helper(), parser_node::next, NULL, parser_walk_tree(), PT_CLEAR_JMP_ENV, pt_do_cnf(), pt_has_error, and PT_SET_JMP_ENV.

Referenced by parser_generate_xasl().

Here is the caller graph for this function:

static PT_NODE * meth_translate_local ( PARSER_CONTEXT parser,
PT_NODE statement,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 408 of file method_transform.c.

References parser_node::column_number, parser_node::line_number, meth_translate_select(), parser_node::node_type, NULL, pt_has_error, PT_SELECT, and PT_STOP_WALK.

Referenced by meth_translate_helper().

Here is the caller graph for this function:

static PT_NODE * meth_translate_select ( PARSER_CONTEXT parser,
PT_NODE select_statement,
PT_NODE root 
)
static
static PT_NODE * meth_translate_spec ( PARSER_CONTEXT parser,
PT_NODE spec,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 580 of file method_transform.c.

References pt_method_call_info::arg_list, pt_spec_info::as_attr_list, pt_query_info::correlation_level, parser_node::data_type, db_make_int(), pt_spec_info::derived_table, pt_spec_info::derived_table_type, F_SEQUENCE, pt_select_info::flavor, meth_info1::found, meth_info4::found, pt_select_info::from, i, meth_info1::id, meth_info4::id, pt_spec_info::id, parser_node::info, pt_query_info::is_subquery, pt_spec_info::join_type, pt_select_info::list, pt_spec_info::location, pt_spec_info::meta_class, meth_bump_correlation_level(), meth_copy_hierarchical_expr_to_list(), meth_find_hierarchical_in_method_list(), meth_find_outside_refs(), meth_find_outside_refs_subquery(), meth_gen_as_attr_list(), meth_get_method_params(), meth_make_unique_range_var(), meth_method_path_entities(), meth_move_hierarchical_to_derived(), meth_non_method_path_entities(), meth_push_conjuncts(), meth_refs_to_scope(), meth_replace_hierarchical_exprs(), meth_replace_id_in_method_names(), meth_replace_method_calls(), meth_replace_method_params(), meth_replace_referenced_attrs(), pt_statement_info::method_call, pt_spec_info::method_list, mq_get_references(), mq_reset_paths(), MSGCAT_SEMANTIC_METH_CORR_SET_EXPR, MSGCAT_SET_PARSER_SEMANTIC, pt_statement_info::name, meth_info6::new_id, meth_lambda::new_spec, parser_node::next, parser_node::node_type, NULL, meth_info6::old_id, pt_method_call_info::on_call_target, pt_spec_info::on_cond, parser_append_node(), parser_copy_tree(), parser_copy_tree_list(), parser_free_tree(), parser_new_node(), parser_walk_leaves(), parser_walk_tree(), pt_spec_info::path_entities, PT_CLASS, pt_dbval_to_value(), PT_ERRORm, PT_FUNCTION, PT_INTERNAL_ERROR, PT_IS_CSELECT, PT_IS_SET_EXPR, PT_IS_SUBQUERY, PT_JOIN_NONE, pt_length_of_list(), PT_LIST_WALK, PT_MERGE_SELECT, PT_SELECT, PT_SPEC, PT_STOP_WALK, PT_TYPE_SEQUENCE, PT_USER_SELECT, pt_query_info::q, pt_statement_info::query, pt_spec_info::range_var, pt_spec_info::referenced_attrs, pt_name_info::resolved, meth_stmt_info::root, pt_query_info::select, meth_stmt_info::select_statement, pt_statement_info::spec, meth_info4::spec_list, parser_node::type_enum, and pt_select_info::where.

Referenced by meth_translate_select().

Here is the caller graph for this function:

int pt_statement_have_methods ( PARSER_CONTEXT parser,
PT_NODE statement 
)

Definition at line 204 of file method_transform.c.

References meth_have_methods(), NULL, and parser_walk_tree().

Variable Documentation

int meth_attr_number = 0
static

Definition at line 119 of file method_transform.c.

Referenced by meth_gen_as_attr_list().

int meth_table_number = 0
static

Definition at line 118 of file method_transform.c.

Referenced by meth_make_unique_range_var().