CUBRID Engine  latest
db_vdb.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <sys/timeb.h>
#include <time.h>
#include <assert.h>
#include "authenticate.h"
#include "db.h"
#include "dbi.h"
#include "db_query.h"
#include "error_manager.h"
#include "chartype.h"
#include "system_parameter.h"
#include "environment_variable.h"
#include "memory_alloc.h"
#include "parser.h"
#include "parser_message.h"
#include "object_domain.h"
#include "object_primitive.h"
#include "schema_manager.h"
#include "view_transform.h"
#include "execute_statement.h"
#include "locator_cl.h"
#include "server_interface.h"
#include "api_compat.h"
#include "network_interface_cl.h"
#include "transaction_cl.h"
#include "dbtype.h"
#include "util_func.h"
#include "xasl.h"

Go to the source code of this file.

Macros

#define BUF_SIZE   1024
 
#define MAX_SERVER_TIME_CACHE   60 /* secs */
 

Enumerations

enum  { StatementInitialStage = 0, StatementCompiledStage, StatementPreparedStage, StatementExecutedStage }
 

Functions

static int get_dimension_of (PT_NODE **array)
 
static DB_SESSIONdb_open_local (void)
 
static DB_SESSIONinitialize_session (DB_SESSION *session)
 
static int db_execute_and_keep_statement_local (DB_SESSION *session, int stmt_ndx, DB_QUERY_RESULT **result)
 
static DB_OBJLISTdb_get_all_chosen_classes (int(*p)(MOBJ o))
 
static int is_vclass_object (MOBJ class_)
 
static char * get_reasonable_predicate (DB_ATTRIBUTE *att)
 
static void update_execution_values (PARSER_CONTEXT *parser, int result, CUBRID_STMT_TYPE statement_type)
 
static void copy_execution_values (EXECUTION_STATE_VALUES *source, EXECUTION_STATE_VALUES *destination)
 
static int values_list_to_values_array (PARSER_CONTEXT *parser, PT_NODE *values_list, DB_VALUE_ARRAY *values_array)
 
static int set_prepare_info_into_list (DB_PREPARE_INFO *prepare_info, PT_NODE *statement)
 
static PT_NODEchar_array_to_name_list (PARSER_CONTEXT *parser, char **names, int length)
 
static int do_process_prepare_statement (DB_SESSION *session, PT_NODE *statement)
 
static int do_get_prepared_statement_info (DB_SESSION *session, int stmt_idx)
 
static int do_set_user_host_variables (DB_SESSION *session, PT_NODE *using_list)
 
static int do_cast_host_variables_to_expected_domain (DB_SESSION *session)
 
static int do_recompile_and_execute_prepared_statement (DB_SESSION *session, PT_NODE *statement, DB_QUERY_RESULT **result)
 
static int do_process_deallocate_prepare (DB_SESSION *session, PT_NODE *statement)
 
static bool is_allowed_as_prepared_statement (PT_NODE *node)
 
static bool is_allowed_as_prepared_statement_with_hv (PT_NODE *node)
 
static bool db_check_limit_need_recompile (PARSER_CONTEXT *parser, PT_NODE *statement, int xasl_flag)
 
static DB_CLASS_MODIFICATION_STATUS pt_has_modified_class (PARSER_CONTEXT *parser, PT_NODE *statement)
 
static PT_NODEpt_has_modified_class_helper (PARSER_CONTEXT *parser, PT_NODE *tree, void *arg, int *continue_walk)
 
static bool db_can_execute_statement_with_autocommit (PARSER_CONTEXT *parser, PT_NODE *statement)
 
int db_statement_count (DB_SESSION *session)
 
DB_SESSIONdb_open_buffer_local (const char *buffer)
 
DB_SESSIONdb_open_buffer (const char *buffer)
 
DB_SESSIONdb_open_file (FILE *file)
 
DB_SESSIONdb_make_session_for_one_statement_execution (FILE *file)
 
int db_parse_one_statement (DB_SESSION *session)
 
int db_get_parser_line_col (DB_SESSION *session, int *line, int *col)
 
DB_SESSIONdb_open_file_name (const char *name)
 
static void db_calculate_current_time (struct timeb *tb)
 
static void db_calculate_current_server_time (PARSER_CONTEXT *parser)
 
