CUBRID Engine  latest
view_transform.c File Reference
#include <assert.h>
#include "authenticate.h"
#include "view_transform.h"
#include "parser.h"
#include "parser_message.h"
#include "schema_manager.h"
#include "semantic_check.h"
#include "optimizer.h"
#include "execute_schema.h"
#include "dbi.h"
#include "object_accessor.h"
#include "object_primitive.h"
#include "locator_cl.h"
#include "virtual_object.h"
#include "dbtype.h"
Include dependency graph for view_transform.c:

Go to the source code of this file.

Classes

struct  find_id_info
 
struct  mq_bump_core_info
 
struct  PT_RESOLVE_METHOD_NAME_INFO
 
struct  check_pushable_info
 
struct  path_lambda_info
 
struct  exists_info
 
struct  pt_reset_select_spec_info
 
struct  replace_name_info
 
struct  spec_reset_info
 
struct  extra_specs_frame
 
struct  mq_lambda_arg
 
struct  set_names_info
 

Macros

#define MAX_STACK_OBJECTS   500
 
#define PT_PUSHABLE_TERM(p)   ((p)->out.pushable && (p)->out.correlated_found == false)
 
#define MAX_CYCLE   300
 
#define MQ_IS_OUTER_JOIN_SPEC(s)
 

Typedefs

typedef struct find_id_info FIND_ID_INFO
 
typedef struct mq_bump_core_info MQ_BUMP_CORR_INFO
 
typedef struct check_pushable_info CHECK_PUSHABLE_INFO
 
typedef struct path_lambda_info PATH_LAMBDA_INFO
 
typedef struct exists_info EXISTS_INFO
 
typedef struct pt_reset_select_spec_info PT_RESET_SELECT_SPEC_INFO
 
typedef struct replace_name_info REPLACE_NAME_INFO
 
typedef struct spec_reset_info SPEC_RESET_INFO
 
typedef struct extra_specs_frame PT_EXTRA_SPECS_FRAME
 
typedef struct mq_lambda_arg MQ_LAMBDA_ARG
 
typedef struct set_names_info SET_NAMES_INFO
 

Enumerations

enum  FIND_ID_TYPE { FIND_ID_INLINE_VIEW = 0, FIND_ID_VCLASS }
 

Functions

