CUBRID Engine  latest
cas.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <assert.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/time.h>
#include "cas_common.h"
#include "cas.h"
#include "cas_network.h"
#include "cas_function.h"
#include "cas_net_buf.h"
#include "cas_log.h"
#include "cas_util.h"
#include "broker_filename.h"
#include "cas_execute.h"
#include "connection_support.h"
#include "perf_monitor.h"
#include "broker_recv_fd.h"
#include "broker_shm.h"
#include "broker_util.h"
#include "broker_env_def.h"
#include "broker_process_size.h"
#include "cas_sql_log2.h"
#include "broker_acl.h"
#include "dbtype.h"
#include "environment_variable.h"
#include "error_manager.h"
#include "ddl_log.h"

Go to the source code of this file.

Macros

#define FUNC_NEEDS_RESTORING_CON_STATUS(func_code)
 

Functions

static FN_RETURN process_request (SOCKET sock_fd, T_NET_BUF *net_buf, T_REQ_INFO *req_info)
 
static int cas_main (void)
 
static int shard_cas_main (void)
 
static void cas_sig_handler (int signo)
 
static int cas_init (void)
 
static void cas_final (void)
 
static void cas_free (bool from_sighandler)
 
static void query_cancel (int signo)
 
static int cas_init_shm (void)
 
static int cas_register_to_proxy (SOCKET proxy_sock_fd)
 
static int net_read_process (SOCKET proxy_sock_fd, MSG_HEADER *client_msg_header, T_REQ_INFO *req_info)
 
static int get_graceful_down_timeout (void)
 
static void set_db_parameter (void)
 
static int net_read_int_keep_con_auto (SOCKET clt_sock_fd, MSG_HEADER *client_msg_header, T_REQ_INFO *req_info)
 
static int net_read_header_keep_con_on (SOCKET clt_sock_fd, MSG_HEADER *client_msg_header)
 
static void set_db_connection_info (void)
 
static void clear_db_connection_info (void)
 
static bool need_database_reconnect (void)
 
int cas_init_ssl (int)
 
void cas_ssl_close (int client_sock_fd)
 
static void set_cas_info_size (void)
 
static void cas_make_session_for_driver (char *out)
 
static void cas_set_session_id (T_CAS_PROTOCOL protocol, char *session)
 
static void cas_send_connect_reply_to_driver (T_CAS_PROTOCOL protocol, SOCKET client_sock_fd, char *cas_info)
 
int main (int argc, char *argv[])
 
void set_hang_check_time (void)
 
void unset_hang_check_time (void)
 
bool check_server_alive (const char *db_name, const char *db_host)
 
int restart_is_needed (void)
 
int query_seq_num_next_value (void)
 
int query_seq_num_current_value (void)
 
T_BROKER_VERSION cas_get_client_version (void)
 

Variables

static const int DEFAULT_CHECK_INTERVAL = 1
 
bool ssl_client
 
static char cas_db_name [MAX_HA_DBINFO_LENGTH]
 
static char cas_db_user [SRV_CON_DBUSER_SIZE]
 
static char cas_db_passwd [SRV_CON_DBPASSWD_SIZE]
 
static int query_sequence_num = 0
 
int cas_shard_flag = OFF
 
int shm_shard_id = SHARD_ID_UNSUPPORTED
 
const char * program_name
 
char broker_name [BROKER_NAME_LEN]
 
int psize_at_start
 
int shm_as_index
 
T_SHM_APPL_SERVERshm_appl
 
T_APPL_SERVER_INFOas_info
 
int shm_proxy_id = -1
 
int shm_shard_cas_id = -1
 
struct timeval tran_start_time
 
struct timeval query_start_time
 
int tran_timeout = 0
 
int query_timeout = 0
 
INT64 query_cancel_time
 
char query_cancel_flag
 
bool autocommit_deferred = false
 
int errors_in_transaction = 0
 
char stripped_column_name
 
char cas_client_type
 
int con_status_before_check_cas
 
bool is_first_request
 
SOCKET new_req_sock_fd = INVALID_SOCKET
 
int cas_default_isolation_level = 0
 
int cas_default_lock_timeout = -1
 
bool cas_default_ansi_quotes = true
 
bool cas_default_no_backslash_escapes = true
 