static void db_set_base_server_time (DB_VALUE *db_val)
 
int db_compile_statement_local (DB_SESSION *session)
 
int db_compile_statement (DB_SESSION *session)
 
void db_rewind_statement (DB_SESSION *session)
 
int db_session_is_last_statement (DB_SESSION *session)
 
int db_set_client_cache_time (DB_SESSION *session, int stmt_ndx, CACHE_TIME *cache_time)
 
bool db_get_jdbccachehint (DB_SESSION *session, int stmt_ndx, int *life_time)
 
bool db_get_cacheinfo (DB_SESSION *session, int stmt_ndx, bool *use_plan_cache, bool *use_query_cache)
 
DB_SESSION_ERRORdb_get_errors (DB_SESSION *session)
 
DB_SESSION_ERRORdb_get_next_error (DB_SESSION_ERROR *errors, int *line, int *col)
 
DB_SESSION_WARNINGdb_get_warnings (DB_SESSION *session)
 
DB_SESSION_WARNINGdb_get_next_warning (DB_SESSION_WARNING *warnings, int *line, int *col)
 
void db_session_set_holdable (DB_SESSION *session, bool holdable)
 
void db_session_set_xasl_cache_pinned (DB_SESSION *session, bool is_pinned, bool recompile)
 
void db_session_set_return_generated_keys (DB_SESSION *session, bool return_generated_keys)
 
int db_get_line_col_of_1st_error (DB_SESSION *session, DB_QUERY_ERROR *linecol)
 
int db_number_of_input_markers (DB_SESSION *session, int stmt)
 
int db_number_of_output_markers (DB_SESSION *session, int stmt)
 
DB_MARKERdb_get_input_markers (DB_SESSION *session, int stmt)
 
DB_MARKERdb_get_output_markers (DB_SESSION *session, int stmt)
 
DB_MARKERdb_marker_next (DB_MARKER *marker)
 
int db_marker_index (DB_MARKER *marker)
 
DB_DOMAINdb_marker_domain (DB_MARKER *marker)
 
bool db_is_input_marker (DB_MARKER *marker)
 
bool db_is_output_marker (DB_MARKER *marker)
 
DB_QUERY_TYPEdb_get_query_type_list (DB_SESSION *session, int stmt_ndx)
 
DB_QUERY_TYPEdb_get_query_type_ptr (DB_QUERY_RESULT *result)
 
int db_get_start_line (DB_SESSION *session, int stmt)
 
int db_get_statement_type (DB_SESSION *session, int stmt)
 
void db_include_oid (DB_SESSION *session, int include_oid)
 
int db_push_values (DB_SESSION *session, int count, DB_VALUE *in_values)
 
DB_VALUEdb_get_hostvars (DB_SESSION *session)
 
char ** db_get_lock_classes (DB_SESSION *session)
 
DB_CLASS_MODIFICATION_STATUS db_has_modified_class (DB_SESSION *session, int stmt_id)
 
int db_execute_and_keep_statement (DB_SESSION *session, int stmt_ndx, DB_QUERY_RESULT **result)
 
int db_execute_statement_local (DB_SESSION *session, int stmt_ndx, DB_QUERY_RESULT **result)
 
int db_execute_statement (DB_SESSION *session, int stmt_ndx, DB_QUERY_RESULT **result)
 
int db_open_buffer_and_compile_first_statement (const char *CSQL_query, DB_QUERY_ERROR *query_error, int include_oid, DB_SESSION **session, int *stmt_no)
 
int db_compile_and_execute_local (const char *CSQL_query, void *result, DB_QUERY_ERROR *query_error)
 
int db_compile_and_execute_queries_internal (const char *CSQL_query, void *result, DB_QUERY_ERROR *query_error, int include_oid, int execute, bool is_new_statement)
 
int db_set_system_generated_statement (DB_SESSION *session)
 
void db_drop_statement (DB_SESSION *session, int stmt)
 
void db_drop_all_statements (DB_SESSION *session)
 
void db_close_session_local (DB_SESSION *session)
 
void db_close_session (DB_SESSION *session)
 
DB_OBJLISTdb_get_all_vclasses_on_ldb (void)
 
DB_OBJLISTdb_get_all_vclasses (void)
 
