CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <ctype.h>
#include <assert.h>
#include <signal.h>
#include "authenticate.h"
#include "porting.h"
#include "system_parameter.h"
#include "storage_common.h"
#include "environment_variable.h"
#include "db.h"
#include "class_object.h"
#include "object_print.h"
#include "server_interface.h"
#include "boot_cl.h"
#include "locator_cl.h"
#include "schema_manager.h"
#include "schema_template.h"
#include "object_accessor.h"
#include "set_object.h"
#include "virtual_object.h"
#include "parser.h"
#include "memory_alloc.h"
#include "execute_schema.h"
#include "network_interface_cl.h"
#include "jsp_cl.h"
#include "execute_statement.h"
#include "connection_support.h"
#include "trigger_manager.h"
#include "session.h"
#include "connection_cl.h"
#include "dbtype.h"
#include "tcp.h"
Go to the source code of this file.
Classes | |
struct | db_host_status |
struct | db_host_status_list |
Typedefs | |
typedef struct db_host_status | DB_HOST_STATUS |
typedef struct db_host_status_list | DB_HOST_STATUS_LIST |
Variables | |
void(* | prev_sigfpe_handler )(int) = SIG_DFL |
char | db_Database_name [DB_MAX_IDENTIFIER_LENGTH+1] |
char | db_Program_name [PATH_MAX] |
static char * | db_Preferred_hosts = NULL |
static int | db_Connect_order = DB_CONNECT_ORDER_SEQ |
static int | db_Max_num_delayed_hosts_lookup = 0 |
static int | db_Delayed_hosts_count = 0 |
static DB_HOST_STATUS_LIST | db_Host_status_list |
static int | db_Client_type = DB_CLIENT_TYPE_DEFAULT |
typedef struct db_host_status DB_HOST_STATUS |
Definition at line 77 of file db_admin.c.
typedef struct db_host_status_list DB_HOST_STATUS_LIST |
Definition at line 84 of file db_admin.c.
int db_2pc_attach_transaction | ( | int | global_transaction_id | ) |
Definition at line 1403 of file db_admin.c.
References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, and tran_2pc_attach_global_tran().
Referenced by do_attach(), and fn_xa_end_tran().
int db_2pc_prepare_to_commit_transaction | ( | int | global_transaction_id | ) |
Definition at line 1426 of file db_admin.c.
References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, and tran_2pc_prepare_global_tran().
Referenced by do_prepare_to_commit().
int db_2pc_prepare_transaction | ( | void | ) |
Definition at line 1351 of file db_admin.c.
References CHECK_CONNECT_MINUSONE, CHECK_MODIFICATION_MINUSONE, and tran_2pc_prepare().
Referenced by fn_xa_prepare().
int db_2pc_prepared_transactions | ( | int | gtrids[], |
int | size | ||
) |
Definition at line 1373 of file db_admin.c.
References ARG_FILE_LINE, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, cubregex::count(), ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, NULL, and tran_2pc_recovery_prepared().
Referenced by fn_xa_end_tran(), and fn_xa_recover().
int db_2pc_start_transaction | ( | void | ) |
Definition at line 1327 of file db_admin.c.
References CHECK_CONNECT_MINUSONE, CHECK_MODIFICATION_MINUSONE, and tran_2pc_start().
Referenced by fn_xa_prepare().
int db_abort_to_savepoint | ( | const char * | savepoint_name | ) |
Definition at line 1237 of file db_admin.c.
References CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, db_abort_to_savepoint_internal(), and error().
Referenced by do_delete(), do_execute_delete(), do_execute_merge(), do_execute_update(), do_merge(), do_update(), fn_savepoint(), and ux_execute_all().
int db_abort_to_savepoint_internal | ( | const char * | savepoint_name | ) |
Definition at line 1210 of file db_admin.c.
References db_abort_transaction(), error(), NULL, and tran_abort_upto_user_savepoint().
Referenced by db_abort_to_savepoint(), and do_rollback().
int db_abort_transaction | ( | void | ) |
Definition at line 1114 of file db_admin.c.
References CHECK_CONNECT_ERROR, error(), and tran_abort().
Referenced by check_commit(), chksum_start(), compactdb_start(), csql_do_session_cmd(), csql_execute_statements(), csql_exit_session(), db_abort_to_savepoint_internal(), do_reclaim_class_addresses(), gen_tz(), ldr_abort(), ldr_exec_query_from_file(), ldr_sa_load(), main(), synccolldb(), tzc_compute_timezone_checksum(), uci_rollback(), ux_end_tran(), ux_execute_array(), and ux_execute_batch().
|
static |
Definition at line 624 of file db_admin.c.
References assert, db_host_status_list::hostlist, db_host_status::hostname, db_host_status_list::last_host_idx, and db_host_status::status.
Referenced by db_set_connected_host_status(), and db_set_host_status().
Definition at line 1694 of file db_admin.c.
References au_add_member(), CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and CHECK_MODIFICATION_ERROR.
Referenced by do_create_user().
Definition at line 1646 of file db_admin.c.
References au_add_user(), CHECK_1ARG_NULL, CHECK_CONNECT_NULL, and CHECK_MODIFICATION_NULL.
Referenced by do_create_user().
int db_add_volume | ( | const char * | ext_path, |
const char * | ext_name, | ||
const char * | ext_comments, | ||
const int | ext_npages, | ||
const DB_VOLPURPOSE | ext_purpose | ||
) |
Definition at line 314 of file db_admin.c.
References dbdef_vol_ext_info::comments, db_add_volume_ex(), dbdef_vol_ext_info::max_npages, dbdef_vol_ext_info::max_writesize_in_sec, dbdef_vol_ext_info::name, dbdef_vol_ext_info::overwrite, dbdef_vol_ext_info::path, and dbdef_vol_ext_info::purpose.
int db_add_volume_ex | ( | DBDEF_VOL_EXT_INFO * | ext_info | ) |
Definition at line 342 of file db_admin.c.
References ARG_FILE_LINE, assert, Au_dba_user, au_is_dba_group_member(), Au_user, boot_add_volume_extension(), CHECK_CONNECT_ERROR, ER_AU_DBA_ONLY, er_errid(), ER_ERROR_SEVERITY, er_set(), error(), NO_ERROR, NULL, NULL_VOLID, and dbdef_vol_ext_info::overwrite.
Referenced by addvoldb(), and db_add_volume().
Definition at line 1848 of file db_admin.c.
References au_fetch_class(), AU_FETCH_READ, CHECK_1ARG_ERROR, and CHECK_CONNECT_ERROR.
Referenced by mq_check_authorization_path_entities(), mq_compute_authorization(), and mq_translate_tree().
Definition at line 1872 of file db_admin.c.
References au_fetch_class(), AU_FETCH_READ, AU_GRANT_SHIFT, CHECK_1ARG_ERROR, and CHECK_CONNECT_ERROR.
int db_checkpoint | ( | void | ) |
Definition at line 1473 of file db_admin.c.
References CHECK_CONNECT_ERROR, and log_checkpoint().
Referenced by csql_do_session_cmd().
int db_chn | ( | DB_OBJECT * | obj, |
DB_FETCH_MODE | purpose | ||
) |
Definition at line 2660 of file db_admin.c.
References DB_FETCH_READ, DB_FETCH_WRITE, and locator_get_cache_coherency_number().
void db_clear_delayed_hosts_count | ( | void | ) |
Definition at line 546 of file db_admin.c.
References db_Delayed_hosts_count.
Referenced by boot_client_all_finalize().
void db_clear_host_connected | ( | void | ) |
Definition at line 851 of file db_admin.c.
References boot_clear_host_connected().
Referenced by applyinfo(), and ux_database_connect().
void db_clear_host_status | ( | void | ) |
Definition at line 580 of file db_admin.c.
References db_host_status_list::connected_host_status, DB_HS_NORMAL, db_host_status_list::hostlist, db_host_status::hostname, i, db_host_status_list::last_host_idx, NULL, and db_host_status::status.
Referenced by boot_restart_client().
int db_commit_is_needed | ( | void | ) |
Definition at line 1154 of file db_admin.c.
References CHECK_CONNECT_FALSE, and tran_has_updated().
Referenced by csql_exit_session().
int db_commit_transaction | ( | void | ) |
Definition at line 1091 of file db_admin.c.
References CHECK_CONNECT_ERROR, and tran_commit().
Referenced by addvoldb(), backupdb(), check_commit(), checkdb(), chksum_drop_and_create_checksum_table(), chksum_start(), compactdb_start(), createdb(), csql_do_session_cmd(), csql_execute_statements(), csql_exit_session(), csql_help_info(), do_reclaim_class_addresses(), gen_tz(), installdb(), la_commit_transaction(), la_delete_ha_apply_info(), la_get_last_ha_applied_info(), ldr_exec_query_from_file(), ldr_sa_load(), loaddb_internal(), main(), optimizedb(), renamedb(), restoreslave(), synccolldb(), tde(), tzc_compute_timezone_checksum(), uci_commit(), ux_end_tran(), ux_execute_array(), and ux_execute_batch().
int db_disable_modification | ( | void | ) |
Definition at line 1001 of file db_admin.c.
References db_Disable_modifications, and NO_ERROR.
Referenced by boot_restart_client(), method_invoke_for_server(), and method_receive_results_for_stand_alone().
bool db_disable_trigger | ( | void | ) |
Definition at line 570 of file db_admin.c.
References tr_set_execution_state().
Referenced by applylogdb(), csql(), csql_do_session_cmd(), loaddb_internal(), and ux_database_connect().
bool db_does_connected_host_have_status | ( | int | status | ) |
Definition at line 755 of file db_admin.c.
References db_host_status_list::connected_host_status, NULL, and db_host_status::status.
Referenced by db_need_reconnect(), and report_abnormal_host_status().
Definition at line 1719 of file db_admin.c.
References au_drop_member(), CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, and CHECK_MODIFICATION_ERROR.
int db_drop_user | ( | DB_OBJECT * | user | ) |
Definition at line 1668 of file db_admin.c.
References au_drop_user(), CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and CHECK_MODIFICATION_ERROR.
Referenced by do_drop_user().
int db_enable_modification | ( | void | ) |
Definition at line 1015 of file db_admin.c.
References db_Disable_modifications, and NO_ERROR.
Referenced by method_invoke_for_server(), and method_receive_results_for_stand_alone().
bool db_enable_trigger | ( | void | ) |
Definition at line 558 of file db_admin.c.
References tr_set_execution_state().
Referenced by ux_database_connect().
int db_end_session | ( | void | ) |
Definition at line 1029 of file db_admin.c.
References CHECK_CONNECT_ERROR, csession_end_session(), and db_get_session_id().
Referenced by csql_do_session_cmd(), csql_exit_cleanup(), csql_exit_session(), loaddb_internal(), start_csql(), and ux_end_session().
int db_error_code | ( | void | ) |
Definition at line 2143 of file db_admin.c.
References er_errid().
Referenced by csql(), csql_check_server_down(), csql_execute_statements(), db_error_code_test(), extract_classes(), fetch_attribute(), fetch_result(), fn_collection(), fn_get_query_info(), fn_oid(), oid_attr_info_set(), prepare_column_list_info_set(), sch_exported_keys_or_cross_reference(), sch_imported_keys(), sch_query_execute(), unloaddb(), ux_check_object(), ux_execute(), ux_execute_all(), ux_execute_array(), ux_execute_batch(), ux_get_attr_type_str(), ux_get_class_num_objs(), ux_oid_put(), and ux_prepare().
int db_error_code_test | ( | void | ) |
Definition at line 2123 of file db_admin.c.
References db_error_code().
int db_error_init | ( | const char * | logfile | ) |
Definition at line 2164 of file db_admin.c.
References er_init(), prm_get_integer_value(), and PRM_ID_ER_EXIT_ASK.
const char* db_error_string | ( | int | level | ) |
Definition at line 2116 of file db_admin.c.
References er_msg().
Referenced by acldb(), addvoldb(), alterdbhost(), applyinfo(), applylogdb(), backupdb(), changemode(), check_commit(), checkdb(), checksumdb(), compactdb(), copydb(), copylogdb(), createdb(), csql_errmsg(), db_error_string_test(), deletedb(), diagdb(), display_error(), do_insert_template(), error_info_set_with_msg(), extract_classes(), gen_tz(), genlocale(), hb_master_init(), installdb(), kill_transactions(), killtran(), la_apply_repl_log(), la_log_page_check(), ldr_exec_query_from_file(), ldr_sa_load(), loaddb_internal(), lockdb(), main(), mq_get_expression(), optimizedb(), paramdump(), patchdb(), plandump(), pt_check_sub_insert(), pt_check_with_info(), pt_class_pre_fetch(), pt_difference_sets(), pt_evaluate_tree_internal(), pt_make_flat_name_list(), pt_product_sets(), pt_semantic_check_local(), pt_seq_value_to_db(), pt_set_table_to_db(), pt_set_value_to_db(), pt_union_sets(), renamedb(), restoredb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), unloaddb(), ux_database_connect(), ux_execute_array(), ux_execute_batch(), and vacuumdb().
const char* db_error_string_test | ( | int | level | ) |
Definition at line 2089 of file db_admin.c.
References db_error_string().
int db_fetch_array | ( | DB_OBJECT ** | objects, |
DB_FETCH_MODE | purpose, | ||
int | quit_on_error | ||
) |
Definition at line 2216 of file db_admin.c.
References assert, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, cubregex::count(), DB_FETCH_READ, DB_FETCH_WRITE, er_errid(), error(), locator_fetch_set(), NO_ERROR, and NULL.
Referenced by db_fetch_list().
int db_fetch_composition | ( | DB_OBJECT * | object, |
DB_FETCH_MODE | purpose, | ||
int | max_level, | ||
int | quit_on_error | ||
) |
Definition at line 2407 of file db_admin.c.
References ARG_FILE_LINE, assert, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, DB_FETCH_READ, DB_FETCH_WRITE, db_real_instance(), er_errid(), ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, error(), locator_fetch_nested(), NO_ERROR, NULL, and WS_ISVID.
int db_fetch_list | ( | DB_OBJLIST * | objects, |
DB_FETCH_MODE | purpose, | ||
int | quit_on_error | ||
) |
Definition at line 2254 of file db_admin.c.
References db_fetch_array(), db_list_length(), error(), free_and_init, i, db_objlist::next, NO_ERROR, NULL, and db_objlist::op.
Referenced by vid_getall_mops().
int db_fetch_seq | ( | DB_SEQ * | seq, |
DB_FETCH_MODE | purpose, | ||
int | quit_on_error | ||
) |
Definition at line 2388 of file db_admin.c.
References fetch_set_internal().
int db_fetch_set | ( | DB_SET * | set, |
DB_FETCH_MODE | purpose, | ||
int | quit_on_error | ||
) |
Definition at line 2372 of file db_admin.c.
References fetch_set_internal().
Referenced by au_get_set(), and set_to_string().
|
static |
Definition at line 599 of file db_admin.c.
References db_host_status_list::hostlist, db_host_status::hostname, i, db_host_status_list::last_host_idx, and NULL.
Referenced by db_set_connected_host_status(), and db_set_host_status().
Definition at line 2885 of file db_admin.c.
References boot_get_host_name(), csession_find_or_create_session(), DB_EMPTY_SESSION, db_get_server_session_key(), db_get_session_id(), DB_ROW_COUNT_NOT_SET, db_set_session_id(), db_update_row_count_cache(), err, and NO_ERROR.
Referenced by boot_initialize_client(), boot_restart_client(), and ux_database_connect().
Definition at line 1606 of file db_admin.c.
References au_find_user(), CHECK_1ARG_NULL, and CHECK_CONNECT_NULL.
Referenced by do_alter_user(), do_create_user(), do_grant(), do_revoke(), help_class_names(), jsp_alter_stored_procedure(), pt_check_grant_revoke(), and pt_check_user_exists().
Definition at line 1626 of file db_admin.c.
References au_find_user_to_drop(), CHECK_1ARG_ERROR, and CHECK_CONNECT_ERROR.
Referenced by do_drop_user().
void db_flush_static_methods | ( | void | ) |
Definition at line 2564 of file db_admin.c.
References sm_flush_static_methods().
void db_force_method_reload | ( | MOP | obj | ) |
Definition at line 2579 of file db_admin.c.
References CHECK_CONNECT_VOID, and sm_force_method_link().
int db_freepgs | ( | const char * | volume_label | ) |
Definition at line 2054 of file db_admin.c.
References CHECK_CONNECT_ZERO, disk_get_free_numpages(), and NULL_VOLID.
int db_get_client_type | ( | void | ) |
Definition at line 489 of file db_admin.c.
References db_Client_type.
Referenced by csql_do_session_cmd(), la_init(), la_shutdown(), log_does_allow_replication(), obt_apply_assignments(), and obt_update_internal().
const char* db_get_database_comments | ( | void | ) |
Definition at line 471 of file db_admin.c.
References CHECK_CONNECT_NULL, disk_get_remarks(), free_and_init, NULL, and ws_copy_string().
char* db_get_database_name | ( | void | ) |
Definition at line 432 of file db_admin.c.
References CHECK_CONNECT_NULL, db_Database_name, NULL, strlen, and ws_copy_string().
Referenced by csql_print_database(), pt_evaluate_db_value_expr(), pt_make_query_show_table(), and pt_to_regu_variable().
char* db_get_database_version | ( | void | ) |
Definition at line 455 of file db_admin.c.
References NULL, rel_build_number(), and ws_copy_string().
Referenced by pt_evaluate_db_value_expr(), and pt_to_regu_variable().
int db_get_delayed_hosts_count | ( | void | ) |
Definition at line 540 of file db_admin.c.
References db_Delayed_hosts_count.
Referenced by boot_client_all_finalize().
int db_get_global_transaction_info | ( | int | global_transaction_id, |
void * | buffer, | ||
int | size | ||
) |
Definition at line 1295 of file db_admin.c.
References ARG_FILE_LINE, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, NULL, and tran_get_global_tran_info().
Referenced by fn_xa_end_tran(), and fn_xa_recover().
int db_get_ha_server_state | ( | char * | buffer, |
int | maxlen | ||
) |
Definition at line 2824 of file db_admin.c.
References CHECK_CONNECT_ERROR, css_ha_server_state_string(), and HA_SERVER_STATE_NA.
Referenced by csql_print_database().
char* db_get_host_connected | ( | void | ) |
Definition at line 2806 of file db_admin.c.
Referenced by csql_print_database(), and ux_database_connect().
int db_get_host_list_with_given_status | ( | char ** | hostlist, |
int | list_size, | ||
int | status | ||
) |
Definition at line 776 of file db_admin.c.
References db_host_status_list::hostlist, db_host_status::hostname, i, db_host_status_list::last_host_idx, NULL, and db_host_status::status.
Referenced by report_abnormal_host_status().
int db_get_last_insert_id | ( | DB_VALUE * | value | ) |
Definition at line 1058 of file db_admin.c.
References CHECK_CONNECT_ERROR, and csession_get_last_insert_id().
Referenced by ux_get_last_insert_id().
int db_get_max_num_delayed_hosts_lookup | ( | void | ) |
Definition at line 534 of file db_admin.c.
References db_Max_num_delayed_hosts_lookup.
Referenced by boot_client_all_finalize().
Definition at line 1892 of file db_admin.c.
References au_get_class_owner(), CHECK_1ARG_NULL, and CHECK_CONNECT_NULL.
Referenced by help_class_names(), load_has_authorization(), mq_virtual_queries(), and pt_check_user_owns_class().
int db_get_row_count | ( | int * | row_count | ) |
Definition at line 1046 of file db_admin.c.
References CHECK_CONNECT_ERROR, and csession_get_row_count().
Referenced by pt_evaluate_db_value_expr(), pt_fold_const_expr(), and ux_get_row_count().
int db_get_row_count_cache | ( | void | ) |
Definition at line 2914 of file db_admin.c.
References db_Row_count.
Referenced by csql_display_trace(), pt_evaluate_db_value_expr(), pt_fold_const_expr(), tran_server_commit(), and ux_get_row_count().
char* db_get_server_session_key | ( | void | ) |
Definition at line 2849 of file db_admin.c.
References boot_get_server_session_key().
Referenced by cas_make_session_for_driver(), and db_find_or_create_session().
SESSION_ID db_get_session_id | ( | void | ) |
Definition at line 2859 of file db_admin.c.
References db_Session_id.
Referenced by cas_access_log(), cas_main(), cas_make_session_for_driver(), cas_send_connect_reply_to_driver(), db_end_session(), db_find_or_create_session(), and ux_get_session_id().
int db_get_system_parameters | ( | char * | data, |
int | len | ||
) |
Definition at line 2770 of file db_admin.c.
References er_clear(), error(), NO_ERROR, NULL, PRM_ERR_NOT_FOR_CLIENT, rc, sysprm_free_assign_values(), sysprm_obtain_parameters(), sysprm_obtain_server_parameters(), sysprm_print_assign_values(), and sysprm_set_error().
Referenced by csql_get_sys_param(), statdump(), ux_get_default_setting(), and ux_get_system_parameter().
void db_get_tran_settings | ( | int * | lock_wait, |
DB_TRAN_ISOLATION * | tran_isolation | ||
) |
Definition at line 1554 of file db_admin.c.
References CHECK_CONNECT_VOID, and tran_get_tran_settings().
Referenced by pt_check_isolation_lvl().
DB_OBJECT* db_get_user | ( | void | ) |
Definition at line 1974 of file db_admin.c.
References Au_user.
Referenced by load_has_authorization(), mq_virtual_queries(), parser_generate_do_stmt_xasl(), parser_generate_xasl(), parser_print_user(), pt_to_delete_xasl(), pt_to_insert_xasl(), pt_to_merge_insert_xasl(), pt_to_merge_update_xasl(), pt_to_merge_xasl(), and pt_to_update_xasl().
char* db_get_user_and_host_name | ( | void | ) |
Definition at line 1932 of file db_admin.c.
References ARG_FILE_LINE, CUB_MAXHOSTNAMELEN, db_get_user_name(), db_private_alloc, db_string_free(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), GETHOSTNAME, db_host_status::hostname, NULL, and strlen.
Referenced by do_evaluate_default_expr(), pt_evaluate_db_value_expr(), and pt_to_regu_variable().
char* db_get_user_name | ( | void | ) |
Definition at line 1911 of file db_admin.c.
References au_user_name(), and CHECK_CONNECT_NULL.
Referenced by au_login_method(), chksum_set_repl_info_and_demote_table_lock(), conn_restart_client(), db_get_user_and_host_name(), do_evaluate_default_expr(), and do_replicate_statement().
Definition at line 1072 of file db_admin.c.
References CHECK_CONNECT_ERROR, and csession_get_variable().
Referenced by pt_evaluate_db_value_expr(), and values_list_to_values_array().
Definition at line 1794 of file db_admin.c.
References au_grant(), CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), and NULL.
Referenced by do_grant().
DB_IDENTIFIER* db_identifier | ( | DB_OBJECT * | obj | ) |
Definition at line 2629 of file db_admin.c.
References ws_identifier_with_check().
Referenced by db_value_to_value(), dbobj_to_casobj(), pt_evaluate_tree_internal(), pt_make_regu_constant(), pt_make_vid(), pt_serial_to_xasl_class_oid_list(), and setof_mop_to_setof_vobj().
int db_init | ( | const char * | program, |
int | print_version, | ||
const char * | dbname, | ||
const char * | db_path, | ||
const char * | vol_path, | ||
const char * | log_path, | ||
const char * | lob_path, | ||
const char * | host_name, | ||
const bool | overwrite, | ||
const char * | comments, | ||
const char * | addmore_vols_file, | ||
int | npages, | ||
int | desired_pagesize, | ||
int | log_npages, | ||
int | desired_log_page_size, | ||
const char * | lang_charset | ||
) |
Definition at line 164 of file db_admin.c.
References boot_initialize_client(), clientids::client_type, DB_CLIENT_TYPE_ADMIN_UTILITY, boot_db_path_info::db_comments, db_Connect_status, DB_CONNECTION_STATUS_CONNECTED, DB_CONNECTION_STATUS_NOT_CONNECTED, boot_db_path_info::db_host, boot_client_credential::db_name, boot_db_path_info::db_path, dbname, envvar_get(), error(), install_static_methods(), IO_DEFAULT_PAGE_SIZE, IO_MAX_PAGE_SIZE, IO_MIN_PAGE_SIZE, boot_db_path_info::lob_path, boot_db_path_info::log_path, NO_ERROR, NULL, clientids::process_id, clientids::program_name, and boot_db_path_info::vol_path.
Referenced by createdb().
int db_last_volume | ( | void | ) |
Definition at line 391 of file db_admin.c.
References boot_find_last_permanent(), and CHECK_CONNECT_ZERO.
void db_link_static_methods | ( | DB_METHOD_LINK * | methods | ) |
Definition at line 2523 of file db_admin.c.
References db_method_link::function, db_method_link::method, NULL, and sm_add_static_method().
Referenced by au_link_static_methods().
int db_lock_read | ( | DB_OBJECT * | op | ) |
Definition at line 2001 of file db_admin.c.
References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and obj_lock().
Referenced by fn_oid().
int db_lock_write | ( | DB_OBJECT * | op | ) |
Definition at line 2030 of file db_admin.c.
References CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and obj_lock().
Referenced by fn_oid().
Definition at line 804 of file db_admin.c.
References au_login().
Referenced by acldb(), addvoldb(), applyinfo(), applylogdb(), backupdb(), changemode(), checkdb(), checksumdb(), compactdb(), copydb(), copylogdb(), createdb(), deletedb(), diagdb(), gen_tz(), installdb(), killtran(), loaddb_internal(), lockdb(), main(), optimizedb(), paramdump(), plandump(), renamedb(), restoredb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), tzc_compute_timezone_checksum(), uci_connect(), and vacuumdb().
bool db_need_ignore_repl_delay | ( | void | ) |
Definition at line 743 of file db_admin.c.
References db_host_status_list::connected_host_status, DB_HS_HA_DELAYED, NULL, and db_host_status::status.
Referenced by client_capabilities().
bool db_need_reconnect | ( | void | ) |
Definition at line 709 of file db_admin.c.
References db_does_connected_host_have_status(), DB_HS_HA_DELAYED, DB_HS_RECONNECT_INDICATOR, db_host_status_list::hostlist, i, db_host_status_list::last_host_idx, and db_host_status::status.
Referenced by need_reconnect_on_rctime(), and report_abnormal_host_status().
int db_num_volumes | ( | void | ) |
Definition at line 374 of file db_admin.c.
References boot_find_number_permanent_volumes(), and CHECK_CONNECT_ZERO.
DB_OBJECT* db_object | ( | DB_IDENTIFIER * | oid | ) |
Definition at line 2641 of file db_admin.c.
References NULL, and ws_mop().
Referenced by casobj_to_dbobj(), do_reclaim_class_addresses(), get_name_from_class_oid(), net_arg_get_dbobject(), or_create(), show_statistics(), ux_str_to_obj(), and value_to_db_value().
void db_objlist_free | ( | DB_OBJLIST * | list | ) |
Definition at line 2612 of file db_admin.c.
References ml_ext_free(), and NULL.
Referenced by au_start(), chksum_start(), extract_context::clear_schema_workspace(), emit_stored_procedure(), help_class_names(), help_trigger_names(), sch_class_priv(), sch_superclass(), and srv_handle_content_free().
int db_ping_server | ( | int | client_val, |
int * | server_val | ||
) |
Definition at line 983 of file db_admin.c.
References CHECK_CONNECT_ERROR, error(), net_client_ping_server(), and NO_ERROR.
Referenced by la_check_time_commit(), and ux_check_connection().
void db_preload_classes | ( | const char * | name1, |
... | |||
) |
Definition at line 2476 of file db_admin.c.
References CHECK_CONNECT_VOID, ml_add(), NULL, sm_find_class(), and sm_prelink_methods().
void db_print_stats | ( | void | ) |
Definition at line 1985 of file db_admin.c.
References ws_dump().
db_error_log_handler_t db_register_error_log_handler | ( | db_error_log_handler_t | f | ) |
Definition at line 2183 of file db_admin.c.
References er_register_log_handler().
Referenced by cas_log_error_handler_begin(), and cas_log_error_handler_end().
int db_reset_latest_query_status | ( | void | ) |
Definition at line 1132 of file db_admin.c.
References CHECK_CONNECT_ERROR, NO_ERROR, and tran_reset_latest_query_status().
Referenced by csql_execute_statements().
int db_reset_system_parameters_from_assignments | ( | const char * | data | ) |
Definition at line 2742 of file db_admin.c.
References db_set_system_parameters(), error(), NO_ERROR, PRM_ERR_NO_ERROR, rc, sysprm_make_default_values(), and sysprm_set_error().
Referenced by la_apply_statement_log().
Definition at line 868 of file db_admin.c.
References ARG_FILE_LINE, boot_restart_client(), clientids::client_type, boot_client_credential::connect_order, db_Client_type, db_Connect_order, db_Connect_status, DB_CONNECTION_STATUS_CONNECTED, DB_CONNECTION_STATUS_NOT_CONNECTED, db_Database_name, DB_MAX_IDENTIFIER_LENGTH, boot_client_credential::db_name, db_Preferred_hosts, db_Program_name, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, error(), install_static_methods(), jsp_jvm_is_loaded(), NO_ERROR, NULL, os_set_signal_handler(), boot_client_credential::preferred_hosts, prev_sigfpe_handler, clientids::process_id, clientids::program_name, sigfpe_handler(), and strncpy_bufsize.
Referenced by acldb(), addvoldb(), applyinfo(), applylogdb(), backupdb(), changemode(), checkdb(), checksumdb(), compactdb(), copydb(), copylogdb(), db_restart_ex(), diagdb(), gen_tz(), installdb(), killtran(), loaddb_internal(), lockdb(), main(), optimizedb(), paramdump(), plandump(), renamedb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), tzc_compute_timezone_checksum(), uci_connect(), and vacuumdb().
int db_restart_ex | ( | const char * | program, |
const char * | db_name, | ||
const char * | db_user, | ||
const char * | db_password, | ||
const char * | preferred_hosts, | ||
int | client_type | ||
) |
Definition at line 934 of file db_admin.c.
References au_login(), db_restart(), db_set_client_type(), db_set_preferred_hosts(), NO_ERROR, and NULL.
Referenced by csql(), csql_do_session_cmd(), tranlist(), unloaddb(), and ux_database_connect().
Definition at line 1821 of file db_admin.c.
References au_revoke(), CHECK_2ARGS_ERROR, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, CHECK_PARTITION_SUBS, do_check_partitioned_class(), and NULL.
Referenced by catcls_vclass_install(), and do_revoke().
int db_savepoint_transaction | ( | const char * | savepoint_name | ) |
Definition at line 1198 of file db_admin.c.
References CHECK_CONNECT_ERROR, and db_savepoint_transaction_internal().
Referenced by fn_savepoint(), and ux_execute_all().
int db_savepoint_transaction_internal | ( | const char * | savepoint_name | ) |
Definition at line 1166 of file db_admin.c.
References tran_savepoint_internal(), and USER_SAVEPOINT.
Referenced by db_savepoint_transaction(), and do_savepoint().
void db_set_client_type | ( | int | client_type | ) |
Definition at line 495 of file db_admin.c.
References db_Client_type, DB_CLIENT_TYPE_DEFAULT, and DB_CLIENT_TYPE_MAX.
Referenced by acldb(), addvoldb(), applyinfo(), applylogdb(), backupdb(), changemode(), checkdb(), checksumdb(), compactdb(), copydb(), copylogdb(), createdb(), db_restart_ex(), deletedb(), diagdb(), gen_tz(), installdb(), killtran(), loaddb_internal(), lockdb(), main(), optimizedb(), paramdump(), plandump(), renamedb(), restoredb(), restoreslave(), spacedb(), statdump(), synccolldb(), tde(), tranlist(), tzc_compute_timezone_checksum(), and vacuumdb().
void db_set_connect_order | ( | int | connect_order | ) |
Definition at line 522 of file db_admin.c.
References db_Connect_order.
Referenced by ux_database_connect().
void db_set_connected_host_status | ( | char * | host_connected | ) |
Definition at line 681 of file db_admin.c.
References db_host_status_list::connected_host_status, db_add_host_status(), db_find_host_status(), DB_HS_NORMAL, and NULL.
Referenced by boot_client_all_finalize().
int db_set_global_transaction_info | ( | int | global_transaction_id, |
void * | info, | ||
int | size | ||
) |
Definition at line 1262 of file db_admin.c.
References ARG_FILE_LINE, CHECK_CONNECT_ERROR, CHECK_MODIFICATION_ERROR, ER_OBJ_INVALID_ARGUMENTS, er_set(), ER_WARNING_SEVERITY, NULL, and tran_set_global_tran_info().
Referenced by fn_xa_prepare().
void db_set_host_status | ( | char * | hostname, |
int | status | ||
) |
Definition at line 649 of file db_admin.c.
References db_add_host_status(), db_Delayed_hosts_count, db_find_host_status(), DB_HS_HA_DELAYED, NULL, and db_host_status::status.
Referenced by boot_client_all_finalize(), boot_restart_client(), and check_server_capabilities().
void db_set_interrupt | ( | int | set | ) |
Definition at line 1445 of file db_admin.c.
References CHECK_CONNECT_VOID, and locator_set_sig_interrupt().
Referenced by backupdb_sig_interrupt_handler(), csql_display_trace(), csql_execute_statements(), process_request(), query_cancel(), and signal_intr().
int db_set_isolation | ( | DB_TRAN_ISOLATION | isolation | ) |
Definition at line 1535 of file db_admin.c.
References CHECK_CONNECT_MINUSONE, TM_TRAN_ASYNC_WS, and tran_reset_isolation().
Referenced by backupdb(), checkdb(), checksumdb(), compactdb(), compactdb_start(), do_reclaim_class_addresses(), lockdb(), ux_set_isolation_level(), and vacuumdb().
int db_set_lock_timeout | ( | int | seconds | ) |
Definition at line 1496 of file db_admin.c.
References CHECK_CONNECT_MINUSONE, CHECK_MODIFICATION_MINUSONE, and tran_reset_wait_times().
Referenced by applylogdb(), checksumdb(), and unloaddb().
void db_set_max_num_delayed_hosts_lookup | ( | int | max_num_delayed_hosts_lookup | ) |
Definition at line 528 of file db_admin.c.
References db_Max_num_delayed_hosts_lookup.
Referenced by ux_database_connect().
Definition at line 1743 of file db_admin.c.
References au_set_password(), CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and CHECK_MODIFICATION_ERROR.
void db_set_preferred_hosts | ( | const char * | hosts | ) |
Definition at line 508 of file db_admin.c.
References db_Preferred_hosts, free_and_init, and strdup().
Referenced by db_restart_ex(), and ux_database_connect().
void db_set_server_session_key | ( | const char * | key | ) |
Definition at line 2843 of file db_admin.c.
References boot_set_server_session_key().
Referenced by cas_set_session_id().
void db_set_session_id | ( | const SESSION_ID | session_id | ) |
Definition at line 2870 of file db_admin.c.
References db_Session_id.
Referenced by cas_set_session_id(), db_find_or_create_session(), and ux_set_session_id().
int db_set_suppress_repl_on_transaction | ( | int | set | ) |
Definition at line 1460 of file db_admin.c.
References CHECK_CONNECT_ERROR, and log_set_suppress_repl_on_transaction().
Referenced by do_execute_statement(), and do_statement().
int db_set_system_parameters | ( | const char * | data | ) |
Definition at line 2682 of file db_admin.c.
References ARG_FILE_LINE, Au_dba_user, au_is_dba_group_member(), Au_user, cleanup(), ER_AU_DBA_ONLY, ER_ERROR_SEVERITY, er_set(), error(), NO_ERROR, NULL, PRM_ERR_NO_ERROR, PRM_ERR_NOT_FOR_CLIENT, PRM_ERR_NOT_FOR_CLIENT_NO_AUTH, rc, sysprm_change_parameter_values(), sysprm_change_server_parameters(), sysprm_free_assign_values(), sysprm_set_error(), and sysprm_validate_change_parameters().
Referenced by csql_set_sys_param(), db_reset_system_parameters_from_assignments(), db_set_system_parameters_for_ha_repl(), do_set_names(), do_set_sys_params(), do_set_timezone(), and ux_set_default_setting().
int db_set_system_parameters_for_ha_repl | ( | const char * | data | ) |
Definition at line 2727 of file db_admin.c.
References db_set_system_parameters().
Referenced by la_apply_statement_log().
Definition at line 1765 of file db_admin.c.
References au_set_user_comment(), CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, and CHECK_MODIFICATION_ERROR.
int db_shutdown | ( | void | ) |
Definition at line 964 of file db_admin.c.
References boot_shutdown_client(), db_Connect_status, DB_CONNECTION_STATUS_NOT_CONNECTED, db_Database_name, db_Disable_modifications, db_free_execution_plan(), db_Program_name, error(), NO_ERROR, os_set_signal_handler(), and prev_sigfpe_handler.
Referenced by acldb(), addvoldb(), applyinfo(), applylogdb(), backupdb(), changemode(), checkdb(), checksumdb(), compactdb(), copylogdb(), createdb(), csql_do_session_cmd(), csql_exit_cleanup(), csql_exit_session(), diagdb(), gen_tz(), installdb(), killtran(), loaddb_internal(), lockdb(), main(), optimizedb(), paramdump(), plandump(), renamedb(), restoreslave(), spacedb(), start_csql(), statdump(), synccolldb(), tde(), tranlist(), tzc_compute_timezone_checksum(), uci_disconnect(), unloaddb(), ux_database_shutdown(), and vacuumdb().
void db_string_free | ( | char * | string | ) |
Definition at line 2596 of file db_admin.c.
References db_ws_free(), and NULL.
Referenced by au_login_method(), db_get_user_and_host_name(), do_replicate_statement(), fetch_trigger(), pt_evaluate_db_value_expr(), pt_make_query_show_grants_curr_usr(), pt_make_query_show_table(), and pt_to_regu_variable().
void db_synchronize_cache | ( | void | ) |
Definition at line 1586 of file db_admin.c.
References CHECK_CONNECT_VOID, and locator_synch_isolation_incons().
Referenced by fetch_result().
int db_totalpgs | ( | const char * | volume_label | ) |
Definition at line 2073 of file db_admin.c.
References CHECK_CONNECT_ZERO, disk_get_total_numpages(), and NULL_VOLID.
void db_unlink_static_methods | ( | DB_METHOD_LINK * | methods | ) |
Definition at line 2546 of file db_admin.c.
References db_method_link::method, NULL, and sm_delete_static_method().
void db_update_row_count_cache | ( | const int | row_count | ) |
Definition at line 2924 of file db_admin.c.
References db_Row_count.
Referenced by csql_display_trace(), db_find_or_create_session(), do_commit(), pt_evaluate_db_value_expr(), pt_fold_const_expr(), and update_execution_values().
char* db_vol_label | ( | int | volid, |
char * | vol_fullname | ||
) |
Definition at line 412 of file db_admin.c.
References CHECK_CONNECT_ZERO_TYPE, and disk_get_fullname().
void db_warnspace | ( | const char * | volume_label | ) |
Definition at line 2452 of file db_admin.c.
References CHECK_CONNECT_VOID, fileio_find_volume_id_with_label(), and NULL.
|
static |
Definition at line 2302 of file db_admin.c.
References ARG_FILE_LINE, CHECK_1ARG_ERROR, CHECK_CONNECT_ERROR, DB_FETCH_READ, DB_FETCH_WRITE, db_get_object(), DB_TYPE_OBJECT, db_value_clear(), DB_VALUE_TYPE, er_errid(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), free_and_init, i, locator_fetch_set(), max, NO_ERROR, NULL, set_get_element(), and set_size().
Referenced by db_fetch_seq(), and db_fetch_set().
|
static |
Definition at line 130 of file db_admin.c.
References au_link_static_methods().
Referenced by db_init(), and db_restart().
void sigfpe_handler | ( | int | sig | ) |
Definition at line 822 of file db_admin.c.
References os_set_signal_handler(), and prev_sigfpe_handler.
Referenced by conn_restart_client(), and db_restart().
|
static |
Definition at line 114 of file db_admin.c.
Referenced by db_get_client_type(), db_restart(), and db_set_client_type().
|
static |
Definition at line 104 of file db_admin.c.
Referenced by db_restart(), and db_set_connect_order().
char db_Database_name[DB_MAX_IDENTIFIER_LENGTH+1] |
Definition at line 100 of file db_admin.c.
Referenced by conn_restart_client(), db_get_database_name(), db_restart(), and db_shutdown().
|
static |
Definition at line 106 of file db_admin.c.
Referenced by db_clear_delayed_hosts_count(), db_get_delayed_hosts_count(), and db_set_host_status().
|
static |
Definition at line 109 of file db_admin.c.
|
static |
Definition at line 105 of file db_admin.c.
Referenced by db_get_max_num_delayed_hosts_lookup(), and db_set_max_num_delayed_hosts_lookup().
|
static |
Definition at line 103 of file db_admin.c.
Referenced by db_restart(), and db_set_preferred_hosts().
char db_Program_name[PATH_MAX] |
Definition at line 101 of file db_admin.c.
Referenced by conn_restart_client(), db_restart(), and db_shutdown().
void(* prev_sigfpe_handler) (int) = SIG_DFL |
Definition at line 70 of file db_admin.c.
Referenced by ci_conn_close_impl(), conn_restart_client(), db_restart(), db_shutdown(), and sigfpe_handler().