int cas_send_result_flag = TRUE
 
int cas_info_size = CAS_INFO_SIZE
 
char prev_cas_info [CAS_INFO_SIZE]
 
T_ERROR_INFO err_info
 
static T_SERVER_FUNC server_fn_table []
 
static const char * server_func_name []
 
static T_REQ_INFO req_info
 
static SOCKET srv_sock_fd
 
static int cas_req_count = 0
 

Macro Definition Documentation

#define FUNC_NEEDS_RESTORING_CON_STATUS (   func_code)

Function Documentation

static void cas_final ( void  )
static

Definition at line 1572 of file cas.c.

References cas_free(), ER_ALL_FINAL, er_final(), t_appl_server_info::pid, t_appl_server_info::uts_status, and UTS_STATUS_RESTART.

Referenced by cas_main(), and shard_cas_main().

Here is the caller graph for this function:

T_BROKER_VERSION cas_get_client_version ( void  )

Definition at line 2947 of file cas.c.

References t_req_info::client_version.

Referenced by cas_main(), shard_cas_main(), and ux_get_generated_keys_server_insert().

Here is the caller graph for this function:

int cas_init_ssl ( int  )

Definition at line 86 of file cas_ssl.c.

References cas_log_write(), cas_log_write_and_end(), cas_ssl_validity_check(), CERT_FILENAME_LEN, CERTF, ER_CERT_COPPUPTED, ER_CERT_EXPIRED, ER_SSL_GENERAL, err, KEYF, NULL, SOCKET_BLOCK, SOCKET_NONBLOCK, ssl, and ssl_client.

Referenced by cas_main().

Here is the caller graph for this function:

static int cas_main ( void  )
static

Definition at line 785 of file cas.c.