int db_validate_query_spec (DB_OBJECT *vclass, const char *query_spec)
 
int db_validate (DB_OBJECT *vc)
 
void db_free_query (DB_SESSION *session)
 
int db_check_single_query (DB_SESSION *session)
 
PARSER_CONTEXTdb_get_parser (DB_SESSION *session)
 
DB_NODEdb_get_statement (DB_SESSION *session, int id)
 
DB_PARAMETERdb_get_parameters (DB_SESSION *session, int statement_id)
 
DB_PARAMETERdb_parameter_next (DB_PARAMETER *param)
 
const char * db_parameter_name (DB_PARAMETER *param)
 
int db_bind_parameter_name (const char *name, DB_VALUE *value)
 
int db_query_produce_updatable_result (DB_SESSION *session, int stmt_ndx)
 
void db_invalidate_mvcc_snapshot_before_statement (void)
 
void db_set_read_fetch_instance_version (LC_FETCH_VERSION_TYPE read_Fetch_Instance_Version)
 
int db_set_statement_auto_commit (DB_SESSION *session, bool auto_commit)
 
int db_get_line_of_statement (DB_SESSION *session, int stmt_id)
 

Variables

static struct timeb base_server_timeb = { 0, 0, 0, 0 }
 
static struct timeb base_client_timeb = { 0, 0, 0, 0 }
 

Macro Definition Documentation

#define BUF_SIZE   1024

Definition at line 59 of file db_vdb.c.

Referenced by db_validate().

#define MAX_SERVER_TIME_CACHE   60 /* secs */

Definition at line 61 of file db_vdb.c.

Referenced by db_calculate_current_server_time().

Enumeration Type Documentation

anonymous enum
Enumerator
StatementInitialStage 
StatementCompiledStage 
StatementPreparedStage 
StatementExecutedStage 

Definition at line 63 of file db_vdb.c.

Function Documentation

static PT_NODE * char_array_to_name_list ( PARSER_CONTEXT parser,
char **  names,
int  length 
)
static

Definition at line 2251 of file db_vdb.c.

References i, NULL, parser_append_node(), and pt_name().

Referenced by do_get_prepared_statement_info().

Here is the caller graph for this function:

static void copy_execution_values ( EXECUTION_STATE_VALUES source,
EXECUTION_STATE_VALUES destination 
)
static

Definition at line 2066 of file db_vdb.c.

References assert, NULL, and execution_state_values::row_count.

int db_bind_parameter_name ( const char *  name,
DB_VALUE value 
)

Definition at line 3813 of file db_vdb.c.

References pt_associate_label_with_value_check_reference().

static void db_calculate_current_server_time ( PARSER_CONTEXT parser)
static
static void db_calculate_current_time ( struct timeb *  tb)
static

Definition at line 402 of file db_vdb.c.

References assert, and util_get_second_and_ms_since_epoch().

Referenced by db_calculate_current_server_time(), and db_set_base_server_time().

Here is the caller graph for this function:

int db_check_single_query ( DB_SESSION session)

Definition at line 3695 of file db_vdb.c.

References db_session::dimension, ER_IT_MULTIPLE_STATEMENT, and NO_ERROR.

Referenced by do_process_prepare_statement(), ux_execute(), ux_execute_all(), and ux_execute_call().

Here is the caller graph for this function:

int db_compile_and_execute_local ( const char *  CSQL_query,
void *  result,
DB_QUERY_ERROR query_error 
)
int db_compile_and_execute_queries_internal ( const char *  CSQL_query,
void *  result,
DB_QUERY_ERROR query_error,
int  include_oid,
int  execute,
bool  is_new_statement 
)
int db_compile_statement_local ( DB_SESSION session)

Definition at line 510 of file db_vdb.c.

