CUBRID Engine  latest
session.h File Reference
#include "dbtype_def.h"
#include "load_session.hpp"
#include "query_list.h"
#include "query_manager.h"
#include "system_parameter.h"
#include "thread_compat.hpp"
#include "tz_support.h"
Include dependency graph for session.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void session_states_init (THREAD_ENTRY *thread_p)
 
void session_states_finalize (THREAD_ENTRY *thread_p)
 
int session_state_create (THREAD_ENTRY *thread_p, SESSION_ID *id)
 
int session_state_destroy (THREAD_ENTRY *thread_p, const SESSION_ID id)
 
int session_check_session (THREAD_ENTRY *thread_p, const SESSION_ID id)
 
int session_get_session_id (THREAD_ENTRY *thread_p, SESSION_ID *id)
 
int session_get_last_insert_id (THREAD_ENTRY *thread_p, DB_VALUE *value, bool update_last_insert_id)
 
int session_set_cur_insert_id (THREAD_ENTRY *thread_p, const DB_VALUE *value, bool force)
 
int session_reset_cur_insert_id (THREAD_ENTRY *thread_p)
 
int session_begin_insert_values (THREAD_ENTRY *thread_p)
 
int session_set_trigger_state (THREAD_ENTRY *thread_p, bool is_trigger)
 
int session_get_row_count (THREAD_ENTRY *thread_p, int *row_count)
 
int session_set_row_count (THREAD_ENTRY *thread_p, const int row_count)
 
int session_get_session_parameters (THREAD_ENTRY *thread_p, SESSION_PARAM **session_parameters)
 
int session_set_session_parameters (THREAD_ENTRY *thread_p, SESSION_PARAM *session_parameters)
 
int session_create_prepared_statement (THREAD_ENTRY *thread_p, char *name, char *alias_print, SHA1Hash *sha1, char *info, int info_len)
 
int session_get_prepared_statement (THREAD_ENTRY *thread_p, const char *name, char **info, int *info_len, xasl_cache_ent **xasl_entry)
 
int session_delete_prepared_statement (THREAD_ENTRY *thread_p, const char *name)
 
int login_user (THREAD_ENTRY *thread_p, const char *username)
 
int session_set_session_variables (THREAD_ENTRY *thread_p, DB_VALUE *values, const int count)
 
int session_get_variable (THREAD_ENTRY *thread_p, const DB_VALUE *name, DB_VALUE *result)
 
int session_get_variable_no_copy (THREAD_ENTRY *thread_p, const DB_VALUE *name, DB_VALUE **result)
 
int session_define_variable (THREAD_ENTRY *thread_p, DB_VALUE *name, DB_VALUE *value, DB_VALUE *result)
 
int session_drop_session_variables (THREAD_ENTRY *thread_p, DB_VALUE *values, const int count)
 
void session_states_dump (THREAD_ENTRY *thread_p)
 
void session_store_query_entry_info (THREAD_ENTRY *thread_p, QMGR_QUERY_ENTRY *qentry_p)
 
int session_load_query_entry_info (THREAD_ENTRY *thread_p, QMGR_QUERY_ENTRY *qentry_p)
 
int session_remove_query_entry_info (THREAD_ENTRY *thread_p, const QUERY_ID query_id)
 
int session_clear_query_entry_info (THREAD_ENTRY *thread_p, const QUERY_ID query_id)
 
bool session_is_queryid_idle (THREAD_ENTRY *thread_p, const QUERY_ID query_id, QUERY_ID *max_query_id_uses)
 
int session_get_exec_stats_and_clear (THREAD_ENTRY *thread_p, const DB_VALUE *name, DB_VALUE *result)
 
SESSION_PARAMsession_get_session_parameter (THREAD_ENTRY *thread_p, PARAM_ID id)
 
int session_get_trace_stats (THREAD_ENTRY *thread_p, DB_VALUE *result)
 
int session_set_trace_stats (THREAD_ENTRY *thread_p, char *scan_stats, int format)
 
int session_clear_trace_stats (THREAD_ENTRY *thread_p)
 
TZ_REGIONsession_get_session_tz_region (THREAD_ENTRY *thread_p)
 