References t_shm_appl_server::access_control, access_control_check_right(), t_shm_appl_server::access_log, ACL_REJECTED, t_net_buf::alloc_size, APP_NAME_CAS, t_shm_appl_server::appl_server_hard_limit, t_shm_appl_server::appl_server_max_size, ARG_FILE_LINE, as_db_err_log_set(), assert, t_appl_server_info::auto_commit_mode, broker_name, t_shm_appl_server::broker_name, BROKER_PATH_MAX, BROKER_RENEWED_ERROR_CODE, BROKER_SUPPORT_HOLDABLE_RESULT, cas_access_log(), cas_bi_set_cci_pconnect(), cas_bi_set_dbms_type(), cas_bi_set_statement_pooling(), CAS_CLIENT_SERVER_SIDE_JDBC, cas_client_type, t_appl_server_info::cas_client_type, t_appl_server_info::cas_clt_ip, t_appl_server_info::cas_clt_port, CAS_DBMS_MYSQL, CAS_DBMS_ORACLE, cas_default_isolation_level, cas_default_lock_timeout, CAS_ER_COMMUNICATION, CAS_ER_NOT_AUTHORIZED_CLIENT, t_appl_server_info::cas_err_log_reset, CAS_ERROR_INDICATOR, cas_error_log_close(), cas_error_log_open(), cas_final(), cas_get_client_version(), CAS_INFO_RESERVED_DEFAULT, CAS_INFO_SIZE, cas_info_size, CAS_INFO_STATUS, CAS_INFO_STATUS_ACTIVE, CAS_INFO_STATUS_INACTIVE, cas_init_ssl(), cas_log_close(), cas_log_debug(), cas_log_error_handler_begin(), cas_log_error_handler_clear(), cas_log_error_handler_end(), cas_log_open(), CAS_LOG_RESET_REOPEN, cas_log_write2(), cas_log_write_and_end(), CAS_MAKE_VER, CAS_PROTO_CURRENT_VER, CAS_PROTO_TO_VER_STR, CAS_PROTO_VER_MASK, cas_req_count, cas_send_connect_reply_to_driver(), cas_set_db_connect_status(), cas_set_session_id(), cas_shard_flag, cas_slow_log_close(), cas_slow_log_open(), cas_slow_log_write_and_end(), cas_ssl_close(), CAS_VER_TO_MAJOR, CAS_VER_TO_MINOR, CAS_VER_TO_PATCH, t_appl_server_info::cci_default_autocommit, t_shm_appl_server::cci_default_autocommit, t_shm_appl_server::cci_pconnect, CLIENT_CHANGED, t_req_info::client_version, CLOSE_SOCKET, t_appl_server_info::clt_version, t_appl_server_info::con_status, con_status_before_check_cas, CON_STATUS_CLOSE_AND_CONNECT, CON_STATUS_IN_TRAN, t_appl_server_info::cur_keep_con, t_srv_handle::cur_result, t_appl_server_info::cur_sql_log2, t_appl_server_info::cur_statement_pooling, t_net_buf::data, t_appl_server_info::database_host, t_appl_server_info::database_name, DB_EMPTY_SESSION, db_get_session_id(), db_name, DBMS_ERROR_INDICATOR, DOES_CLIENT_UNDERSTAND_THE_PROTOCOL, t_req_info::driver_info, t_appl_server_info::driver_info, DRIVER_INFO_CLIENT_TYPE, DRIVER_INFO_FUNCTION_FLAG, t_appl_server_info::driver_version, ER_ALL_FINAL, er_final(), er_init(), ER_NEVER_EXIT, t_error_info::err_indicator, t_shm_appl_server::err_log_dir, t_error_info::err_number, error_info_clear(), errors_in_transaction, FALSE, FID_CUBRID_ERR_DIR, FN_CLOSE_CONN, FN_KEEP_CONN, FN_KEEP_SESS, t_appl_server_info::fn_status, FN_STATUS_BUSY, FN_STATUS_CONN, FN_STATUS_DONE, FN_STATUS_IDLE, FREE_MEM, getsize(), HEALTH_CHECK_DUMMY_DB, hm_find_srv_handle(), hm_srv_handle_free(), hm_srv_handle_free_all(), is_first_request, IS_INVALID_SOCKET, is_server_aborted(), IS_SSL_CLIENT, is_xa_prepared(), KEEP_CON_AUTO, KEEP_CON_DEFAULT, t_shm_appl_server::keep_connection, t_appl_server_info::last_access_time, libcas_get_db_result_set(), libcas_main(), libcas_srv_handle_free(), logddl_init(), logddl_set_app_name(), logddl_set_br_index(), logddl_set_br_name(), logddl_set_db_name(), logddl_set_ip(), logddl_set_jsp_mode(), logddl_set_logging_enabled(), logddl_set_pid(), logddl_set_start_time(), logddl_set_user_name(), MALLOC, t_req_info::need_rollback, NET_BUF_ALLOC_SIZE, net_buf_clear(), net_buf_destroy(), net_buf_init(), net_connect_client(), NET_DEFAULT_TIMEOUT, net_init_env(), NET_MIN_TIMEOUT, net_read_int(), net_read_stream(), net_timeout_set(), net_write_error(), net_write_int(), net_write_stream(), NEW_CONNECTION, NULL, t_appl_server_info::num_connect_rejected, OFF, ON, ONE_K, prev_cas_info, prm_get_bool_value(), PRM_ID_DDL_AUDIT_LOG, process_request(), PROTOCOL_V1, PROTOCOL_V5, t_appl_server_info::psize, psize_at_start, query_cancel(), query_cancel_flag, query_start_time, query_timeout, recv_fd(), t_appl_server_info::reset_flag, restart_is_needed(), t_appl_server_info::service_ready_flag, t_appl_server_info::session_id, set_cas_info_size(), set_cubrid_file(), set_hang_check_time(), shm_as_index, shm_proxy_id, shm_shard_cas_id, shm_shard_id, t_shm_appl_server::sql_log2, sql_log2_end(), sql_log2_get_filename(), sql_log2_init(), SRV_CON_CLIENT_INFO_SIZE, SRV_CON_DB_INFO_SIZE, SRV_CON_DB_INFO_SIZE_PRIOR_8_2_0, SRV_CON_DB_INFO_SIZE_PRIOR_8_4_0, SRV_CON_DBNAME_SIZE, SRV_CON_DBPASSWD_SIZE, SRV_CON_DBSESS_ID_SIZE, SRV_CON_DBUSER_SIZE, SRV_CON_URL_SIZE, SRV_CON_VER_STR_MAX_SIZE, srv_sock_fd, ssl_client, t_shm_appl_server::statement_pooling, stripped_column_name, t_shm_appl_server::stripped_column_name, strlen, strncpy_bufsize, tran_start_time, tran_timeout, t_appl_server_info::transaction_start_time, TRUE, unset_hang_check_time(), ut_get_as_port_name(), ut_get_ipv4_string(), ut_set_keepalive(), t_appl_server_info::uts_status, UTS_STATUS_BUSY, UTS_STATUS_IDLE, ux_database_connect(), ux_database_shutdown(), ux_end_session(), ux_end_tran(), and ux_set_default_setting().