References ARG_FILE_LINE, parser_node::cannot_prepare, db_query_type::col_type, CUBRID_STMT_EXECUTE_PREPARE, CUBRID_STMT_SELECT, DB_COL_PATH, DB_NO_OIDS, DB_ROW_OIDS, db_session::dimension, do_cast_host_variables_to_expected_domain(), do_get_prepared_statement_info(), pt_query_info::do_not_cache, do_prepare_statement(), er_clear(), er_errid(), ER_ERROR_SEVERITY, ER_IT_EMPTY_STATEMENT, ER_IT_INVALID_SESSION, ER_OUT_OF_VIRTUAL_MEMORY, ER_QPROC_INVALID_XASLNODE, er_set(), ER_WARNING_SEVERITY, err, pt_query_info::flag, parser_node::flag, parser_context::flag, db_session::include_oid, parser_node::info, db_session::is_subsession_for_prepared, parser_node::is_system_generated_stmt, parser_context::is_system_generated_stmt, mq_translate(), mq_updatable(), db_query_type::next, NO_ERROR, NULL, p, db_session::parser, parser, prm_get_integer_value(), PRM_ID_XASL_CACHE_MAX_ENTRIES, pt_add_row_oid(), pt_class_pre_fetch(), pt_compile(), pt_fillin_type_size(), pt_get_titles(), pt_has_error, pt_node_to_cmd_type(), pt_report_to_ersys(), pt_report_to_ersys_with_statement(), pt_reset_error(), PT_SEMANTIC, PT_SYNTAX, PT_UPDATABLE, pt_statement_info::query, parser_context::set_host_var, db_session::stage, StatementCompiledStage, StatementPreparedStage, db_session::statements, db_session::stmt_ndx, db_session::type_list, parser_node::use_plan_cache, parser_node::use_query_cache, and parser_node::xasl_id.

Referenced by au_delete_auth_of_dropping_table(), db_compile_and_execute_queries_internal(), db_compile_statement(), db_execute_and_keep_statement_local(), db_open_buffer_and_compile_first_statement(), do_process_prepare_statement(), stmt_exec_batch_query_internal(), stmt_exec_one_statement(), and stmt_prepare_internal().

Here is the caller graph for this function:

void db_drop_statement ( DB_SESSION session,
int  stmt 
)

Definition at line 3196 of file db_vdb.c.

References NULL, db_session::parser, parser_free_tree(), pt_free_statement_xasl_id(), db_session::stage, StatementInitialStage, and db_session::statements.

Referenced by csql_execute_statements().

Here is the caller graph for this function:

static int db_execute_and_keep_statement_local ( DB_SESSION session,
int  stmt_ndx,
DB_QUERY_RESULT **  result 
)
static

Definition at line 1599 of file db_vdb.c.