int session_get_number_of_holdable_cursors (void)
 
int session_get_private_lru_idx (const void *session_p)
 
int session_set_tran_auto_commit (THREAD_ENTRY *thread_p, bool auto_commit)
 
int session_set_load_session (THREAD_ENTRY *thread_p, load_session *load_session_p)
 
int session_get_load_session (THREAD_ENTRY *thread_p, REFPTR(load_session, load_session_ref_ptr))
 
void session_stop_attached_threads (void *session)
 

Function Documentation

int login_user ( THREAD_ENTRY thread_p,
const char *  username 
)

Definition at line 1917 of file session.c.

References log_tdes::client, LOG_FIND_TDES(), LOG_FIND_THREAD_TRAN_INDEX, NO_ERROR, NULL, and clientids::set_user().

Referenced by xlogin_user().

Here is the caller graph for this function:

int session_begin_insert_values ( THREAD_ENTRY thread_p)

Definition at line 1506 of file session.c.

References ER_FAILED, session_state::is_last_insert_id_generated, session_state::is_trigger_involved, NO_ERROR, NULL, and session_get_session_state().

Referenced by qexec_execute_insert().

Here is the caller graph for this function:

int session_clear_query_entry_info ( THREAD_ENTRY thread_p,
const QUERY_ID  query_id 
)
int session_clear_trace_stats ( THREAD_ENTRY thread_p)
int session_define_variable ( THREAD_ENTRY thread_p,
DB_VALUE name,
DB_VALUE value,
DB_VALUE result 
)

Definition at line 1970 of file session.c.

References assert, db_make_null(), DB_TYPE_CHAR, DB_VALUE_DOMAIN_TYPE, ER_FAILED, err, NO_ERROR, NULL, pr_clone_value(), session_add_variable(), and session_get_session_state().

Referenced by fetch_peek_arith().

Here is the caller graph for this function:

int session_drop_session_variables ( THREAD_ENTRY thread_p,
DB_VALUE values,
const int  count 
)

Definition at line 2157 of file session.c.

References session_info::count, ER_FAILED, i, NO_ERROR, NULL, session_drop_variable(), and session_get_session_state().

Referenced by xsession_drop_session_variables().

Here is the caller graph for this function:

int session_get_exec_stats_and_clear ( THREAD_ENTRY thread_p,
const DB_VALUE name,
DB_VALUE result 
)

Definition at line 2187 of file session.c.

References assert, db_get_string(), db_make_bigint(), DB_TYPE_CHAR, DB_VALUE_DOMAIN_TYPE, and NO_ERROR.

Referenced by fetch_peek_arith().

Here is the caller graph for this function:

int session_get_last_insert_id ( THREAD_ENTRY thread_p,
DB_VALUE value,
bool  update_last_insert_id 
)
int session_get_load_session ( THREAD_ENTRY thread_p,
REFPTR(load_session, load_session_ref_ptr)   
)
int session_get_number_of_holdable_cursors ( void  )

Definition at line 3070 of file session.c.

References active_sessions::num_holdable_cursors.

Referenced by perfmon_get_peek_stats().

Here is the caller graph for this function:

int session_get_private_lru_idx ( const void *  session_p)

Definition at line 3084 of file session.c.

Referenced by css_server_task::execute(), and css_server_external_task::execute().

Here is the caller graph for this function:

int session_get_row_count ( THREAD_ENTRY thread_p,
int *  row_count 
)

Definition at line 1562 of file session.c.

References assert, ER_FAILED, NO_ERROR, NULL, session_state::row_count, and session_get_session_state().

Referenced by fetch_peek_arith(), and xsession_get_row_count().

Here is the caller graph for this function:

int session_get_session_id ( THREAD_ENTRY thread_p,
SESSION_ID id 
)

Definition at line 1347 of file session.c.

References assert, db_Session_id, ER_FAILED, NO_ERROR, and NULL.

Referenced by session_get_session_state(), and session_get_variable_no_copy().

Here is the caller graph for this function:

SESSION_PARAM* session_get_session_parameter ( THREAD_ENTRY thread_p,
PARAM_ID  id 
)
int session_get_session_parameters ( THREAD_ENTRY thread_p,
SESSION_PARAM **  session_parameters 
)