static PT_NODEmq_bump_corr_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_bump_corr_post (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_union_bump_correlation (PARSER_CONTEXT *parser, PT_NODE *left, PT_NODE *right)
 
static DB_AUTH mq_compute_authorization (DB_OBJECT *class_object)
 
static DB_AUTH mq_compute_query_authorization (PT_NODE *statement)
 
static void mq_set_union_query (PARSER_CONTEXT *parser, PT_NODE *statement, PT_MISC_TYPE is_union)
 
static PT_NODEmq_flatten_union (PARSER_CONTEXT *parser, PT_NODE *statement)
 
static PT_NODEmq_rewrite_agg_names (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_rewrite_agg_names_post (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static bool mq_conditionally_add_objects (PARSER_CONTEXT *parser, PT_NODE *flat, DB_OBJECT ***classes, int *index, int *max)
 
static PT_UPDATABILITY mq_updatable_local (PARSER_CONTEXT *parser, PT_NODE *statement, DB_OBJECT ***classes, int *i, int *max)
 
static PT_NODEmq_substitute_select_in_statement (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *query_spec, PT_NODE *class_)
 
static PT_NODEmq_substitute_spec_in_method_names (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_substitute_subquery_in_statement (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *query_spec, PT_NODE *class_, PT_NODE *order_by, int what_for)
 
static PT_NODEmq_substitute_subquery_list_in_statement (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *query_spec_list, PT_NODE *class_, PT_NODE *order_by, int what_for)
 
static int mq_translatable_class (PARSER_CONTEXT *parser, PT_NODE *class_)
 
static int mq_is_union_translation (PARSER_CONTEXT *parser, PT_NODE *spec)
 
static int mq_check_authorization_path_entities (PARSER_CONTEXT *parser, PT_NODE *class_spec, int what_for)
 
static int mq_check_subqueries_for_prepare (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *subquery)
 
static PT_NODEmq_translate_tree (PARSER_CONTEXT *parser, PT_NODE *tree, PT_NODE *spec_list, PT_NODE *order_by, int what_for)
 
static PT_NODEmq_class_meth_corr_subq_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static bool mq_has_class_methods_corr_subqueries (PARSER_CONTEXT *parser, PT_NODE *node)
 
static PT_NODEpt_check_pushable (PARSER_CONTEXT *parser, PT_NODE *tree, void *arg, int *continue_walk)
 
static bool pt_pushable_query_in_pos (PARSER_CONTEXT *parser, PT_NODE *query, int pos)
 
static PT_NODEpt_find_only_name_id (PARSER_CONTEXT *parser, PT_NODE *tree, void *arg, int *continue_walk)
 
static bool pt_sargable_term (PARSER_CONTEXT *parser, PT_NODE *term, FIND_ID_INFO *infop)
 
static bool mq_is_pushable_subquery (PARSER_CONTEXT *parser, PT_NODE *query, bool is_only_spec)
 
static int pt_check_copypush_subquery (PARSER_CONTEXT *parser, PT_NODE *query)
 
static void pt_copypush_terms (PARSER_CONTEXT *parser, PT_NODE *spec, PT_NODE *query, PT_NODE *term_list, FIND_ID_TYPE type)
 
static int mq_copypush_sargable_terms_helper (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec, PT_NODE *new_query, FIND_ID_INFO *infop)
 
static int mq_copypush_sargable_terms (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
static PT_NODEmq_rewrite_vclass_spec_as_derived (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec, PT_NODE *query_spec)
 
static PT_NODEmq_translate_select (PARSER_CONTEXT *parser, PT_NODE *select_statement)
 
static void mq_check_update (PARSER_CONTEXT *parser, PT_NODE *update_statement)
 
static void mq_check_delete (PARSER_CONTEXT *parser, PT_NODE *delete_stmt)
 
static PT_NODEmq_translate_update (PARSER_CONTEXT *parser, PT_NODE *update_statement)
 
static PT_NODEmq_resolve_insert_statement (PARSER_CONTEXT *parser, PT_NODE *insert_statement)
 
static PT_NODEmq_translate_insert (PARSER_CONTEXT *parser, PT_NODE *insert_statement)
 
static PT_NODEmq_translate_delete (PARSER_CONTEXT *parser, PT_NODE *delete_statement)
 
static void mq_check_merge (PARSER_CONTEXT *parser, PT_NODE *merge_statement)
 
static PT_NODEmq_translate_merge (PARSER_CONTEXT *parser, PT_NODE *merge_statement)
 
static void mq_push_paths_select (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
static PT_NODEmq_check_rewrite_select (PARSER_CONTEXT *parser, PT_NODE *select_statement)
 
static PT_NODEmq_push_paths (PARSER_CONTEXT *parser, PT_NODE *statement, void *void_arg, int *continue_walk)
 
static PT_NODEmq_translate_local (PARSER_CONTEXT *parser, PT_NODE *statement, void *void_arg, int *continue_walk)
 
static int mq_check_using_index (PARSER_CONTEXT *parser, PT_NODE *using_index)
 
static PT_NODEmq_set_types (PARSER_CONTEXT *parser, PT_NODE *query_spec, PT_NODE *attributes, DB_OBJECT *vclass_object, int cascaded_check)
 
static PT_NODEmq_translate_subqueries (PARSER_CONTEXT *parser, DB_OBJECT *class_object, PT_NODE *attributes, DB_AUTH *authorization)
 
static void mq_invert_assign (PARSER_CONTEXT *parser, PT_NODE *attr, PT_NODE *&expr, PT_NODE *inverted)
 
static void mq_invert_subqueries (PARSER_CONTEXT *parser, PT_NODE *select_statements, PT_NODE *attributes)
 
static void mq_set_non_updatable_oid (PARSER_CONTEXT *parser, PT_NODE *stmt, PT_NODE *virt_entity)
 
static bool mq_check_cycle (DB_OBJECT *class_object)
 
static PT_NODEmq_mark_location (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEmq_check_non_updatable_vclass_oid (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static bool mq_check_vclass_for_insert (PARSER_CONTEXT *parser, PT_NODE *stmt)
 
static PT_NODEmq_rewrite_upd_del_top_level_specs (PARSER_CONTEXT *parser, PT_NODE *statement, void *void_arg, int *continue_walk)
 
static PT_NODEmq_translate_helper (PARSER_CONTEXT *parser, PT_NODE *node)
 
static PT_NODEmq_lookup_symbol (PARSER_CONTEXT *parser, PT_NODE *attr_list, PT_NODE *attr)
 
static PT_NODEmq_coerce_resolved (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_set_all_ids (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_reset_all_ids (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_clear_all_ids (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_clear_other_ids (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_reset_spec_ids (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_reset_spec_in_method_names (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_get_references_node (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_referenced_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_referenced_post (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static int mq_is_referenced (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
static PT_NODEmq_set_references_local (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
static PT_NODEmq_reset_select_spec_node (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_reset_select_specs (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_new_spec (PARSER_CONTEXT *parser, const char *class_name)
 
static PT_NODEmq_replace_name_with_path (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_substitute_path (PARSER_CONTEXT *parser, PT_NODE *node, PATH_LAMBDA_INFO *path_info)
 
static PT_NODEmq_substitute_path_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_path_name_lambda (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *lambda_name, PT_NODE *lambda_expr, UINTPTR spec_id)
 
static PT_NODEmq_reset_spec_distr_subpath_pre (PARSER_CONTEXT *parser, PT_NODE *spec, void *void_arg, int *continue_walk)
 
static PT_NODEmq_reset_spec_distr_subpath_post (PARSER_CONTEXT *parser, PT_NODE *spec, void *void_arg, int *continue_walk)
 
static PT_NODEmq_translate_paths (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *root_spec)
 
static void mq_invert_insert_select (PARSER_CONTEXT *parser, PT_NODE *attr, PT_NODE *subquery)
 
static void mq_invert_insert_subquery (PARSER_CONTEXT *parser, PT_NODE **attr, PT_NODE *subquery)
 
static PT_NODEmq_push_arg2 (PARSER_CONTEXT *parser, PT_NODE *query, PT_NODE *dot_arg2)
 
static PT_NODEmq_lambda_node_pre (PARSER_CONTEXT *parser, PT_NODE *tree, void *void_arg, int *continue_walk)
 
static PT_NODEmq_lambda_node (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_set_virt_object (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_fix_derived (PARSER_CONTEXT *parser, PT_NODE *select_statement, PT_NODE *spec)
 
static PT_NODEmq_translate_value (PARSER_CONTEXT *parser, PT_NODE *value)
 
static void mq_push_dot_in_query (PARSER_CONTEXT *parser, PT_NODE *query, int i, PT_NODE *name)
 
static PT_NODEmq_clean_dot (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static PT_NODEmq_fetch_subqueries_for_update_local (PARSER_CONTEXT *parser, PT_NODE *class_, PT_FETCH_AS fetch_as, DB_AUTH what_for, PARSER_CONTEXT **qry_cache)
 
static PT_NODEmq_fetch_select_for_real_class_update (PARSER_CONTEXT *parser, PT_NODE *vclass, PT_NODE *real_class, PT_FETCH_AS fetch_as, DB_AUTH what_for)
 
static PT_NODEmq_fetch_expression_for_real_class_update (PARSER_CONTEXT *parser, DB_OBJECT *vclass_obj, PT_NODE *attr, PT_NODE *real_class, PT_FETCH_AS fetch_as, DB_AUTH what_for, UINTPTR *spec_id)
 
static PT_NODEmq_set_names_dbobject (PARSER_CONTEXT *parser, PT_NODE *node, void *void_arg, int *continue_walk)
 
static bool mq_is_updatable_local (DB_OBJECT *class_object, PT_FETCH_AS fetch_as)
 
static PT_NODEmq_fetch_one_real_class_get_cache (DB_OBJECT *vclass_object, PARSER_CONTEXT **query_cache)
 
static PT_NODEmq_reset_specs_from_column (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *column)
 
static PT_NODEmq_path_spec_lambda (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *root_spec, PT_NODE **prev_ptr, PT_NODE *old_spec, PT_NODE *new_spec)
 
static PT_NODEmq_generate_unique (PARSER_CONTEXT *parser, PT_NODE *name_list)
 
PT_NODEmq_fetch_attributes (PARSER_CONTEXT *parser, PT_NODE *class_)
 
PT_NODEmq_lambda (PARSER_CONTEXT *parser, PT_NODE *tree_with_names, PT_NODE *name_node, PT_NODE *corresponding_tree)
 
PT_NODEmq_class_lambda (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *class_, PT_NODE *corresponding_spec, PT_NODE *class_where_part, PT_NODE *class_check_part, PT_NODE *class_group_by_part, PT_NODE *class_having_part)
 
static PT_NODEmq_fix_derived_in_union (PARSER_CONTEXT *parser, PT_NODE *statement, UINTPTR spec_id)
 
static PT_NODEmq_fetch_subqueries (PARSER_CONTEXT *parser, PT_NODE *class_)
 
static PT_NODEmq_fetch_subqueries_for_update (PARSER_CONTEXT *parser, PT_NODE *class_, PT_FETCH_AS fetch_as, DB_AUTH what_for)
 
static PT_NODEmq_rename_resolved (PARSER_CONTEXT *parser, PT_NODE *spec, PT_NODE *statement, const char *newname)
 
static PT_NODEmq_reset_ids_and_references (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
static PT_NODEmq_reset_ids_and_references_helper (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec, bool get_spec_referenced_attr)
 
static PT_NODEmq_push_path (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec, PT_NODE *path)
 
static PT_NODEmq_derived_path (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *path)
 
static void mq_insert_symbol (PARSER_CONTEXT *parser, PT_NODE **listhead, PT_NODE *attr)
 
static const char * get_authorization_name (DB_AUTH auth)
 
static PT_NODEmq_add_dummy_from_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEmq_update_order_by (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *query_spec, PT_NODE *class_)
 
static bool mq_is_order_dependent_node (PT_NODE *node)
 
static bool mq_mark_order_dependent_nodes (PT_NODE *node)
 
static PT_NODEmq_rewrite_order_dependent_nodes (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *select, int *unique)
 
static PT_NODEmq_rewrite_order_dependent_query (PARSER_CONTEXT *parser, PT_NODE *select, int *unique)
 
static PT_NODEmq_bump_order_dep_corr_lvl_pre (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static PT_NODEmq_bump_order_dep_corr_lvl_post (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static void mq_bump_order_dep_corr_lvl (PARSER_CONTEXT *parser, PT_NODE *node)
 
static PT_NODEmq_reset_references_to_query_string (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static void mq_auto_param_merge_clauses (PARSER_CONTEXT *parser, PT_NODE *stmt)
 
static PT_NODEpt_check_for_update_subquery (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static int pt_check_for_update_clause (PARSER_CONTEXT *parser, PT_NODE *query, bool root)
 
static int pt_for_update_prepare_query_internal (PARSER_CONTEXT *parser, PT_NODE *query)
 
static int pt_for_update_prepare_query (PARSER_CONTEXT *parser, PT_NODE *query)
 
static PT_NODEmq_replace_virtual_oid_with_real_oid (PARSER_CONTEXT *parser, PT_NODE *node, void *arg, int *continue_walk)
 
static void mq_copy_view_error_msgs (PARSER_CONTEXT *parser, PARSER_CONTEXT *query_cache)
 
bool mq_is_outer_join_spec (PARSER_CONTEXT *parser, PT_NODE *spec)
 
PT_NODEmq_bump_correlation_level (PARSER_CONTEXT *parser, PT_NODE *node, int increment, int match)
 
PT_UPDATABILITY mq_updatable (PARSER_CONTEXT *parser, PT_NODE *statement)
 
PT_NODEmq_rewrite_query_as_derived (PARSER_CONTEXT *parser, PT_NODE *query)
 
PT_NODEmq_rewrite_aggregate_as_derived (PARSER_CONTEXT *parser, PT_NODE *agg_sel)
 
void mq_free_virtual_query_cache (PARSER_CONTEXT *parser)
 
PARSER_CONTEXTmq_virtual_queries (DB_OBJECT *class_object)
 
PT_NODEmq_translate (PARSER_CONTEXT *parser, PT_NODE *volatile node)
 
const char * mq_generate_name (PARSER_CONTEXT *parser, const char *root, int *version)
 
PT_NODEmq_reset_ids (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
PT_NODEmq_clear_ids (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *spec)
 
PT_NODEmq_reset_ids_in_statement (PARSER_CONTEXT *parser, PT_NODE *statement)
 
PT_NODEmq_reset_ids_in_methods (PARSER_CONTEXT *parser, PT_NODE *statement)
 
PT_NODEmq_get_references (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
PT_NODEmq_get_references_helper (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec, bool get_spec_referenced_attr)
 
PT_NODEmq_reset_paths (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *root_spec)
 
PT_NODEmq_set_references (PARSER_CONTEXT *parser, PT_NODE *statement, PT_NODE *spec)
 
PT_NODEmq_regenerate_if_ambiguous (PARSER_CONTEXT *parser, PT_NODE *spec, PT_NODE *statement, PT_NODE *from)
 
PT_NODEmq_make_derived_spec (PARSER_CONTEXT *parser, PT_NODE *node, PT_NODE *subquery, int *idx, PT_NODE **spec_ptr, PT_NODE **attr_list_ptr)
 
bool mq_is_updatable (DB_OBJECT *class_object)
 
bool mq_is_updatable_strict (DB_OBJECT *class_object)
 
bool mq_is_updatable_att (PARSER_CONTEXT *parser, DB_OBJECT *vmop, const char *att_nam, DB_OBJECT *rmop)
 
bool mq_is_updatable_attribute (DB_OBJECT *vclass_object, const char *attr_name, DB_OBJECT *real_class_object)
 
int mq_evaluate_expression (PARSER_CONTEXT *parser, PT_NODE *expr, DB_VALUE *value, DB_OBJECT *object, UINTPTR spec_id)
 
int mq_evaluate_expression_having_serial (PARSER_CONTEXT *parser, PT_NODE *expr, DB_VALUE *values, int values_count, DB_OBJECT *object, UINTPTR spec_id)
 
int mq_get_attribute (DB_OBJECT *vclass_object, const char *attr_name, DB_OBJECT *real_class_object, DB_VALUE *virtual_value, DB_OBJECT *real_instance)
 
PT_NODEmq_oid (PARSER_CONTEXT *parser, PT_NODE *spec)
 
int mq_update_attribute (DB_OBJECT *vclass_object, const char *attr_name, DB_OBJECT *real_class_object, DB_VALUE *virtual_value, DB_VALUE *real_value, const char **real_name, int db_auth)
 
DB_OBJECTmq_fetch_one_real_class (DB_OBJECT *vclass_object)
 
int mq_get_expression (DB_OBJECT *object, const char *expr, DB_VALUE *value)
 
int mq_is_real_class_of_vclass (PARSER_CONTEXT *parser, const PT_NODE *s_class, const PT_NODE *d_class)
 
int mq_evaluate_check_option (PARSER_CONTEXT *parser, PT_NODE *check_where, DB_OBJECT *object, PT_NODE *view_class)
 

Variables

static unsigned int top_cycle = 0
 
static DB_OBJECTcycle_buffer [MAX_CYCLE]
 

Macro Definition Documentation

#define MAX_CYCLE   300

Definition at line 48 of file view_transform.c.

Referenced by mq_check_cycle(), and mq_virtual_queries().

#define MAX_STACK_OBJECTS   500

Definition at line 43 of file view_transform.c.

Referenced by mq_conditionally_add_objects(), and mq_updatable().

#define MQ_IS_OUTER_JOIN_SPEC (   s)
Value:
( \
((s)->info.spec.join_type == PT_JOIN_LEFT_OUTER \
|| (s)->info.spec.join_type == PT_JOIN_RIGHT_OUTER) || \
((s)->next && \
((s)->next->info.spec.join_type == PT_JOIN_LEFT_OUTER \
|| (s)->next->info.spec.join_type == PT_JOIN_RIGHT_OUTER)) \
)

Definition at line 50 of file view_transform.c.

#define PT_PUSHABLE_TERM (   p)    ((p)->out.pushable && (p)->out.correlated_found == false)

Definition at line 45 of file view_transform.c.

Referenced by mq_copypush_sargable_terms_helper().

Typedef Documentation

typedef struct exists_info EXISTS_INFO

Definition at line 121 of file view_transform.c.

typedef struct find_id_info FIND_ID_INFO
typedef struct mq_lambda_arg MQ_LAMBDA_ARG

Definition at line 159 of file view_transform.c.

Definition at line 112 of file view_transform.c.

Definition at line 152 of file view_transform.c.

Definition at line 129 of file view_transform.c.

Definition at line 136 of file view_transform.c.

Definition at line 167 of file view_transform.c.

Definition at line 144 of file view_transform.c.

Enumeration Type Documentation

Enumerator
FIND_ID_INLINE_VIEW 
FIND_ID_VCLASS 

Definition at line 59 of file view_transform.c.

Function Documentation

static PT_NODE * mq_add_dummy_from_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static
static PT_NODE * mq_bump_corr_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 494 of file view_transform.c.

References mq_bump_core_info::match_level, parser_node::node_type, and PT_IS_QUERY_NODE_TYPE.

Referenced by mq_bump_correlation_level().

Here is the caller graph for this function:

static PT_NODE * mq_bump_corr_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
PT_NODE* mq_bump_correlation_level ( PARSER_CONTEXT parser,
PT_NODE node,
int  increment,
int  match 
)
static void mq_bump_order_dep_corr_lvl ( PARSER_CONTEXT parser,
PT_NODE node 
)
static

Definition at line 11717 of file view_transform.c.

References mq_bump_order_dep_corr_lvl_post(), mq_bump_order_dep_corr_lvl_pre(), NULL, and parser_walk_tree().

Referenced by mq_translate_helper().

Here is the caller graph for this function:

static PT_NODE * mq_bump_order_dep_corr_lvl_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static

Definition at line 11676 of file view_transform.c.

References pt_expr_info::arg2, pt_statement_info::expr, parser_node::info, parser_node::next, NULL, parser_free_node(), and PT_IS_QUERY.

Referenced by mq_bump_order_dep_corr_lvl().

Here is the caller graph for this function:

static PT_NODE * mq_bump_order_dep_corr_lvl_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static
static bool mq_check_cycle ( DB_OBJECT class_object)
static

Definition at line 5712 of file view_transform.c.

References i, max, MAX_CYCLE, and top_cycle.

Referenced by mq_virtual_queries().

Here is the caller graph for this function:

static void mq_check_merge ( PARSER_CONTEXT parser,
PT_NODE merge_statement 
)
static

Definition at line 4439 of file view_transform.c.

References pt_no_attr_and_meta_attr_updates(), and pt_no_double_updates().

Referenced by mq_translate_merge().

Here is the caller graph for this function:

static int mq_check_subqueries_for_prepare ( PARSER_CONTEXT parser,
PT_NODE node,
PT_NODE subquery 
)
static

Definition at line 2289 of file view_transform.c.

References parser_node::cannot_prepare, parser_node::flag, and parser_node::next.

Referenced by mq_translate_tree().

Here is the caller graph for this function:

static void mq_check_update ( PARSER_CONTEXT parser,
PT_NODE update_statement 
)
static

Definition at line 3933 of file view_transform.c.

References pt_no_attr_and_meta_attr_updates(), and pt_no_double_updates().

Referenced by mq_translate_update().

Here is the caller graph for this function:

PT_NODE * mq_class_lambda ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE class_,
PT_NODE corresponding_spec,
PT_NODE class_where_part,
PT_NODE class_check_part,
PT_NODE class_group_by_part,
PT_NODE class_having_part 
)

Definition at line 8340 of file view_transform.c.

References parser_node::alias_print, pt_expr_info::arg1, pt_union_info::arg1, pt_expr_info::arg2, pt_union_info::arg2, assert, pt_update_info::assignment, pt_merge_info::assignment, pt_insert_info::attr_list, pt_merge_info::attr_list, pt_statement_info::check_option, pt_select_info::check_where, pt_update_info::check_where, pt_merge_info::check_where, pt_merge_info::class_where, pt_statement_info::delete_, pt_spec_info::derived_table_type, pt_spec_info::entity_name, pt_check_option_info::expr, pt_statement_info::expr, pt_spec_info::flag, pt_query_info::flag, pt_spec_info::flat_entity_list, pt_select_info::from, pt_select_info::group_by, pt_select_info::having, pt_spec_info::id, parser_node::info, pt_merge_info::insert, pt_statement_info::insert, pt_merge_info::into, pt_query_info::is_subquery, pt_spec_info::join_type, pt_node_list_info::list, pt_node_list_info::list_type, pt_spec_info::location, pt_statement_info::merge, mq_invert_insert_subquery(), mq_regenerate_if_ambiguous(), mq_rename_resolved(), mq_reset_paths(), mq_reset_spec_distr_subpath_post(), mq_reset_spec_distr_subpath_pre(), mq_translate_paths(), mq_translate_value(), MSGCAT_RUNTIME_ATTRS_GT_QSPEC_COLS, MSGCAT_RUNTIME_VASG_TGT_UNINVERTBL, MSGCAT_SET_PARSER_RUNTIME, pt_statement_info::name, parser_node::next, pt_statement_info::node_list, parser_node::node_type, NULL, spec_reset_info::old_next, pt_spec_info::on_cond, pt_name_info::original, pt_expr_info::paren_type, parser_append_node(), parser_copy_tree_list(), parser_free_tree(), parser_new_node(), parser_walk_tree(), pt_spec_info::path_entities, pt_append_string(), PT_CHECK_OPTION, PT_DELETE, PT_DERIVED_JSON_TABLE, PT_DIFFERENCE, PT_ERRORm, PT_ERRORmf, PT_EXPR, PT_INSERT, PT_INTERNAL_ERROR, PT_INTERSECTION, pt_invert(), PT_IS_DEFAULT_VALUE, PT_IS_N_COLUMN_UPDATE_EXPR, PT_IS_QUERY_NODE_TYPE, PT_IS_SUBQUERY, PT_IS_VALUE, PT_JOIN_NONE, PT_MERGE, PT_SELECT, PT_SELECT_INFO_FOR_UPDATE, PT_SELECT_INFO_IS_FLAGED, pt_short_print(), PT_SPEC_FLAG_FOR_UPDATE_CLAUSE, PT_UNION, PT_UPDATE, pt_query_info::q, pt_statement_info::query, pt_spec_info::range_var, pt_name_info::resolved, pt_delete_info::search_cond, pt_update_info::search_cond, pt_merge_info::search_cond, pt_query_info::select, find_id_info::spec, pt_delete_info::spec, pt_insert_info::spec, pt_update_info::spec, pt_statement_info::spec, pt_name_info::spec_id, pt_check_option_info::spec_id, spec_reset_info::statement, spec_reset_info::sub_paths, pt_query_info::union_, pt_merge_info::update, pt_statement_info::update, pt_insert_info::value_clauses, pt_merge_info::value_clauses, pt_query_info::vspec_as_derived, pt_insert_info::where, and pt_select_info::where.

Referenced by mq_substitute_select_in_statement(), and mq_translate_tree().

Here is the caller graph for this function:

static PT_NODE * mq_class_meth_corr_subq_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_clean_dot ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_clear_all_ids ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 6834 of file view_transform.c.

References parser_node::info, pt_statement_info::name, parser_node::node_type, NULL, PT_CONTINUE_WALK, pt_is_query, PT_LIST_WALK, PT_NAME, and pt_name_info::spec_id.

Referenced by mq_clear_ids().

Here is the caller graph for this function:

PT_NODE* mq_clear_ids ( PARSER_CONTEXT parser,
PT_NODE node,
PT_NODE spec 
)

Definition at line 6894 of file view_transform.c.

References pt_spec_info::id, parser_node::info, mq_clear_all_ids(), NULL, parser_walk_tree(), pt_continue_walk(), and pt_statement_info::spec.

Referenced by compile_partition_expression(), and pt_check_order_by().

Here is the caller graph for this function:

static PT_NODE * mq_clear_other_ids ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_coerce_resolved ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static DB_AUTH mq_compute_authorization ( DB_OBJECT class_object)
static

Definition at line 553 of file view_transform.c.

References DB_AUTH_DELETE, DB_AUTH_INSERT, DB_AUTH_SELECT, DB_AUTH_UPDATE, db_check_authorization(), and NO_ERROR.

Referenced by mq_compute_query_authorization(), and mq_virtual_queries().

Here is the caller graph for this function:

static bool mq_conditionally_add_objects ( PARSER_CONTEXT parser,
PT_NODE flat,
DB_OBJECT ***  classes,
int *  index,
int *  max 
)
static

Definition at line 1012 of file view_transform.c.

References pt_name_info::db_object, i, parser_node::info, MAX_STACK_OBJECTS, pt_statement_info::name, parser_node::next, NULL, parser_alloc(), and PT_INTERNAL_ERROR.

Referenced by mq_updatable_local().

Here is the caller graph for this function:

static void mq_copy_view_error_msgs ( PARSER_CONTEXT parser,
PARSER_CONTEXT query_cache 
)
static
int mq_evaluate_expression_having_serial ( PARSER_CONTEXT parser,
PT_NODE expr,
DB_VALUE values,
int  values_count,
DB_OBJECT object,
UINTPTR  spec_id 
)
DB_OBJECT* mq_fetch_one_real_class ( DB_OBJECT vclass_object)

Definition at line 10689 of file view_transform.c.

References pt_name_info::db_object, parser_node::info, mq_fetch_one_real_class_get_cache(), pt_statement_info::name, and NULL.

Referenced by make_template(), and ws_vmop().

Here is the caller graph for this function:

PT_NODE * mq_fetch_subqueries_for_update ( PARSER_CONTEXT parser,
PT_NODE class_,
PT_FETCH_AS  fetch_as,
DB_AUTH  what_for 
)
static
static PT_NODE * mq_flatten_union ( PARSER_CONTEXT parser,
PT_NODE statement 
)
static
static PT_NODE * mq_generate_unique ( PARSER_CONTEXT parser,
PT_NODE name_list 
)
static
PT_NODE* mq_get_references_helper ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec,
bool  get_spec_referenced_attr 
)
static bool mq_has_class_methods_corr_subqueries ( PARSER_CONTEXT parser,
PT_NODE node 
)
static
void mq_insert_symbol ( PARSER_CONTEXT parser,
PT_NODE **  listhead,
PT_NODE attr 
)
static
static void mq_invert_insert_subquery ( PARSER_CONTEXT parser,
PT_NODE **  attr,
PT_NODE subquery 
)
static
static void mq_invert_subqueries ( PARSER_CONTEXT parser,
PT_NODE select_statements,
PT_NODE attributes 
)
static
int mq_is_real_class_of_vclass ( PARSER_CONTEXT parser,
const PT_NODE s_class,
const PT_NODE d_class 
)
static int mq_is_referenced ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec 
)
static

Definition at line 7252 of file view_transform.c.

References mq_referenced_post(), mq_referenced_pre(), parser_walk_tree(), exists_info::referenced, find_id_info::spec, and exists_info::spec.

Referenced by mq_reset_paths().

Here is the caller graph for this function:

bool mq_is_updatable ( DB_OBJECT class_object)
bool mq_is_updatable_attribute ( DB_OBJECT vclass_object,
const char *  attr_name,
DB_OBJECT real_class_object 
)

Definition at line 10314 of file view_transform.c.

References mq_is_updatable_att(), NULL, parser, parser_create_parser(), parser_free_parser(), and rc.

Referenced by db_is_updatable_attribute(), and populate_defaults().

Here is the caller graph for this function:

static bool mq_is_updatable_local ( DB_OBJECT class_object,
PT_FETCH_AS  fetch_as 
)
static
bool mq_is_updatable_strict ( DB_OBJECT class_object)

Definition at line 10270 of file view_transform.c.

References mq_is_updatable_local(), and PT_NORMAL_SELECT.

Referenced by mq_check_non_updatable_vclass_oid().

Here is the caller graph for this function:

static PT_NODE * mq_lambda_node_pre ( PARSER_CONTEXT parser,
PT_NODE tree,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 9079 of file view_transform.c.

References extra_specs_frame::extra_specs, extra_specs_frame::next, parser_node::node_type, NULL, PT_INTERNAL_ERROR, PT_SELECT, and mq_lambda_arg::spec_frames.

Referenced by mq_lambda().

Here is the caller graph for this function:

static PT_NODE * mq_lookup_symbol ( PARSER_CONTEXT parser,
PT_NODE attr_list,
PT_NODE attr 
)
static

Definition at line 6600 of file view_transform.c.

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

Referenced by mq_insert_symbol().

Here is the caller graph for this function:

static PT_NODE * mq_path_name_lambda ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE lambda_name,
PT_NODE lambda_expr,
UINTPTR  spec_id 
)
static
static PT_NODE * mq_referenced_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 7234 of file view_transform.c.

References PT_CONTINUE_WALK, and PT_STOP_WALK.

Referenced by mq_is_referenced().

Here is the caller graph for this function:

static PT_NODE * mq_referenced_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
PT_NODE * mq_rename_resolved ( PARSER_CONTEXT parser,
PT_NODE spec,
PT_NODE statement,
const char *  newname 
)
static
PT_NODE * mq_reset_ids_and_references ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec 
)
static
PT_NODE * mq_reset_ids_and_references_helper ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec,
bool  get_spec_referenced_attr 
)
static
PT_NODE* mq_reset_ids_in_methods ( PARSER_CONTEXT parser,
PT_NODE statement 
)

Definition at line 7040 of file view_transform.c.

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

Referenced by mq_substitute_subquery_in_statement().

Here is the caller graph for this function:

PT_NODE* mq_reset_ids_in_statement ( PARSER_CONTEXT parser,
PT_NODE statement 
)
static PT_NODE * mq_reset_references_to_query_string ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static

Definition at line 11740 of file view_transform.c.

References parser_node::buffer_pos, parser_node::column_number, parser_node::line_number, and NULL.

Referenced by mq_translate_subqueries().

Here is the caller graph for this function:

static PT_NODE * mq_reset_select_spec_node ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_reset_spec_distr_subpath_pre ( PARSER_CONTEXT parser,
PT_NODE spec,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 7712 of file view_transform.c.

References spec_reset_info::old_next, PT_CONTINUE_WALK, PT_STOP_WALK, and find_id_info::spec.

Referenced by mq_class_lambda(), and mq_path_spec_lambda().

Here is the caller graph for this function:

static PT_NODE * mq_reset_spec_in_method_names ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_reset_specs_from_column ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE column 
)
static

Definition at line 7432 of file view_transform.c.

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

Referenced by mq_lambda_node().

Here is the caller graph for this function:

static PT_NODE * mq_resolve_insert_statement ( PARSER_CONTEXT parser,
PT_NODE insert_statement 
)
static
static PT_NODE * mq_rewrite_agg_names ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static

Definition at line 723 of file view_transform.c.

References pt_dot_info::arg2, pt_function_info::arg_list, pt_spec_info::as_attr_list, parser_node::column_number, pt_query_info::correlation_level, parser_node::data_type, pt_agg_rewrite_info::depth, pt_agg_rewrite_info::derived_select, pt_statement_info::dot, parser_node::flag, pt_agg_rewrite_info::from, pt_statement_info::function, pt_function_info::function_type, i, pt_spec_info::id, parser_node::info, parser_node::is_hidden_column, parser_node::line_number, pt_select_info::list, pt_agg_name_info::max_level, pt_name_info::meta_class, mq_generate_name(), mq_insert_symbol(), mq_rewrite_agg_names_post(), pt_statement_info::name, pt_agg_name_info::name_count, pt_agg_rewrite_info::new_from, parser_node::next, parser_node::node_type, NULL, parser_append_node(), parser_copy_tree_list(), parser_free_tree(), parser_walk_tree(), PT_CONTINUE_WALK, pt_continue_walk(), PT_COUNT_STAR, PT_DATA_TYPE, PT_DIFFERENCE, PT_DOT_, pt_find_aggregate_names(), pt_find_entity(), PT_FUNCTION, PT_GROUPBY_NUM, PT_INTERSECTION, pt_is_aggregate_function(), pt_is_query, pt_is_set_type, PT_LEAF_WALK, PT_LIST_WALK, PT_META_ATTR, PT_META_CLASS, PT_METHOD, pt_name(), PT_NAME, pt_name_equal(), PT_NORMAL, PT_OID_ATTR, pt_pointer_stack_push(), PT_SELECT, PT_SHARED, PT_STOP_WALK, PT_UNION, PT_VID_ATTR, pt_query_info::q, pt_statement_info::query, pt_query_info::select, pt_agg_rewrite_info::select_stack, pt_agg_name_info::select_stack, pt_statement_info::spec, pt_name_info::spec_id, find_id_info::type, and parser_node::type_enum.

Referenced by mq_rewrite_aggregate_as_derived().

Here is the caller graph for this function:

static PT_NODE * mq_rewrite_agg_names_post ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
PT_NODE* mq_rewrite_aggregate_as_derived ( PARSER_CONTEXT parser,
PT_NODE agg_sel 
)

Definition at line 3664 of file view_transform.c.

References pt_spec_info::as_attr_list, parser_node::cannot_prepare, pt_query_info::correlation_level, parser_node::data_type, pt_agg_rewrite_info::depth, pt_agg_rewrite_info::derived_select, pt_spec_info::derived_table, pt_spec_info::derived_table_type, parser_node::flag, pt_select_info::flavor, pt_select_info::from, pt_agg_rewrite_info::from, pt_select_info::group_by, pt_select_info::having, pt_select_info::hint, pt_spec_info::id, pt_select_info::index_ls, pt_select_info::index_ss, parser_node::info, pt_query_info::is_subquery, pt_select_info::list, pt_name_info::meta_class, mq_bump_correlation_level(), mq_generate_name(), mq_rewrite_agg_names(), mq_rewrite_agg_names_post(), pt_statement_info::name, pt_agg_rewrite_info::new_from, parser_node::next, NULL, pt_select_info::ordered, pt_name_info::original, parser_append_node(), parser_copy_tree(), parser_new_node(), parser_walk_tree(), PT_HINT_NONE, PT_INTERNAL_ERROR, PT_IS_SUBQUERY, pt_name(), PT_NORMAL, pt_pointer_stack_pop(), pt_pointer_stack_push(), pt_resolve_star(), PT_SELECT, PT_SELECT_INFO_CLEAR_FLAG, PT_SELECT_INFO_HAS_AGG, PT_SELECT_INFO_SET_FLAG, PT_SPEC, PT_USER_SELECT, pt_query_info::q, pt_statement_info::query, pt_spec_info::range_var, pt_name_info::resolved, pt_query_info::select, pt_agg_rewrite_info::select_stack, find_id_info::spec, pt_statement_info::spec, pt_name_info::spec_id, parser_node::type_enum, pt_select_info::use_idx, pt_select_info::use_merge, pt_select_info::use_nl, pt_select_info::using_index, and pt_select_info::where.

Referenced by mq_translate_local(), mq_translate_select(), and pt_check_order_by().

Here is the caller graph for this function:

static PT_NODE * mq_rewrite_order_dependent_query ( PARSER_CONTEXT parser,
PT_NODE select,
int *  unique 
)
static
static PT_NODE * mq_rewrite_vclass_spec_as_derived ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec,
PT_NODE query_spec 
)
static

Definition at line 3330 of file view_transform.c.

References pt_select_info::after_cb_filter, pt_spec_info::as_attr_list, find_id_info::attr_list, parser_node::cannot_prepare, pt_select_info::check_cycles, pt_select_info::connect_by, pt_spec_info::derived_table, pt_spec_info::derived_table_type, pt_spec_info::entity_name, er_has_error(), pt_spec_info::except_list, FIND_ID_VCLASS, pt_spec_info::flag, pt_query_info::flag, parser_node::flag, pt_spec_info::flat_entity_list, pt_select_info::from, pt_spec_info::id, find_id_info::in, parser_node::info, parser_node::is_hidden_column, pt_query_info::is_subquery, parser_node::is_value_query, pt_spec_info::join_type, pt_select_info::list, mq_copypush_sargable_terms_helper(), mq_fetch_attributes(), mq_fetch_subqueries(), mq_get_references(), mq_insert_symbol(), mq_reset_ids_and_references(), pt_statement_info::name, parser_node::next, parser_node::node_type, NULL, pt_spec_info::on_cond, find_id_info::others_spec_list, parser_copy_tree(), parser_copy_tree_list(), parser_free_tree(), parser_new_node(), pt_spec_info::path_entities, pt_has_error, PT_INTERNAL_ERROR, PT_IS_SELECT, PT_IS_SUBQUERY, PT_IS_VALUE_QUERY, PT_JOIN_NONE, PT_SELECT, PT_SPEC, PT_SPEC_FLAG_FROM_VCLASS, PT_TYPE_OBJECT, pt_query_info::q, pt_statement_info::query, find_id_info::query_list, pt_query_info::select, pt_select_info::single_table_opt, find_id_info::spec, pt_statement_info::spec, pt_name_info::spec_id, pt_select_info::start_with, find_id_info::type, parser_node::type_enum, and pt_query_info::vspec_as_derived.

Referenced by mq_check_rewrite_select(), mq_rewrite_upd_del_top_level_specs(), and mq_substitute_subquery_in_statement().

Here is the caller graph for this function:

static PT_NODE * mq_set_all_ids ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_set_names_dbobject ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
PT_NODE* mq_set_references ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec 
)
static PT_NODE * mq_set_references_local ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE spec 
)
static
static PT_NODE * mq_set_types ( PARSER_CONTEXT parser,
PT_NODE query_spec,
PT_NODE attributes,
DB_OBJECT vclass_object,
int  cascaded_check 
)
static
static void mq_set_union_query ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_MISC_TYPE  is_union 
)
static
static PT_NODE * mq_substitute_path_pre ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_substitute_spec_in_method_names ( PARSER_CONTEXT parser,
PT_NODE node,
void *  void_arg,
int *  continue_walk 
)
static
static PT_NODE * mq_substitute_subquery_in_statement ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE query_spec,
PT_NODE class_,
PT_NODE order_by,
int  what_for 
)
static

Definition at line 1607 of file view_transform.c.

References pt_query_info::all_distinct, pt_union_info::arg1, pt_union_info::arg2, assert, pt_statement_info::delete_, pt_spec_info::derived_table, pt_spec_info::entity_name, pt_query_info::flag, pt_spec_info::flat_entity_list, pt_select_info::from, pt_select_info::having, pt_select_info::hint, pt_query_info::id, pt_select_info::index_ls, pt_select_info::index_ss, parser_node::info, pt_statement_info::insert, pt_merge_info::into, pt_query_info::limit, pt_statement_info::merge, mq_is_outer_join_spec(), mq_is_pushable_subquery(), mq_reset_ids_in_methods(), mq_rewrite_vclass_spec_as_derived(), mq_substitute_select_in_statement(), mq_union_bump_correlation(), mq_update_order_by(), MSGCAT_RUNTIME_REL_RESTRICTS_AGG_2, MSGCAT_SET_PARSER_RUNTIME, pt_statement_info::name, parser_node::next, parser_node::node_type, NULL, pt_query_info::order_by, pt_query_info::order_siblings, pt_query_info::orderby_for, pt_select_info::ordered, parser_append_node(), parser_copy_tree(), parser_copy_tree_list(), parser_free_tree(), PT_DELETE, PT_DIFFERENCE, PT_DISTINCT, PT_ERRORm, pt_find_spec(), pt_has_aggregate(), pt_has_error, PT_HINT_INDEX_LS, PT_HINT_INDEX_SS, PT_INSERT, PT_INTERNAL_ERROR, PT_INTERSECTION, PT_IS_QUERY, PT_IS_VALUE_QUERY, PT_MERGE, PT_SELECT, PT_SPEC, PT_UNION, PT_UPDATE, pt_query_info::q, pt_statement_info::query, pt_query_info::rewrite_limit, pt_query_info::select, pt_delete_info::spec, pt_insert_info::spec, pt_update_info::spec, pt_statement_info::spec, pt_name_info::spec_id, pt_query_info::union_, pt_statement_info::update, pt_select_info::use_idx, pt_select_info::use_merge, pt_select_info::use_nl, pt_delete_info::using_index, pt_select_info::using_index, pt_update_info::using_index, and pt_select_info::where.

Referenced by mq_substitute_subquery_list_in_statement().

Here is the caller graph for this function:

static PT_NODE * mq_substitute_subquery_list_in_statement ( PARSER_CONTEXT parser,
PT_NODE statement,
PT_NODE query_spec_list,
PT_NODE class_,
PT_NODE order_by,
int  what_for 
)
static

Definition at line 2116 of file view_transform.c.

References er_errid_if_has_error(), mq_substitute_subquery_in_statement(), parser_node::next, NO_ERROR, NULL, parser_append_node(), and pt_has_error.

Referenced by mq_translate_tree().

Here is the caller graph for this function:

static int mq_translatable_class ( PARSER_CONTEXT parser,
PT_NODE class_ 
)
static
static PT_NODE * mq_translate_delete ( PARSER_CONTEXT parser,
PT_NODE delete_statement 
)
static
static PT_NODE * mq_translate_insert ( PARSER_CONTEXT parser,
PT_NODE insert_statement 
)
static
static PT_NODE * mq_translate_tree ( PARSER_CONTEXT parser,
PT_NODE tree,
PT_NODE spec_list,
PT_NODE order_by,
int  what_for 
)
static

Definition at line 2319 of file view_transform.c.

References assert, pt_spec_info::auth_bypass_mask, parser_node::cannot_prepare, DB_AUTH_DELETE, DB_AUTH_NONE, DB_AUTH_SELECT, DB_AUTH_UPDATE, db_check_authorization(), db_get_class_name(), pt_name_info::db_object, pt_spec_info::derived_table_type, er_errid_if_has_error(), pt_spec_info::flag, parser_node::flag, pt_spec_info::flat_entity_list, get_authorization_name(), pt_spec_info::id, parser_node::info, pt_spec_info::meta_class, mq_check_authorization_path_entities(), mq_check_subqueries_for_prepare(), mq_class_lambda(), mq_fetch_subqueries(), mq_fetch_subqueries_for_update(), mq_fix_derived_in_union(), mq_reset_ids_in_statement(), mq_substitute_subquery_list_in_statement(), mq_translatable_class(), mq_union_bump_correlation(), MSGCAT_RUNTIME_IS_NOT_AUTHORIZED_ON, MSGCAT_SET_PARSER_RUNTIME, pt_statement_info::name, parser_node::next, NO_ERROR, parser_node::node_type, NULL, pt_query_info::order_by, pt_name_info::original, parser_append_node(), parser_copy_tree(), parser_copy_tree_list(), parser_free_tree(), parser_print_tree_list(), PT_DIFFERENCE, pt_entity(), PT_ERRORmf2, pt_has_error, PT_INTERSECTION, PT_IS_SELECT, PT_IS_WHACKED_SPEC, PT_MERGE, PT_META_CLASS, PT_NODE_COPY_NUMBER_OUTERLINK, PT_NORMAL_SELECT, PT_PARTIAL_SELECT, PT_SELECT, PT_SELECT_FULL_INFO_COLS_SCHEMA, PT_SELECT_INFO_COLS_SCHEMA, PT_SELECT_INFO_IS_FLAGED, PT_SPEC_FLAG_DELETE, PT_SPEC_FLAG_UPDATE, PT_SPEC_IS_DERIVED, PT_UNION, pt_statement_info::query, pt_spec_info::range_var, pt_name_info::resolved, and pt_statement_info::spec.

Referenced by mq_translate_delete(), mq_translate_insert(), mq_translate_merge(), mq_translate_select(), and mq_translate_update().

Here is the caller graph for this function:

static PT_NODE * mq_translate_update ( PARSER_CONTEXT parser,
PT_NODE update_statement 
)
static
static PT_NODE * mq_union_bump_correlation ( PARSER_CONTEXT parser,
PT_NODE left,
PT_NODE right 
)
static
PT_UPDATABILITY mq_updatable ( PARSER_CONTEXT parser,
PT_NODE statement 
)

Definition at line 1184 of file view_transform.c.

References max, MAX_STACK_OBJECTS, and mq_updatable_local().

Referenced by db_compile_statement_local(), and mq_virtual_queries().

Here is the caller graph for this function:

PARSER_CONTEXT* mq_virtual_queries ( DB_OBJECT class_object)
static PT_NODE * pt_check_for_update_subquery ( PARSER_CONTEXT parser,
PT_NODE node,
void *  arg,
int *  continue_walk 
)
static
static int pt_for_update_prepare_query ( PARSER_CONTEXT parser,
PT_NODE query 
)
static
static int pt_for_update_prepare_query_internal ( PARSER_CONTEXT parser,
PT_NODE query 
)
static
static bool pt_sargable_term ( PARSER_CONTEXT parser,
PT_NODE term,
FIND_ID_INFO infop 
)
static

Variable Documentation

DB_OBJECT* cycle_buffer[MAX_CYCLE]
static

Definition at line 108 of file view_transform.c.

unsigned int top_cycle = 0
static

Definition at line 107 of file view_transform.c.

Referenced by mq_check_cycle(), and mq_virtual_queries().