References ARG_FILE_LINE, assert, parser_context::auto_param_count, base_server_timeb, parser_node::cannot_prepare, parser_node::clt_cache_reusable, CUBRID_MAX_STMT_TYPE, CUBRID_STMT_CALL, CUBRID_STMT_DO, CUBRID_STMT_EVALUATE, CUBRID_STMT_EXECUTE_PREPARE, CUBRID_STMT_GET_ISO_LVL, CUBRID_STMT_GET_OPT_LVL, CUBRID_STMT_GET_STATS, CUBRID_STMT_GET_TIMEOUT, CUBRID_STMT_GET_TRIGGER, CUBRID_STMT_INSERT, CUBRID_STMT_SELECT, db_calculate_current_server_time(), DB_CLASS_ERROR, DB_CLASS_MODIFIED, DB_CLASS_NOT_MODIFIED, db_compile_statement_local(), db_cp_query_type(), db_get_db_value_query_result(), DB_IS_NULL, db_make_null(), db_make_object(), db_query_tuple_count(), db_set_base_server_time(), DB_TYPE_OBJECT, db_value_create(), DB_VALUE_DOMAIN_TYPE, db_value_free(), db_session::dimension, do_execute_statement(), do_prepare_statement(), do_process_deallocate_prepare(), do_process_prepare_statement(), do_recompile_and_execute_prepared_statement(), pt_insert_info::do_replace, do_statement(), do_Trigger_involved, semantic_chk_info::donot_fold, er_clear(), ER_DO_UNKNOWN_HOSTVAR_TYPE, er_errid(), ER_ERROR_SEVERITY, ER_IT_EMPTY_STATEMENT, ER_IT_INVALID_SESSION, ER_OBJ_INVALID_ARGUMENTS, ER_QPROC_INVALID_XASLNODE, ER_QPROC_XASLNODE_RECOMPILE_REQUESTED, er_set(), ER_UCI_TOO_FEW_HOST_VARS, ER_WARNING_SEVERITY, err, pt_statement_info::execute, parser_node::flag, parser_context::flag, parser_context::host_var_count, parser_node::info, pt_statement_info::insert, parser_context::is_in_and_list, parser_context::local_transaction_id, mq_reset_ids_in_statement(), NO_ERROR, parser_node::node_type, NULL, db_session::parser, parser, parser_copy_tree_list(), parser_free_tree(), prm_get_integer_value(), PRM_ID_XASL_CACHE_MAX_ENTRIES, PT_ALTER, pt_bind_values_to_hostvars(), PT_CREATE_ENTITY, PT_DEALLOCATE_PREPARE, PT_EXECUTE_PREPARE, PT_EXECUTION, pt_free_query_etc_area(), pt_free_statement_xasl_id(), pt_has_error, pt_has_modified_class(), pt_is_server_insert_with_generated_keys(), pt_make_cache_hit_result_descriptor(), pt_new_query_result_descriptor(), pt_node_etc(), pt_node_to_cmd_type(), pt_null_etc(), PT_PREPARE_STATEMENT, pt_report_to_ersys(), pt_report_to_ersys_with_statement(), pt_reset_error(), pt_resolve_names(), PT_SEMANTIC, pt_semantic_type(), PT_SYNTAX, qp_get_server_info(), parser_context::query_id, db_query_result::query_type, pt_execute_info::recompile, db_query_result::res, db_query_result::s, pt_insert_info::server_allowed, SERVER_INSERT_IS_ALLOWED, parser_context::set_host_var, parser_node::si_datetime, SI_LOCAL_TRANSACTION_ID, SI_SYS_DATETIME, parser_node::si_tran_id, db_session::stage, StatementExecutedStage, StatementPreparedStage, db_session::statements, db_select_result::stmt_id, db_session::stmt_ndx, pt_execute_info::stmt_type, parser_context::sys_datetime, parser_context::sys_epochtime, semantic_chk_info::top_node, db_session::type_list, update_execution_values(), parser_node::xasl_id, and XASL_ID_IS_NULL.

Referenced by db_execute_and_keep_statement(), db_execute_statement_local(), and do_recompile_and_execute_prepared_statement().

Here is the caller graph for this function:

void db_free_query ( DB_SESSION session)

Definition at line 3683 of file db_vdb.c.

References db_session::parser, and pt_end_query().

Referenced by csql_execute_statements(), do_run_update_query_for_class(), and sm_truncate_using_delete().

Here is the caller graph for this function:

static DB_OBJLIST * db_get_all_chosen_classes ( int(*)(MOBJ o)  p)
static
DB_OBJLIST* db_get_all_vclasses ( void  )

Definition at line 3423 of file db_vdb.c.

References db_get_all_chosen_classes(), and is_vclass_object().

DB_OBJLIST* db_get_all_vclasses_on_ldb ( void  )

Definition at line 3412 of file db_vdb.c.

References NULL.

bool db_get_cacheinfo ( DB_SESSION session,
int  stmt_ndx,
bool use_plan_cache,
bool use_query_cache 
)
DB_VALUE* db_get_hostvars ( DB_SESSION session)

Definition at line 1562 of file db_vdb.c.

References parser_context::host_variables, and db_session::parser.

Referenced by ux_execute_all(), and ux_execute_call().

Here is the caller graph for this function:

DB_MARKER* db_get_input_markers ( DB_SESSION session,
int  stmt 
)
int db_get_line_col_of_1st_error ( DB_SESSION session,
DB_QUERY_ERROR linecol 
)
int db_get_line_of_statement ( DB_SESSION session,
int  stmt_id 
)

Definition at line 4236 of file db_vdb.c.

References assert, db_session::dimension, parser_node::line_number, NULL, and db_session::statements.

Referenced by ldr_exec_query_from_file().

Here is the caller graph for this function:

char** db_get_lock_classes ( DB_SESSION session)

Definition at line 1573 of file db_vdb.c.

References parser_context::lcks_classes, NULL, and db_session::parser.

DB_SESSION_ERROR* db_get_next_error ( DB_SESSION_ERROR errors,
int *  line,
int *  col 
)
DB_SESSION_WARNING* db_get_next_warning ( DB_SESSION_WARNING warnings,
int *  line,
int *  col 
)