Definition at line 1613 of file session.c.

References assert, ER_FAILED, free_and_init, NO_ERROR, NULL, session_get_session_state(), and session_state::session_parameters.

Referenced by sysprm_get_id().

Here is the caller graph for this function:

bool session_is_queryid_idle ( THREAD_ENTRY thread_p,
const QUERY_ID  query_id,
QUERY_ID *  max_query_id_uses 
)

Definition at line 2647 of file session.c.

References session_query_entry::next, NULL, session_state::queries, session_query_entry::query_id, and session_get_session_state().

Referenced by qmgr_allocate_query_entry().

Here is the caller graph for this function:

int session_load_query_entry_info ( THREAD_ENTRY thread_p,
QMGR_QUERY_ENTRY qentry_p 
)
int session_remove_query_entry_info ( THREAD_ENTRY thread_p,
const QUERY_ID  query_id 
)
int session_reset_cur_insert_id ( THREAD_ENTRY thread_p)
int session_set_load_session ( THREAD_ENTRY thread_p,
load_session load_session_p 
)

Definition at line 3113 of file session.c.

References ER_FAILED, session_state::load_session_p, NO_ERROR, NULL, and session_get_session_state().

Referenced by sloaddb_destroy(), and sloaddb_init().

Here is the caller graph for this function:

int session_set_row_count ( THREAD_ENTRY thread_p,
const int  row_count 
)

Definition at line 1586 of file session.c.

References ARG_FILE_LINE, ER_FAILED, er_log_debug, session_state::id, NO_ERROR, NULL, session_state::row_count, and session_get_session_state().

Referenced by xsession_set_row_count().

Here is the caller graph for this function:

int session_set_session_parameters ( THREAD_ENTRY thread_p,
SESSION_PARAM session_parameters 
)

Definition at line 1641 of file session.c.

References assert, ER_FAILED, NO_ERROR, NULL, session_get_session_state(), and session_state::session_parameters.

Referenced by sysprm_get_id().

Here is the caller graph for this function:

int session_set_session_variables ( THREAD_ENTRY thread_p,
DB_VALUE values,
const int  count 
)

Definition at line 1939 of file session.c.

References assert, session_info::count, ER_FAILED, i, NO_ERROR, NULL, session_add_variable(), and session_get_session_state().

Referenced by xsession_set_session_variables().

Here is the caller graph for this function:

int session_set_trace_stats ( THREAD_ENTRY thread_p,
char *  scan_stats,
int  format 
)

Definition at line 2888 of file session.c.

References ER_FAILED, free_and_init, NO_ERROR, NULL, session_get_session_state(), session_state::trace_format, and session_state::trace_stats.

Referenced by qexec_clear_regu_variable_list().

Here is the caller graph for this function:

int session_set_tran_auto_commit ( THREAD_ENTRY thread_p,
bool  auto_commit 
)

Definition at line 3097 of file session.c.

References session_state::auto_commit, ER_FAILED, NO_ERROR, NULL, and session_get_session_state().

Referenced by xsession_set_tran_auto_commit().

Here is the caller graph for this function:

int session_set_trigger_state ( THREAD_ENTRY thread_p,
bool  is_trigger 
)

Definition at line 1534 of file session.c.

References ER_FAILED, session_state::is_trigger_involved, NO_ERROR, NULL, and session_get_session_state().

Referenced by xqmgr_execute_query(), and xqmgr_prepare_and_execute_query().

Here is the caller graph for this function:

void session_states_dump ( THREAD_ENTRY thread_p)

Definition at line 2208 of file session.c.

References cubthread::lockfree_hashmap< Key, T >::get_element_count(), NULL, session_dump_session(), and active_sessions::states_hashmap.

Referenced by session_states_finalize().

Here is the caller graph for this function:

void session_states_finalize ( THREAD_ENTRY thread_p)
void session_stop_attached_threads ( void *  session)

Definition at line 3150 of file session.c.

References assert, cubload::session::interrupt(), session_state::load_session_p, NULL, and cubload::session::wait_for_completion().

Referenced by session_state_uninit(), and ssession_stop_attached_threads().

Here is the caller graph for this function: