CUBRID Engine  latest
db_admin.c File Reference
#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
 

Functions

static DB_HOST_STATUSdb_add_host_status (char *hostname, int status)
 
static DB_HOST_STATUSdb_find_host_status (char *hostname)
 
static void install_static_methods (void)
 
static int fetch_set_internal (DB_SET *set, DB_FETCH_MODE purpose, int quit_on_error)
 
void sigfpe_handler (int sig)
 
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)
 
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)
 
int db_add_volume_ex (DBDEF_VOL_EXT_INFO *ext_info)
 
int db_num_volumes (void)
 
int db_last_volume (void)
 
char * db_vol_label (int volid, char *vol_fullname)
 
char * db_get_database_name (void)
 
char * db_get_database_version (void)
 
const char * db_get_database_comments (void)
 
int db_get_client_type (void)
 
void db_set_client_type (int client_type)
 
void db_set_preferred_hosts (const char *hosts)
 
void db_set_connect_order (int connect_order)
 
void db_set_max_num_delayed_hosts_lookup (int max_num_delayed_hosts_lookup)
 
int db_get_max_num_delayed_hosts_lookup (void)
 
int db_get_delayed_hosts_count (void)
 
void db_clear_delayed_hosts_count (void)
 
bool db_enable_trigger (void)
 
bool db_disable_trigger (void)
 
void db_clear_host_status (void)
 
void db_set_host_status (char *hostname, int status)
 
void db_set_connected_host_status (char *host_connected)
 
bool db_need_reconnect (void)
 
bool db_need_ignore_repl_delay (void)
 
bool db_does_connected_host_have_status (int status)
 
int db_get_host_list_with_given_status (char **hostlist, int list_size, int status)
 
int db_login (const char *name, const char *password)
 
void db_clear_host_connected (void)
 
int db_restart (const char *program, int print_version, const char *volume)
 
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)
 
int db_shutdown (void)
 
int db_ping_server (int client_val, int *server_val)
 
int db_disable_modification (void)
 
int db_enable_modification (void)
 
int db_end_session (void)
 
int db_get_row_count (int *row_count)
 
int db_get_last_insert_id (DB_VALUE *value)
 
int db_get_variable (DB_VALUE *name, DB_VALUE *value)
 
int db_commit_transaction (void)
 
int db_abort_transaction (void)
 
int db_reset_latest_query_status (void)
 
int db_commit_is_needed (void)
 
int db_savepoint_transaction_internal (const char *savepoint_name)
 
int db_savepoint_transaction (const char *savepoint_name)
 
int db_abort_to_savepoint_internal (const char *savepoint_name)
 
int db_abort_to_savepoint (const char *savepoint_name)
 
int db_set_global_transaction_info (int global_transaction_id, void *info, int size)
 
int db_get_global_transaction_info (int global_transaction_id, void *buffer, int size)
 
int db_2pc_start_transaction (void)
 
int db_2pc_prepare_transaction (void)
 
int db_2pc_prepared_transactions (int gtrids[], int size)
 
int db_2pc_attach_transaction (int global_transaction_id)
 
int db_2pc_prepare_to_commit_transaction (int global_transaction_id)
 
void db_set_interrupt (int set)
 
int db_set_suppress_repl_on_transaction (int set)
 
int db_checkpoint (void)
 
int db_set_lock_timeout (int seconds)
 
int db_set_isolation (DB_TRAN_ISOLATION isolation)
 
void db_get_tran_settings (int *lock_wait, DB_TRAN_ISOLATION *tran_isolation)
 
void db_synchronize_cache (void)
 
DB_OBJECTdb_find_user (const char *name)
 
int db_find_user_to_drop (const char *name, DB_OBJECT **user)
 
DB_OBJECTdb_add_user (const char *name, int *exists)
 
int db_drop_user (DB_OBJECT *user)
 
int db_add_member (DB_OBJECT *user, DB_OBJECT *member)
 
int db_drop_member (DB_OBJECT *user, DB_OBJECT *member)
 
int db_set_password (DB_OBJECT *user, const char *old_passwd, const char *new_passwd)
 
int db_set_user_comment (DB_OBJECT *user, const char *comment)
 
int db_grant (MOP user, MOP class_, AU_TYPE auth, int grant_option)
 
int db_revoke (MOP user, MOP class_mop, AU_TYPE auth)
 
int db_check_authorization (MOP op, DB_AUTH auth)
 
int db_check_authorization_and_grant_option (MOP op, DB_AUTH auth)
 
DB_OBJECTdb_get_owner (DB_OBJECT *class_obj)
 
char * db_get_user_name (void)
 
char * db_get_user_and_host_name (void)
 
DB_OBJECTdb_get_user (void)
 
void db_print_stats (void)
 
int db_lock_read (DB_OBJECT *op)
 
int db_lock_write (DB_OBJECT *op)
 
int db_freepgs (const char *volume_label)
 
int db_totalpgs (const char *volume_label)
 
const char * db_error_string_test (int level)
 
const char * db_error_string (int level)
 
int db_error_code_test (void)
 
int db_error_code (void)
 
int db_error_init (const char *logfile)
 
db_error_log_handler_t db_register_error_log_handler (db_error_log_handler_t f)
 
int db_fetch_array (DB_OBJECT **objects, DB_FETCH_MODE purpose, int quit_on_error)
 
int db_fetch_list (DB_OBJLIST *objects, DB_FETCH_MODE purpose, int quit_on_error)
 
int db_fetch_set (DB_SET *set, DB_FETCH_MODE purpose, int quit_on_error)
 
int db_fetch_seq (DB_SEQ *seq, DB_FETCH_MODE purpose, int quit_on_error)
 
int db_fetch_composition (DB_OBJECT *object, DB_FETCH_MODE purpose, int max_level, int quit_on_error)
 
void db_warnspace (const char *volume_label)
 
void db_preload_classes (const char *name1,...)
 
void db_link_static_methods (DB_METHOD_LINK *methods)
 
void db_unlink_static_methods (DB_METHOD_LINK *methods)
 
void db_flush_static_methods (void)
 
void db_force_method_reload (MOP obj)
 
void db_string_free (char *string)
 
void db_objlist_free (DB_OBJLIST *list)
 
DB_IDENTIFIERdb_identifier (DB_OBJECT *obj)
 
DB_OBJECTdb_object (DB_IDENTIFIER *oid)
 
int db_chn (DB_OBJECT *obj, DB_FETCH_MODE purpose)
 
int db_set_system_parameters (const char *data)
 
int db_set_system_parameters_for_ha_repl (const char *data)
 
int db_reset_system_parameters_from_assignments (const char *data)
 
int db_get_system_parameters (char *data, int len)
 
char * db_get_host_connected (void)
 
int db_get_ha_server_state (char *buffer, int maxlen)
 
void db_set_server_session_key (const char *key)
 
char * db_get_server_session_key (void)
 
SESSION_ID db_get_session_id (void)
 
void db_set_session_id (const SESSION_ID session_id)
 
int db_find_or_create_session (const char *db_user, const char *program_name)
 
int db_get_row_count_cache (void)
 
void db_update_row_count_cache (const int row_count)
 

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 Documentation

Definition at line 77 of file db_admin.c.

Definition at line 84 of file db_admin.c.

Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_2pc_prepared_transactions ( int  gtrids[],
int  size 
)
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().

Here is the caller graph for this function:

int db_abort_to_savepoint ( const char *  savepoint_name)
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().

Here is the caller graph for this function:

DB_HOST_STATUS * db_add_host_status ( char *  hostname,
int  status 
)
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().

Here is the caller graph for this function:

int db_add_member ( DB_OBJECT user,
DB_OBJECT member 
)

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().

Here is the caller graph for this function:

DB_OBJECT* db_add_user ( const char *  name,
int *  exists 
)

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().

Here is the caller graph for this function:

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 
)
int db_add_volume_ex ( DBDEF_VOL_EXT_INFO ext_info)
int db_check_authorization ( MOP  op,
DB_AUTH  auth 
)

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().

Here is the caller graph for this function:

int db_check_authorization_and_grant_option ( MOP  op,
DB_AUTH  auth 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void db_clear_host_status ( void  )
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_drop_member ( DB_OBJECT user,
DB_OBJECT member 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

bool db_enable_trigger ( void  )

Definition at line 558 of file db_admin.c.

References tr_set_execution_state().

Referenced by ux_database_connect().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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_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().

Here is the caller graph for this function:

int db_fetch_composition ( DB_OBJECT object,
DB_FETCH_MODE  purpose,
int  max_level,
int  quit_on_error 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

DB_HOST_STATUS * db_find_host_status ( char *  hostname)
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().

Here is the caller graph for this function:

int db_find_or_create_session ( const char *  db_user,
const char *  program_name 
)
DB_OBJECT* db_find_user ( const char *  name)
int db_find_user_to_drop ( const char *  name,
DB_OBJECT **  user 
)

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

char* db_get_host_connected ( void  )

Definition at line 2806 of file db_admin.c.

Referenced by csql_print_database(), and ux_database_connect().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

DB_OBJECT* db_get_owner ( DB_OBJECT class_obj)

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_get_system_parameters ( char *  data,
int  len 
)
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().

Here is the caller graph for this function:

char* db_get_user_and_host_name ( void  )
char* db_get_user_name ( void  )
int db_get_variable ( DB_VALUE name,
DB_VALUE value 
)

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().

Here is the caller graph for this function:

int db_grant ( MOP  user,
MOP  class_,
AU_TYPE  auth,
int  grant_option 
)

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().

Here is the caller graph for this function:

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 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_num_volumes ( void  )

Definition at line 374 of file db_admin.c.

References boot_find_number_permanent_volumes(), and CHECK_CONNECT_ZERO.

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().

Here is the caller graph for this function:

void db_objlist_free ( DB_OBJLIST list)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_revoke ( MOP  user,
MOP  class_mop,
AU_TYPE  auth 
)

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

void db_set_host_status ( char *  hostname,
int  status 
)
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().

Here is the caller graph for this function:

int db_set_isolation ( DB_TRAN_ISOLATION  isolation)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_set_password ( DB_OBJECT user,
const char *  old_passwd,
const char *  new_passwd 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int db_set_user_comment ( DB_OBJECT user,
const char *  comment 
)
void db_string_free ( char *  string)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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 int fetch_set_internal ( DB_SET set,
DB_FETCH_MODE  purpose,
int  quit_on_error 
)
static
static void install_static_methods ( void  )
static

Definition at line 130 of file db_admin.c.

References au_link_static_methods().

Referenced by db_init(), and db_restart().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

Variable Documentation

int db_Client_type = DB_CLIENT_TYPE_DEFAULT
static

Definition at line 114 of file db_admin.c.

Referenced by db_get_client_type(), db_restart(), and db_set_client_type().

int db_Connect_order = DB_CONNECT_ORDER_SEQ
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().

int db_Delayed_hosts_count = 0
static
DB_HOST_STATUS_LIST db_Host_status_list
static

Definition at line 109 of file db_admin.c.

int db_Max_num_delayed_hosts_lookup = 0
static
char* db_Preferred_hosts = NULL
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