Referenced by main().

Here is the caller graph for this function:

static void cas_make_session_for_driver ( char *  out)
static

Definition at line 342 of file cas.c.

References db_get_server_session_key(), db_get_session_id(), DRIVER_SESSION_SIZE, htonl(), and SERVER_SESSION_KEY_SIZE.

Referenced by cas_send_connect_reply_to_driver().

Here is the caller graph for this function:

static int cas_register_to_proxy ( SOCKET  proxy_sock_fd)
static

Definition at line 2775 of file cas.c.

References cas_log_write_and_end(), init_msg_header(), MSG_HEADER::msg_body_size_ptr, net_write_header(), net_write_int(), net_write_stream(), shm_shard_cas_id, and shm_shard_id.

Referenced by shard_cas_main().

Here is the caller graph for this function:

static void cas_set_session_id ( T_CAS_PROTOCOL  protocol,
char *  session 
)
static

Definition at line 358 of file cas.c.

References cas_log_write_and_end(), DB_EMPTY_SESSION, db_set_server_session_key(), db_set_session_id(), DOES_CLIENT_UNDERSTAND_THE_PROTOCOL, ntohl(), and PROTOCOL_V3.

Referenced by cas_main().

Here is the caller graph for this function:

static void cas_sig_handler ( int  signo)
static

Definition at line 1562 of file cas.c.

References _exit(), cas_free(), t_appl_server_info::pid, t_appl_server_info::uts_status, and UTS_STATUS_RESTART.

Referenced by main().

Here is the caller graph for this function:

void cas_ssl_close ( int  client_sock_fd)

Definition at line 265 of file cas_ssl.c.

References NULL, and ssl.

Referenced by cas_main().

Here is the caller graph for this function:

static void clear_db_connection_info ( void  )
static

Definition at line 2629 of file cas.c.

References cas_db_passwd, cas_db_user, t_appl_server_info::database_passwd, t_appl_server_info::database_user, and t_appl_server_info::fixed_shard_user.

Referenced by process_request(), and shard_cas_main().

Here is the caller graph for this function:

static int get_graceful_down_timeout ( void  )
static

Definition at line 2887 of file cas.c.

References t_appl_server_info::advance_activate_flag.

Referenced by net_read_process(), and process_request().

Here is the caller graph for this function:

static bool need_database_reconnect ( void  )
static

Definition at line 2643 of file cas.c.

References cas_db_passwd, cas_db_user, t_appl_server_info::database_passwd, t_appl_server_info::database_user, and t_appl_server_info::force_reconnect.

Referenced by process_request().

Here is the caller graph for this function:

static int net_read_header_keep_con_on ( SOCKET  clt_sock_fd,
MSG_HEADER client_msg_header 
)
static
static FN_RETURN process_request ( SOCKET  sock_fd,
T_NET_BUF net_buf,
T_REQ_INFO req_info 
)
static

Definition at line 1700 of file cas.c.