Definition at line 1013 of file db_vdb.c.

References ARG_FILE_LINE, ER_PT_ERROR, er_set(), ER_WARNING_SEVERITY, NULL, and pt_get_next_error().

PARSER_CONTEXT* db_get_parser ( DB_SESSION session)

Definition at line 3714 of file db_vdb.c.

References db_session::parser.

Referenced by do_run_update_query_for_class(), and uci_static().

Here is the caller graph for this function:

int db_get_parser_line_col ( DB_SESSION session,
int *  line,
int *  col 
)

Definition at line 355 of file db_vdb.c.

References parser_context::column, parser_context::line, and db_session::parser.

DB_QUERY_TYPE* db_get_query_type_ptr ( DB_QUERY_RESULT result)

Definition at line 1431 of file db_vdb.c.

References db_query_result::query_type.

Referenced by csql_execute_statements().

Here is the caller graph for this function:

int db_get_start_line ( DB_SESSION session,
int  stmt 
)
DB_NODE* db_get_statement ( DB_SESSION session,
int  id 
)

Definition at line 3729 of file db_vdb.c.

References db_session::statements.

Referenced by uci_static().

Here is the caller graph for this function:

DB_SESSION_WARNING* db_get_warnings ( DB_SESSION session)

Definition at line 985 of file db_vdb.c.

References NULL, db_session::parser, and pt_get_warnings().

DB_CLASS_MODIFICATION_STATUS db_has_modified_class ( DB_SESSION session,
int  stmt_id 
)

Definition at line 2874 of file db_vdb.c.

References assert, DB_CLASS_NOT_MODIFIED, NULL, db_session::parser, pt_has_modified_class(), and db_session::statements.

Referenced by set_host_variables().

Here is the caller graph for this function:

void db_include_oid ( DB_SESSION session,
int  include_oid 
)

Definition at line 1508 of file db_vdb.c.

References db_session::include_oid.

Referenced by db_open_buffer_and_compile_first_statement(), uci_open_cs(), and ux_prepare().

Here is the caller graph for this function:

void db_invalidate_mvcc_snapshot_before_statement ( void  )
bool db_is_input_marker ( DB_MARKER marker)

Definition at line 1299 of file db_vdb.c.

References pt_is_input_hostvar.

bool db_is_output_marker ( DB_MARKER marker)

Definition at line 1318 of file db_vdb.c.

References pt_is_output_hostvar.

DB_SESSION* db_make_session_for_one_statement_execution ( FILE *  file)

Definition at line 276 of file db_vdb.c.

References CHECK_CONNECT_NULL, db_open_local(), parse_one_statement(), db_session::parser, and pt_init_one_statement_parser().

Referenced by ldr_exec_query_from_file().

Here is the caller graph for this function:

DB_DOMAIN* db_marker_domain ( DB_MARKER marker)

Definition at line 1276 of file db_vdb.c.

References parser_node::expected_domain, NULL, and pt_node_to_db_domain().

Referenced by ux_get_parameter_info().

Here is the caller graph for this function:

int db_marker_index ( DB_MARKER marker)

Definition at line 1257 of file db_vdb.c.

References pt_host_var_index().

DB_MARKER* db_marker_next ( DB_MARKER marker)

Definition at line 1238 of file db_vdb.c.

References NULL, and pt_node_next().

Referenced by ux_get_parameter_info().

Here is the caller graph for this function:

int db_number_of_input_markers ( DB_SESSION session,
int  stmt 
)
int db_open_buffer_and_compile_first_statement ( const char *  CSQL_query,
DB_QUERY_ERROR query_error,
int  include_oid,
DB_SESSION **  session,
int *  stmt_no 
)
DB_SESSION* db_open_file ( FILE *  file)

Definition at line 251 of file db_vdb.c.

References CHECK_CONNECT_NULL, db_open_local(), initialize_session(), db_session::parser, parser_parse_file(), and db_session::statements.

Referenced by csql_execute_statements().

Here is the caller graph for this function:

DB_SESSION* db_open_file_name ( const char *  name)
const char* db_parameter_name ( DB_PARAMETER param)

Definition at line 3791 of file db_vdb.c.

References NULL, and pt_string_part().

DB_PARAMETER* db_parameter_next ( DB_PARAMETER param)

