CUBRID Engine
latest
|
#include <assert.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "system.h"
#include "session.h"
#include "boot_sr.h"
#include "jansson.h"
#include "critical_section.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "environment_variable.h"
#include "db.h"
#include "lock_free.h"
#include "object_primitive.h"
#include "dbtype.h"
#include "string_opfunc.h"
#include "thread_daemon.hpp"
#include "thread_entry_task.hpp"
#include "thread_lockfree_hash_map.hpp"
#include "thread_manager.hpp"
#include "xasl_cache.h"
Go to the source code of this file.
Classes | |
struct | session_info |
struct | session_variable |
struct | prepared_statement |
struct | session_query_entry |
struct | session_state |
struct | active_sessions |
Macros | |
#define | pthread_mutex_init(a, b) |
#define | pthread_mutex_destroy(a) |
#define | pthread_mutex_lock(a) 0 |
#define | pthread_mutex_trylock(a) 0 |
#define | pthread_mutex_unlock(a) |
#define | SESSIONS_HASH_SIZE 1000 |
#define | MAX_SESSION_VARIABLES_COUNT 20 |
#define | MAX_PREPARED_STATEMENTS_COUNT 20 |
#define | EXPIRED_SESSION_BUFFER_SIZE 1024 |
Typedefs | |
typedef struct session_info | SESSION_INFO |
typedef struct session_variable | SESSION_VARIABLE |
typedef struct prepared_statement | PREPARED_STATEMENT |
typedef struct session_query_entry | SESSION_QUERY_ENTRY |
typedef struct session_state | SESSION_STATE |
using | session_hashmap_type = cubthread::lockfree_hashmap< SESSION_ID, session_state > |
using | session_hashmap_iterator = session_hashmap_type::iterator |
typedef struct active_sessions | ACTIVE_SESSIONS |
Variables | |
static int | rv |
static LF_ENTRY_DESCRIPTOR | session_state_Descriptor |
static ACTIVE_SESSIONS | sessions |
static cubthread::daemon * | session_Control_daemon = NULL |
#define EXPIRED_SESSION_BUFFER_SIZE 1024 |
Referenced by session_remove_expired_sessions().
#define MAX_PREPARED_STATEMENTS_COUNT 20 |
Definition at line 68 of file session.c.
Referenced by session_create_prepared_statement().
#define MAX_SESSION_VARIABLES_COUNT 20 |
Definition at line 67 of file session.c.
Referenced by session_add_variable().
#define pthread_mutex_destroy | ( | a | ) |
Definition at line 59 of file session.c.
Referenced by session_state_free(), and session_state::~session_state().
#define pthread_mutex_init | ( | a, | |
b | |||
) |
Definition at line 58 of file session.c.
Referenced by session_state::session_state(), and session_state_alloc().
#define pthread_mutex_unlock | ( | a | ) |
Definition at line 62 of file session.c.
Referenced by session_check_session(), session_get_session_state(), session_get_variable_no_copy(), session_remove_expired_sessions(), session_state_create(), and session_state_destroy().
#define SESSIONS_HASH_SIZE 1000 |
Definition at line 66 of file session.c.
Referenced by session_states_init().
typedef struct active_sessions ACTIVE_SESSIONS |
typedef struct prepared_statement PREPARED_STATEMENT |
using session_hashmap_iterator = session_hashmap_type::iterator |
typedef struct session_info SESSION_INFO |
typedef struct session_query_entry SESSION_QUERY_ENTRY |
typedef struct session_state SESSION_STATE |
typedef struct session_variable SESSION_VARIABLE |
Definition at line 1172 of file session.c.
References ARG_FILE_LINE, assert, db_get_string(), db_get_string_codeset(), db_get_string_collation(), db_get_string_size(), DB_IS_NULL, db_make_bit(), db_make_char(), db_make_nchar(), db_make_null(), db_make_varbit(), db_make_varchar(), db_make_varnchar(), DB_TYPE_BIT, DB_TYPE_CHAR, DB_TYPE_NCHAR, db_type_to_db_domain(), DB_TYPE_VARBIT, DB_TYPE_VARCHAR, DB_TYPE_VARNCHAR, db_value_domain_init(), DB_VALUE_DOMAIN_TYPE, db_value_precision(), DOMAIN_COMPATIBLE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), free_and_init, db_value::need_clear, NULL, pr_clear_value(), pr_clone_value(), tp_domain::precision, QSTR_IS_ANY_CHAR_OR_BIT, TP_FLOATING_PRECISION_VALUE, TP_IS_NUMERIC_TYPE, and tp_value_cast().
Referenced by session_add_variable(), and update_session_variable().
|
static |
Definition at line 1031 of file session.c.
References db_char::buf, db_data::ch, db_value::data, DB_VALUE_DOMAIN_TYPE, free_and_init, db_char::medium, session_variable::name, NULL, QSTR_IS_ANY_CHAR_OR_BIT, and session_variable::value.
Referenced by session_drop_variable(), and session_state_uninit().
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().
|
static |
Definition at line 2329 of file session.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), session_query_entry::list_id, qmgr_query_entry::list_id, session_query_entry::next, NULL, session_query_entry::num_tmp, qmgr_query_entry::num_tmp, session_query_entry::query_flag, qmgr_query_entry::query_flag, session_query_entry::query_id, qmgr_query_entry::query_id, session_query_entry::temp_file, qmgr_query_entry::temp_vfid, session_query_entry::total_count, and qmgr_query_entry::total_count.
Referenced by session_store_query_entry_info().
|
static |
Definition at line 2416 of file session.c.
References qmgr_query_entry::er_msg, qmgr_query_entry::is_holdable, qmgr_query_entry::list_ent, session_query_entry::list_id, qmgr_query_entry::list_id, NULL, session_query_entry::num_tmp, qmgr_query_entry::num_tmp, QUERY_COMPLETED, session_query_entry::query_flag, qmgr_query_entry::query_flag, session_query_entry::query_id, qmgr_query_entry::query_id, qmgr_query_entry::query_status, session_query_entry::temp_file, qmgr_query_entry::temp_vfid, session_query_entry::total_count, qmgr_query_entry::total_count, qmgr_query_entry::xasl_ent, qmgr_query_entry::xasl_id, and XASL_ID_SET_NULL.
Referenced by session_load_query_entry_info().
|
static |
Definition at line 1064 of file session.c.
References ARG_FILE_LINE, assert, session_info::count, db_get_int(), db_get_string(), db_get_string_size(), DB_TYPE_CHAR, db_value_alloc_and_copy(), DB_VALUE_DOMAIN_TYPE, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, ER_SES_TOO_MANY_VARIABLES, er_set(), error(), free_and_init, intl_identifier_casecmp(), MAX_SESSION_VARIABLES_COUNT, session_variable::name, session_variable::next, NO_ERROR, NULL, session_state::plan_string, pr_clear_value(), session_state::session_variables, strdup(), strlen, update_session_variable(), and session_variable::value.
Referenced by session_define_variable(), and session_set_session_variables().
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().
int session_check_session | ( | THREAD_ENTRY * | thread_p, |
const SESSION_ID | id | ||
) |
Definition at line 810 of file session.c.
References session_state::active_time, ARG_FILE_LINE, assert, DB_EMPTY_SESSION, ER_FAILED, er_log_debug, ER_SES_SESSION_EXPIRED, er_set(), ER_WARNING_SEVERITY, error(), cubthread::lockfree_hashmap< Key, T >::find(), logtb_set_current_user_active(), session_state::mutex, NO_ERROR, NULL, pthread_mutex_unlock, session_set_conn_entry_data(), and active_sessions::states_hashmap.
Referenced by xsession_check_session().
|
static |
Definition at line 976 of file session.c.
References session_state::active_time, ARG_FILE_LINE, session_info::count, css_get_session_ids_for_active_connections(), er_log_debug, err, i, session_state::id, NO_ERROR, NULL, prm_get_integer_value(), PRM_ID_SESSION_STATE_TIMEOUT, and session_info::session_ids.
Referenced by session_remove_expired_sessions().
int session_clear_query_entry_info | ( | THREAD_ENTRY * | thread_p, |
const QUERY_ID | query_id | ||
) |
Definition at line 2601 of file session.c.
References ER_FAILED, free_and_init, session_query_entry::next, NO_ERROR, NULL, active_sessions::num_holdable_cursors, session_state::queries, session_query_entry::query_id, and session_get_session_state().
Referenced by xsession_clear_query_entry_info().
int session_clear_trace_stats | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2916 of file session.c.
References assert, ER_FAILED, free_and_init, NO_ERROR, NULL, session_state::plan_string, session_get_session_state(), thread_need_clear_trace(), thread_set_clear_trace(), and session_state::trace_stats.
Referenced by qexec_execute_query().
|
static |
Referenced by session_free_prepared_statement(), and session_states_finalize().
|
static |
Referenced by session_free_prepared_statement(), and session_states_init().
int session_create_prepared_statement | ( | THREAD_ENTRY * | thread_p, |
char * | name, | ||
char * | alias_print, | ||
SHA1Hash * | sha1, | ||
char * | info, | ||
int | info_len | ||
) |
Definition at line 1674 of file session.c.
References prepared_statement::alias_print, ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, er_log_debug, ER_OUT_OF_VIRTUAL_MEMORY, ER_SES_TOO_MANY_STATEMENTS, er_set(), err, error(), free_and_init, session_state::id, prepared_statement::info, prepared_statement::info_length, intl_identifier_casecmp(), MAX_PREPARED_STATEMENTS_COUNT, prepared_statement::name, prepared_statement::next, NO_ERROR, NULL, session_free_prepared_statement(), session_get_session_state(), prepared_statement::sha1, and session_state::statements.
Referenced by xsession_create_prepared_statement().
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().
int session_delete_prepared_statement | ( | THREAD_ENTRY * | thread_p, |
const char * | name | ||
) |
Definition at line 1865 of file session.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, ER_IT_PREPARED_NAME_NOT_FOUND, er_log_debug, er_set(), session_state::id, intl_identifier_casecmp(), prepared_statement::name, prepared_statement::next, NO_ERROR, NULL, session_free_prepared_statement(), session_get_session_state(), and session_state::statements.
Referenced by xsession_delete_prepared_statement().
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().
|
static |
Definition at line 1298 of file session.c.
References assert, db_get_string(), DB_TYPE_CHAR, DB_VALUE_DOMAIN_TYPE, free_session_variable(), intl_identifier_casecmp(), session_variable::name, session_variable::next, NO_ERROR, NULL, and session_state::session_variables.
Referenced by session_drop_session_variables().
|
static |
Definition at line 2303 of file session.c.
References prepared_statement::alias_print, prepared_statement::name, NULL, prepared_statement::sha1, and SHA1_AS_ARGS.
Referenced by session_dump_session().
|
static |
Definition at line 2231 of file session.c.
References session_state::auto_commit, db_get_string(), db_type_to_db_domain(), DB_TYPE_VARCHAR, db_value_clear(), db_value_coerce(), session_state::id, session_state::last_insert_id, session_variable::next, prepared_statement::next, NO_ERROR, NULL, session_state::row_count, session_dump_prepared_statement(), session_dump_variable(), session_state::session_variables, and session_state::statements.
Referenced by session_states_dump().
|
static |
Definition at line 2275 of file session.c.
References db_get_string(), db_type_to_db_domain(), DB_TYPE_VARCHAR, db_value_clear(), db_value_coerce(), session_variable::name, NULL, and session_variable::value.
Referenced by session_dump_session().
|
static |
Definition at line 506 of file session.c.
References prepared_statement::alias_print, ARG_FILE_LINE, assert, BO_IS_SERVER_RESTARTED, cubthread::manager::create_daemon(), cubthread::manager::destroy_daemon(), er_log_debug, free_and_init, cubthread::get_manager(), prepared_statement::info, prepared_statement::name, NULL, session_control_daemon_destroy(), session_control_daemon_init(), and session_remove_expired_sessions().
Referenced by session_create_prepared_statement(), session_delete_prepared_statement(), and session_state_uninit().
|
static |
Definition at line 2497 of file session.c.
References session_query_entry::list_id, NULL, active_sessions::num_holdable_cursors, qfile_close_list(), qfile_free_list_id(), qmgr_free_temp_file_list(), session_query_entry::query_id, and session_query_entry::temp_file.
Referenced by session_remove_query_entry_info(), and session_state_uninit().
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().
int session_get_last_insert_id | ( | THREAD_ENTRY * | thread_p, |
DB_VALUE * | value, | ||
bool | update_last_insert_id | ||
) |
Definition at line 1381 of file session.c.
References assert, session_state::cur_insert_id, DB_IS_NULL, ER_FAILED, session_state::is_trigger_involved, session_state::last_insert_id, NO_ERROR, NULL, pr_clear_value(), pr_clone_value(), and session_get_session_state().
Referenced by fetch_peek_arith(), and xsession_get_last_insert_id().
int session_get_load_session | ( | THREAD_ENTRY * | thread_p, |
REFPTR(load_session, load_session_ref_ptr) | |||
) |
Definition at line 3129 of file session.c.
References ER_FAILED, session_state::load_session_p, NO_ERROR, NULL, and session_get_session_state().
Referenced by sloaddb_destroy(), sloaddb_fetch_status(), sloaddb_install_class(), sloaddb_interrupt(), sloaddb_load_batch(), and sloaddb_update_stats().
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().
int session_get_prepared_statement | ( | THREAD_ENTRY * | thread_p, |
const char * | name, | ||
char ** | info, | ||
int * | info_len, | ||
xasl_cache_ent ** | xasl_entry | ||
) |
Definition at line 1786 of file session.c.
References prepared_statement::alias_print, ARG_FILE_LINE, assert, ASSERT_ERROR, ER_ERROR_SEVERITY, ER_FAILED, ER_IT_PREPARED_NAME_NOT_FOUND, er_log_debug, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), err, session_state::id, prepared_statement::info, prepared_statement::info_length, intl_identifier_casecmp(), prepared_statement::name, prepared_statement::next, NO_ERROR, NULL, session_get_session_state(), prepared_statement::sha1, session_state::statements, XASL_CACHE_SEARCH_GENERIC, and xcache_find_sha1().
Referenced by xsession_get_prepared_statement().
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().
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().
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().
SESSION_PARAM* session_get_session_parameter | ( | THREAD_ENTRY * | thread_p, |
PARAM_ID | id | ||
) |
Definition at line 2714 of file session.c.
References assert, session_info::count, i, NULL, session_param::prm_id, PRM_LAST_ID, session_get_session_state(), session_state::session_parameters, and sysprm_get_session_parameters_count().
Referenced by prm_get_value(), prm_set_default(), and sysprm_set_value().
int session_get_session_parameters | ( | THREAD_ENTRY * | thread_p, |
SESSION_PARAM ** | session_parameters_ptr | ||
) |
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().
|
static |
Definition at line 2745 of file session.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_SES_SESSION_EXPIRED, er_set(), error(), cubthread::lockfree_hashmap< Key, T >::find(), session_state::mutex, NO_ERROR, NULL, pthread_mutex_unlock, session_get_session_id(), active_sessions::states_hashmap, thread_get_thread_entry_info(), and TT_WORKER.
Referenced by session_begin_insert_values(), session_clear_query_entry_info(), session_clear_trace_stats(), session_create_prepared_statement(), session_define_variable(), session_delete_prepared_statement(), session_drop_session_variables(), session_get_last_insert_id(), session_get_load_session(), session_get_prepared_statement(), session_get_row_count(), session_get_session_parameter(), session_get_session_parameters(), session_get_session_tz_region(), session_get_trace_stats(), session_get_variable(), session_is_queryid_idle(), session_load_query_entry_info(), session_remove_query_entry_info(), session_reset_cur_insert_id(), session_set_cur_insert_id(), session_set_load_session(), session_set_row_count(), session_set_session_parameters(), session_set_session_variables(), session_set_trace_stats(), session_set_tran_auto_commit(), session_set_trigger_state(), and session_store_query_entry_info().
TZ_REGION* session_get_session_tz_region | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2950 of file session.c.
References assert, css_Active_conn_anchor, END_SHARED_ACCESS_ACTIVE_CONN_ANCHOR, ER_FAILED, session_state::id, css_conn_entry::next, NO_ERROR, NULL, session_state::ref_count, session_get_session_state(), css_conn_entry::session_id, session_state::session_tz_region, and START_SHARED_ACCESS_ACTIVE_CONN_ANCHOR.
Referenced by sysprm_get_id(), sysprm_set_value(), and tz_get_client_tz_region_session().
int session_get_trace_stats | ( | THREAD_ENTRY * | thread_p, |
DB_VALUE * | result | ||
) |
Definition at line 2798 of file session.c.
References db_make_null(), db_make_string(), ER_FAILED, free_and_init, NO_ERROR, NULL, session_state::plan_string, port_close_memstream(), port_open_memstream(), pr_clone_value(), QUERY_TRACE_JSON, QUERY_TRACE_TEXT, session_get_session_state(), thread_set_clear_trace(), session_state::trace_format, and session_state::trace_stats.
Referenced by fetch_peek_arith().
int session_get_variable | ( | THREAD_ENTRY * | thread_p, |
const DB_VALUE * | name, | ||
DB_VALUE * | result | ||
) |
Definition at line 2003 of file session.c.
References ARG_FILE_LINE, assert, db_get_string(), DB_TYPE_CHAR, DB_VALUE_DOMAIN_TYPE, ER_ERROR_SEVERITY, ER_FAILED, ER_SES_VARIABLE_NOT_FOUND, er_set(), free_and_init, intl_identifier_casecmp(), session_variable::name, session_variable::next, NO_ERROR, NULL, pr_clone_value(), session_get_session_state(), session_state::session_variables, strlen, and session_variable::value.
Referenced by fetch_peek_arith(), and xsession_get_session_variable().
int session_get_variable_no_copy | ( | THREAD_ENTRY * | thread_p, |
const DB_VALUE * | name, | ||
DB_VALUE ** | result | ||
) |
Definition at line 2069 of file session.c.
References ARG_FILE_LINE, assert, db_get_string(), DB_TYPE_CHAR, DB_VALUE_DOMAIN_TYPE, ER_ERROR_SEVERITY, ER_FAILED, ER_SES_SESSION_EXPIRED, ER_SES_VARIABLE_NOT_FOUND, er_set(), cubthread::lockfree_hashmap< Key, T >::find(), free_and_init, session_state::mutex, session_variable::name, session_variable::next, NO_ERROR, NULL, pthread_mutex_unlock, session_get_session_id(), session_state::session_variables, active_sessions::states_hashmap, strlen, and session_variable::value.
Referenced by xsession_get_session_variable_no_copy().
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().
|
static |
|
static |
|
static |
|
static |
int session_load_query_entry_info | ( | THREAD_ENTRY * | thread_p, |
QMGR_QUERY_ENTRY * | qentry_p | ||
) |
Definition at line 2525 of file session.c.
References ER_FAILED, session_query_entry::next, NO_ERROR, NULL, session_state::queries, session_query_entry::query_id, qmgr_query_entry::query_id, sentry_to_qentry(), and session_get_session_state().
Referenced by xsession_load_query_entry_info().
|
static |
Definition at line 2365 of file session.c.
References assert, file_temp_preserve(), session_query_entry::list_id, qmgr_temp_file::next, NO_ERROR, NULL, qfile_list_id::page_cnt, qmgr_temp_file::preserved, qmgr_temp_file::prev, session_query_entry::temp_file, qmgr_temp_file::temp_vfid, and VFID_ISNULL.
Referenced by session_store_query_entry_info().
|
static |
Definition at line 884 of file session.c.
References assert, assert_release, session_info::count, cubthread::lockfree_hashmap< Key, T >::end_tran(), ER_FAILED, cubthread::lockfree_hashmap< Key, T >::erase(), err, EXPIRED_SESSION_BUFFER_SIZE, free_and_init, session_state::id, session_state::mutex, NO_ERROR, NULL, pthread_mutex_unlock, session_check_timeout(), session_info::session_ids, active_sessions::states_hashmap, and success().
Referenced by session_free_prepared_statement().
int session_remove_query_entry_info | ( | THREAD_ENTRY * | thread_p, |
const QUERY_ID | query_id | ||
) |
Definition at line 2556 of file session.c.
References ER_FAILED, free_and_init, session_query_entry::next, NO_ERROR, NULL, session_state::queries, session_query_entry::query_id, session_free_sentry_data(), and session_get_session_state().
Referenced by xsession_remove_query_entry_info().
int session_reset_cur_insert_id | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 1473 of file session.c.
References session_state::cur_insert_id, ER_FAILED, session_state::is_last_insert_id_generated, session_state::is_trigger_involved, NO_ERROR, NULL, pr_clear_value(), and session_get_session_state().
Referenced by qexec_execute_insert(), and xsession_reset_cur_insert_id().
|
static |
Definition at line 2685 of file session.c.
References session_state::id, NULL, session_state::private_lru_index, and thread_get_thread_entry_info().
Referenced by session_check_session(), and session_state_create().
int session_set_cur_insert_id | ( | THREAD_ENTRY * | thread_p, |
const DB_VALUE * | value, | ||
bool | force | ||
) |
Definition at line 1414 of file session.c.
References session_state::cur_insert_id, DB_IS_NULL, DB_MAX_NUMERIC_PRECISION, DB_TYPE_NUMERIC, DB_VALUE_PRECISION, DB_VALUE_SCALE, DB_VALUE_TYPE, DOMAIN_COMPATIBLE, ER_FAILED, session_state::is_last_insert_id_generated, session_state::is_trigger_involved, session_state::last_insert_id, NO_ERROR, NULL, pr_clear_value(), pr_clone_value(), tp_domain::precision, tp_domain::scale, session_get_session_state(), tp_domain_resolve_default(), and tp_value_cast().
Referenced by xsession_set_cur_insert_id().
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().
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().
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().
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().
int session_set_trace_stats | ( | THREAD_ENTRY * | thread_p, |
char * | 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().
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().
int session_set_trigger_state | ( | THREAD_ENTRY * | thread_p, |
bool | in_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().
|
static |
Definition at line 249 of file session.c.
References session_state::mutex, NULL, and pthread_mutex_init.
int session_state_create | ( | THREAD_ENTRY * | thread_p, |
SESSION_ID * | id | ||
) |
Definition at line 637 of file session.c.
References session_state::active_time, ARG_FILE_LINE, assert, DB_EMPTY_SESSION, ER_FAILED, er_log_debug, cubthread::lockfree_hashmap< Key, T >::find(), session_state::id, cubthread::lockfree_hashmap< Key, T >::insert(), active_sessions::last_session_id, logtb_set_current_user_active(), session_state::mutex, NO_ERROR, NULL, pgbuf_assign_private_lru(), session_state::private_lru_index, prm_get_bool_value(), PRM_ID_ER_LOG_DEBUG, pthread_mutex_unlock, session_set_conn_entry_data(), and active_sessions::states_hashmap.
Referenced by xsession_create_new().
int session_state_destroy | ( | THREAD_ENTRY * | thread_p, |
const SESSION_ID | id | ||
) |
Definition at line 741 of file session.c.
References ARG_FILE_LINE, assert, assert_release, DB_EMPTY_SESSION, ER_FAILED, er_log_debug, ER_SES_SESSION_EXPIRED, er_set(), ER_WARNING_SEVERITY, cubthread::lockfree_hashmap< Key, T >::erase_locked(), error(), cubthread::lockfree_hashmap< Key, T >::find(), logtb_set_current_user_active(), session_state::mutex, NO_ERROR, NULL, pthread_mutex_unlock, session_state::ref_count, session_state_uninit(), active_sessions::states_hashmap, and success().
Referenced by xsession_end_session().
|
static |
|
static |
Definition at line 287 of file session.c.
References session_state::auto_commit, session_state::cur_insert_id, db_make_null(), ER_FAILED, session_state::is_last_insert_id_generated, session_state::is_trigger_involved, session_state::last_insert_id, session_state::load_session_p, NO_ERROR, NULL, session_state::plan_string, session_state::private_lru_index, session_state::queries, QUERY_TRACE_TEXT, session_state::ref_count, session_state::row_count, session_state::session_parameters, session_state::session_variables, session_state::statements, session_state::trace_format, and session_state::trace_stats.
|
static |
Definition at line 323 of file session.c.
References ARG_FILE_LINE, session_state::cur_insert_id, er_log_debug, free_and_init, free_session_variable(), session_state::id, session_state::last_insert_id, session_variable::next, prepared_statement::next, session_query_entry::next, NO_ERROR, NULL, pgbuf_release_private_lru(), session_state::plan_string, pr_clear_value(), session_state::private_lru_index, session_state::queries, session_free_prepared_statement(), session_free_sentry_data(), session_state::session_parameters, session_stop_attached_threads(), session_state::session_variables, session_state::statements, sysprm_free_session_parameters(), thread_get_thread_entry_info(), and session_state::trace_stats.
Referenced by session_state_destroy().
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().
void session_states_finalize | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 607 of file session.c.
References ARG_FILE_LINE, cubthread::lockfree_hashmap< Key, T >::destroy(), envvar_get(), er_log_debug, NULL, session_control_daemon_destroy(), session_states_dump(), and active_sessions::states_hashmap.
Referenced by boot_restart_server(), and xboot_shutdown_server().
void session_states_init | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 582 of file session.c.
References ARG_FILE_LINE, er_log_debug, cubthread::lockfree_hashmap< Key, T >::init(), active_sessions::last_session_id, active_sessions::num_holdable_cursors, session_control_daemon_init(), SESSIONS_HASH_SIZE, sessions_Ts, active_sessions::states_hashmap, and THREAD_TS_SESSIONS.
Referenced by boot_restart_server(), and xboot_initialize_server().
void session_stop_attached_threads | ( | void * | session_arg | ) |
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().
void session_store_query_entry_info | ( | THREAD_ENTRY * | thread_p, |
QMGR_QUERY_ENTRY * | qentry_p | ||
) |
Definition at line 2440 of file session.c.
References assert, qmgr_query_entry::list_id, session_query_entry::next, NULL, active_sessions::num_holdable_cursors, qentry_to_sentry(), session_state::queries, qmgr_query_entry::query_id, session_get_session_state(), session_preserve_temporary_files(), and qmgr_query_entry::temp_vfid.
Referenced by xsession_store_query_entry_info().
|
static |
Definition at line 1276 of file session.c.
References db_char::buf, db_data::ch, db_value::data, db_value_alloc_and_copy(), DB_VALUE_DOMAIN_TYPE, free_and_init, db_char::medium, NULL, QSTR_IS_ANY_CHAR_OR_BIT, and session_variable::value.
Referenced by session_add_variable().
|
static |
|
static |
|
static |