References ARG_FILE_LINE, argc, argv, assert, broker_name, t_appl_server_info::cas_change_mode, CAS_CHANGE_MODE_AUTO, cas_db_name, cas_db_passwd, cas_db_user, CAS_ER_COMMUNICATION, CAS_ER_NO_MORE_MEMORY, CAS_ER_STMT_POOLING, CAS_ERROR_INDICATOR, CAS_FC_CHECK_CAS, CAS_FC_CURSOR_CLOSE, CAS_FC_CURSOR_CLOSE_FOR_PROTO_V2, CAS_FC_END_TRAN, CAS_FC_EXECUTE, CAS_FC_MAX, CAS_FC_PREPARE, CAS_FC_PREPARE_AND_EXECUTE, CAS_FC_PREPARE_AND_EXECUTE_FOR_PROTO_V2, CAS_FC_SCHEMA_INFO, cas_get_db_connect_status(), CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_AUTOCOMMIT, CAS_INFO_FLAG_MASK_FORCE_OUT_TRAN, CAS_INFO_RESERVED_1, CAS_INFO_RESERVED_2, CAS_INFO_RESERVED_DEFAULT, cas_info_size, CAS_INFO_STATUS, CAS_INFO_STATUS_ACTIVE, CAS_INFO_STATUS_INACTIVE, cas_log_debug(), cas_log_reset(), t_appl_server_info::cas_log_reset, cas_log_write_and_end(), CAS_PROTO_CURRENT_VER, cas_send_result_flag, cas_shard_flag, t_appl_server_info::cas_slow_log_reset, cas_slow_log_reset(), t_appl_server_info::cci_default_autocommit, clear_db_connection_info(), t_req_info::client_version, t_net_buf::client_version, t_appl_server_info::con_status, con_status_before_check_cas, CON_STATUS_CLOSE_AND_CONNECT, CON_STATUS_IN_TRAN, CON_STATUS_LOCK, CON_STATUS_LOCK_CAS, CON_STATUS_OUT_TRAN, CON_STATUS_UNLOCK, t_appl_server_info::cur_keep_con, t_appl_server_info::cur_sql_log2, db_set_interrupt(), DOES_CLIENT_MATCH_THE_PROTOCOL, DOES_CLIENT_UNDERSTAND_THE_PROTOCOL, t_req_info::driver_info, t_error_info::err_indicator, t_error_info::err_number, t_error_info::err_string, error_info_clear(), errors_in_transaction, t_appl_server_info::fixed_shard_user, FN_CLOSE_CONN, FN_GRACEFUL_DOWN, FN_KEEP_CONN, FN_KEEP_SESS, t_appl_server_info::fn_status, FN_STATUS_BUSY, FREE_MEM, FUNC_NEEDS_RESTORING_CON_STATUS, get_graceful_down_timeout(), htonl(), MSG_HEADER::info_ptr, init_msg_header(), is_first_request, is_net_timed_out(), KEEP_CON_AUTO, KEEP_CON_ON, t_appl_server_info::log_msg, logddl_get_jsp_mode(), logddl_write_end(), MALLOC, MAX_DIAG_DATA_VALUE, MSG_HEADER::msg_body_size_ptr, t_req_info::need_auto_commit, need_database_reconnect(), net_buf_clear(), NET_BUF_CURR_SIZE, NET_BUF_HEADER_MSG_SIZE, net_decode_str(), NET_DEFAULT_TIMEOUT, net_read_header(), net_read_header_keep_con_on(), net_read_int_keep_con_auto(), net_read_process(), net_read_stream(), net_timeout_set(), net_write_error(), net_write_from_file(), net_write_stream(), NULL, t_appl_server_info::num_holdable_results, t_appl_server_info::num_requests_received, t_appl_server_info::num_transactions_processed, OFF, ON, prev_cas_info, PROTOCOL_V2, PROTOCOL_V7, PROTOCOL_V8, req_info, t_appl_server_info::reset_flag, restart_is_needed(), server_fn_table, server_func_name, t_shm_appl_server::session_timeout, set_db_connection_info(), set_db_parameter(), set_hang_check_time(), shm_as_index, sock_fd, t_shm_appl_server::sql_log2, sql_log2_end(), sql_log2_init(), TRAN_AUTOROLLBACK, TRAN_NOT_AUTOCOMMIT, t_appl_server_info::transaction_start_time, TRUE, unset_hang_check_time(), t_appl_server_info::uts_status, UTS_STATUS_BUSY, UTS_STATUS_IDLE, ux_auto_commit(), ux_database_connect(), ux_is_database_connected(), ux_set_default_setting(), ux_set_utype_for_datetimeltz(), ux_set_utype_for_datetimetz(), ux_set_utype_for_enum(), ux_set_utype_for_json(), ux_set_utype_for_timestampltz(), and ux_set_utype_for_timestamptz().

Referenced by cas_main(), and shard_cas_main().

Here is the caller graph for this function:

static void query_cancel ( int  signo)
static

Definition at line 1674 of file cas.c.

References assert, db_set_interrupt(), MAX_DIAG_DATA_VALUE, t_appl_server_info::num_interrupts, query_cancel_flag, and query_cancel_time.

Referenced by cas_main(), and shard_cas_main().

Here is the caller graph for this function:

int query_seq_num_current_value ( void  )

Definition at line 2941 of file cas.c.

References query_sequence_num.

Referenced by fn_prepare_internal(), and fn_schema_info().

Here is the caller graph for this function:

int query_seq_num_next_value ( void  )

Definition at line 2935 of file cas.c.

References query_sequence_num.

Referenced by fn_get_query_info(), fn_prepare_internal(), and fn_schema_info().

Here is the caller graph for this function:

static void set_cas_info_size ( void  )
static

Definition at line 2668 of file cas.c.

References CAS_INFO_SIZE, cas_info_size, CAS_MAKE_VER, cas_shard_flag, t_appl_server_info::clt_version, and OFF.

Referenced by cas_main(), and shard_cas_main().

Here is the caller graph for this function:

void set_hang_check_time ( void  )

Definition at line 1488 of file cas.c.

References cas_shard_flag, t_appl_server_info::claimed_alive_time, t_shm_appl_server::monitor_hang_flag, NULL, and OFF.

Referenced by cas_init(), cas_log_begin_hang_check_time(), cas_main(), and process_request().

Here is the caller graph for this function:

static int shard_cas_main ( void  )
static

Definition at line 504 of file cas.c.

References t_net_buf::alloc_size, ARG_FILE_LINE, assert, t_appl_server_info::auto_commit_mode, broker_name, cas_db_name, cas_db_passwd, cas_db_user, cas_default_isolation_level, cas_default_lock_timeout, cas_error_log_close(), cas_error_log_open(), cas_final(), cas_get_client_version(), CAS_INFO_RESERVED_DEFAULT, CAS_INFO_STATUS, cas_log_close(), cas_log_debug(), cas_log_error_handler_begin(), cas_log_error_handler_clear(), cas_log_error_handler_end(), cas_log_open(), cas_log_write2(), cas_log_write_and_end(), CAS_PROTO_CURRENT_VER, cas_register_to_proxy(), cas_req_count, cas_set_db_connect_status(), cas_slow_log_close(), cas_slow_log_open(), t_appl_server_info::cci_default_autocommit, t_shm_appl_server::cci_default_autocommit, clear_db_connection_info(), t_req_info::client_version, CLOSE_SOCKET, t_appl_server_info::con_status, CON_STATUS_IN_TRAN, CON_STATUS_OUT_TRAN, t_appl_server_info::cur_keep_con, t_appl_server_info::cur_sql_log2, t_appl_server_info::cur_statement_pooling, t_net_buf::data, t_shard_conn_info::db_host, t_shard_conn_info::db_name, error(), errors_in_transaction, FALSE, FN_CLOSE_CONN, FN_GRACEFUL_DOWN, FN_KEEP_CONN, FN_KEEP_SESS, FREE, getsize(), hm_srv_handle_free_all(), hm_srv_handle_get_current_count(), INVALID_SOCKET, IS_INVALID_SOCKET, is_xa_prepared(), KEEP_CON_DEFAULT, KEEP_CON_ON, t_appl_server_info::last_access_time, MALLOC, MAX_HA_DBINFO_LENGTH, t_shm_appl_server::max_prepared_stmt_count, t_req_info::need_rollback, net_buf_init(), net_connect_proxy(), NET_DEFAULT_TIMEOUT, net_timeout_set(), NULL, OFF, ON, prev_cas_info, process_request(), proxy_sock_fd, t_appl_server_info::psize, psize_at_start, query_cancel(), query_start_time, query_timeout, t_appl_server_info::reset_flag, restart_is_needed(), t_appl_server_info::service_ready_flag, set_cas_info_size(), set_db_connection_info(), t_shm_appl_server::shard_conn_info, SHARD_NET_BUF_ALLOC_SIZE, shm_as_index, shm_proxy_id, shm_shard_id, SLEEP_SEC, t_shm_appl_server::sql_log2, sql_log2_end(), sql_log2_get_filename(), sql_log2_init(), t_shm_appl_server::statement_pooling, stripped_column_name, t_shm_appl_server::stripped_column_name, tran_start_time, tran_timeout, TRUE, t_appl_server_info::uts_status, UTS_STATUS_BUSY, UTS_STATUS_CON_WAIT, UTS_STATUS_IDLE, UTS_STATUS_RESTART, UTS_STATUS_STOP, ux_database_connect(), ux_database_shutdown(), ux_end_session(), ux_end_tran(), and ux_set_default_setting().

Referenced by main().

Here is the caller graph for this function:

void unset_hang_check_time ( void  )

Definition at line 1505 of file cas.c.

References cas_shard_flag, t_appl_server_info::claimed_alive_time, t_shm_appl_server::monitor_hang_flag, NULL, and OFF.

Referenced by cas_log_end_hang_check_time(), cas_main(), and process_request().

Here is the caller graph for this function:

Variable Documentation

bool autocommit_deferred = false

Definition at line 164 of file cas.c.

char cas_client_type

Definition at line 169 of file cas.c.

Referenced by cas_main(), receiver_thr_f(), and sch_class_info().

char cas_db_name[MAX_HA_DBINFO_LENGTH]
static

Definition at line 138 of file cas.c.

Referenced by process_request(), set_db_connection_info(), and shard_cas_main().

bool cas_default_ansi_quotes = true

Definition at line 178 of file cas.c.

Referenced by get_num_markers(), and ux_get_default_setting().

int cas_default_lock_timeout = -1
bool cas_default_no_backslash_escapes = true

Definition at line 180 of file cas.c.

Referenced by consume_tokens(), fn_get_db_parameter(), and ux_get_default_setting().

int cas_info_size = CAS_INFO_SIZE
int cas_req_count = 0
static

Definition at line 336 of file cas.c.

Referenced by cas_free(), cas_main(), restart_is_needed(), and shard_cas_main().

int cas_send_result_flag = TRUE

Definition at line 182 of file cas.c.

Referenced by fn_end_tran(), and process_request().

int con_status_before_check_cas

Definition at line 172 of file cas.c.

Referenced by cas_main(), and process_request().

const int DEFAULT_CHECK_INTERVAL = 1
static

Definition at line 85 of file cas.c.

Referenced by net_read_header_keep_con_on(), net_read_int_keep_con_auto(), and net_read_process().

bool is_first_request

Definition at line 173 of file cas.c.

Referenced by cas_main(), and process_request().

SOCKET new_req_sock_fd = INVALID_SOCKET

Definition at line 174 of file cas.c.

Referenced by net_read_int_keep_con_auto(), net_timeout_set(), and read_buffer().

char prev_cas_info[CAS_INFO_SIZE]

Definition at line 184 of file cas.c.

Referenced by cas_main(), process_request(), and shard_cas_main().

const char* program_name
int psize_at_start

Definition at line 149 of file cas.c.

Referenced by cas_free(), cas_main(), restart_is_needed(), and shard_cas_main().

char query_cancel_flag

Definition at line 162 of file cas.c.

Referenced by cas_log_query_cancel(), cas_main(), and query_cancel().

INT64 query_cancel_time

Definition at line 161 of file cas.c.

Referenced by cas_log_query_cancel(), and query_cancel().

int query_sequence_num = 0
static

Definition at line 141 of file cas.c.

Referenced by query_seq_num_current_value(), and query_seq_num_next_value().

struct timeval query_start_time
T_REQ_INFO req_info
static

Definition at line 333 of file cas.c.

Referenced by fn_execute_internal(), fn_make_out_rs(), process_request(), and ux_fetch().

T_SERVER_FUNC server_fn_table[]
static

Definition at line 236 of file cas.c.

Referenced by process_request().

const char* server_func_name[]
static

Definition at line 285 of file cas.c.

Referenced by process_request().

T_SHM_APPL_SERVER* shm_appl

Definition at line 152 of file cas.c.

int shm_proxy_id = -1
SOCKET srv_sock_fd
static
bool ssl_client

Definition at line 81 of file cas_ssl.c.

Referenced by cas_main().

struct timeval tran_start_time
int tran_timeout = 0

Definition at line 159 of file cas.c.

Referenced by cas_main(), fn_end_tran(), shard_cas_main(), and ux_auto_commit().