Definition at line 3772 of file db_vdb.c.

References NULL, and pt_node_next().

void db_rewind_statement ( DB_SESSION session)

Definition at line 785 of file db_vdb.c.

References db_session::dimension, and db_session::stmt_ndx.

Referenced by ux_execute_all().

Here is the caller graph for this function:

int db_session_is_last_statement ( DB_SESSION session)

Definition at line 799 of file db_vdb.c.

References assert, db_session::dimension, and db_session::stmt_ndx.

Referenced by db_set_statement_auto_commit().

Here is the caller graph for this function:

void db_session_set_holdable ( DB_SESSION session,
bool  holdable 
)

Definition at line 1040 of file db_vdb.c.

References parser_context::flag, parser_context::is_holdable, NULL, and db_session::parser.

Referenced by ux_execute(), and ux_execute_all().

Here is the caller graph for this function:

void db_session_set_return_generated_keys ( DB_SESSION session,
bool  return_generated_keys 
)

Definition at line 1075 of file db_vdb.c.

References parser_context::flag, NULL, db_session::parser, and parser_context::return_generated_keys.

Referenced by ux_execute(), and ux_execute_all().

Here is the caller graph for this function:

void db_session_set_xasl_cache_pinned ( DB_SESSION session,
bool  is_pinned,
bool  recompile 
)

Definition at line 1057 of file db_vdb.c.

References parser_context::flag, parser_context::is_xasl_pinned_reference, NULL, db_session::parser, and parser_context::recompile_xasl_pinned.

Referenced by ux_execute(), ux_execute_all(), ux_execute_array(), and ux_prepare().

Here is the caller graph for this function:

static void db_set_base_server_time ( DB_VALUE db_val)
static

Definition at line 489 of file db_vdb.c.

References base_client_timeb, base_server_timeb, db_datetime::date, db_calculate_current_time(), db_get_datetime(), db_tm_encode(), and db_datetime::time.

Referenced by db_execute_and_keep_statement_local().

Here is the caller graph for this function:

int db_set_client_cache_time ( DB_SESSION session,
int  stmt_ndx,
CACHE_TIME cache_time 
)
void db_set_read_fetch_instance_version ( LC_FETCH_VERSION_TYPE  read_Fetch_Instance_Version)
int db_set_system_generated_statement ( DB_SESSION session)
int db_statement_count ( DB_SESSION session)
static int do_get_prepared_statement_info ( DB_SESSION session,
int  stmt_idx 
)
static

Definition at line 2410 of file db_vdb.c.

References assert, db_prepare_info::auto_param_count, parser_context::auto_param_count, char_array_to_name_list(), cleanup(), pt_execute_info::column_count, db_prepare_info::columns, csession_get_prepared_statement(), CUBRID_STMT_EXECUTE_PREPARE, db_check_limit_need_recompile(), db_init_prepare_info(), db_unpack_prepare_info(), do_set_user_host_variables(), err, pt_statement_info::execute, parser_context::flag, free_and_init, parser_context::host_var_count, db_prepare_info::host_var_expected_domains, parser_context::host_var_expected_domains, db_prepare_info::host_variables, parser_context::host_variables, i, parser_node::info, db_prepare_info::into_count, db_prepare_info::into_list, pt_execute_info::into_list, MRO_CANDIDATE, MRO_IS_USED, pt_execute_info::name, pt_statement_info::name, db_query_type::next, NO_ERROR, NULL, db_prepare_info::oids_included, pt_execute_info::oids_included, pt_name_info::original, db_session::parser, pr_clear_value(), PT_INTERNAL_ERROR, pt_make_string_value(), pt_node_to_cmd_type(), pt_execute_info::query, db_prepare_info::recompile, pt_execute_info::recompile, parser_context::set_host_var, db_value_array::size, SORT_LIMIT_CANDIDATE, SORT_LIMIT_USED, db_prepare_info::statement, db_session::statements, db_prepare_info::stmt_type, pt_execute_info::stmt_type, db_session::type_list, pt_execute_info::using_list, db_value_array::vals, xasl_node_header::xasl_flag, pt_execute_info::xasl_id, XASL_ID_COPY, XASL_ID_IS_NULL, and XASL_ID_SET_NULL.

Referenced by db_compile_statement_local().

Here is the caller graph for this function:

static int do_process_deallocate_prepare ( DB_SESSION session,
PT_NODE statement 
)
static
static int do_process_prepare_statement ( DB_SESSION session,
PT_NODE statement 
)
static

Definition at line 2274 of file db_vdb.c.

References parser_node::alias_print, ARG_FILE_LINE, assert, db_prepare_info::auto_param_count, parser_context::auto_param_count, parser_varchar::bytes, cleanup(), db_prepare_info::columns, csession_create_prepared_statement(), csession_delete_prepared_statement(), CUBRID_STMT_SELECT, pt_value_info::data_value, db_check_single_query(), db_close_session_local(), db_compile_statement_local(), db_init_prepare_info(), db_open_buffer_local(), db_pack_prepare_info(), db_session::dimension, ER_CANNOT_PREPARE_WITH_HOST_VAR, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_IT_IS_DISALLOWED_AS_PREPARED, ER_IT_MULTIPLE_STATEMENT, er_set(), er_stack_pop(), er_stack_push(), err, parser_node::flag, free_and_init, parser_context::host_var_count, db_prepare_info::host_var_expected_domains, parser_context::host_var_expected_domains, db_prepare_info::host_variables, parser_context::host_variables, i, db_session::include_oid, parser_node::info, db_prepare_info::into_count, db_prepare_info::into_list, is_allowed_as_prepared_statement(), is_allowed_as_prepared_statement_with_hv(), pt_prepare_info::name, pt_statement_info::name, NO_ERROR, parser_node::node_type, NULL, db_prepare_info::oids_included, pt_query_info::oids_included, pt_name_info::original, db_session::parser, pt_statement_info::prepare, pt_node_to_cmd_type(), PT_PREPARE_STATEMENT, pt_show_node_type(), pt_statement_info::query, db_prepare_info::recompile, parser_node::recompile, set_prepare_info_into_list(), db_value_array::size, db_prepare_info::statement, pt_prepare_info::statement, db_session::statements, db_prepare_info::stmt_type, pt_data_value::str, db_session::type_list, db_value_array::vals, and pt_statement_info::value.

Referenced by db_execute_and_keep_statement_local().

Here is the caller graph for this function:

static int get_dimension_of ( PT_NODE **  array)
static

Definition at line 108 of file db_vdb.c.

Referenced by db_parse_one_statement(), db_statement_count(), and initialize_session().

Here is the caller graph for this function:

static DB_SESSION * initialize_session ( DB_SESSION session)
static

Definition at line 190 of file db_vdb.c.

References assert, db_session::dimension, get_dimension_of(), NULL, and db_session::statements.

Referenced by db_open_buffer_local(), db_open_file(), and db_open_file_name().

Here is the caller graph for this function:

static bool is_allowed_as_prepared_statement ( PT_NODE node)
static

Definition at line 2811 of file db_vdb.c.

References assert, parser_node::node_type, PT_DEALLOCATE_PREPARE, PT_EXECUTE_PREPARE, and PT_PREPARE_STATEMENT.

Referenced by do_process_prepare_statement().

Here is the caller graph for this function:

static int is_vclass_object ( MOBJ  class_)
static

Definition at line 3400 of file db_vdb.c.

References sm_get_class_type(), and SM_VCLASS_CT.

Referenced by db_get_all_vclasses().

Here is the caller graph for this function:

static DB_CLASS_MODIFICATION_STATUS pt_has_modified_class ( PARSER_CONTEXT parser,
PT_NODE statement 
)
static

Definition at line 3917 of file db_vdb.c.

References DB_CLASS_NOT_MODIFIED, NULL, and parser_walk_tree().

Referenced by db_execute_and_keep_statement_local(), and db_has_modified_class().

Here is the caller graph for this function:

static void update_execution_values ( PARSER_CONTEXT parser,
int  result,
CUBRID_STMT_TYPE  statement_type 
)
static

Variable Documentation

struct timeb base_client_timeb = { 0, 0, 0, 0 }
static

Definition at line 72 of file db_vdb.c.

Referenced by db_calculate_current_server_time(), and db_set_base_server_time().

struct timeb base_server_timeb = { 0, 0, 0, 0 }
static