CUBRID Engine  latest
load_db.c File Reference
#include "config.h"
#include "chartype.h"
#include "db.h"
#include "load_object.h"
#include "network_interface_cl.h"
#include "porting.h"
#include "schema_manager.h"
#include "transform.h"
#include "utility.h"
#include "authenticate.h"
#include "ddl_log.h"
#include <fstream>
#include <thread>
Include dependency graph for load_db.c:

Go to the source code of this file.

Functions

static int ldr_validate_object_file (const char *argv0, load_args *args)
 
static int ldr_get_start_line_no (std::string &file_name)
 
static FILE * ldr_check_file (std::string &file_name, int &error_code)
 
static int loaddb_internal (UTIL_FUNCTION_ARG *arg, int dba_mode)
 
static void ldr_exec_query_interrupt_handler (void)
 
static int ldr_exec_query_from_file (const char *file_name, FILE *input_stream, int *start_line, load_args *args)
 
static int ldr_compare_attribute_with_meta (char *table_name, char *meta, DB_ATTRIBUTE *attribute)
 
static int ldr_compare_storage_order (FILE *schema_file)
 
static void get_loaddb_args (UTIL_ARG_MAP *arg_map, load_args *args)
 
static void print_stats (std::vector< cubload::stats > &stats, cubload::load_args &args, int *status)
 
static void ldr_server_load (load_args *args, int *exit_status, bool *interrupted)
 
static void register_signal_handlers ()
 
static int load_has_authorization (const std::string &class_name, DB_AUTH au_type)
 
static int load_object_file (load_args *args, int *exit_status)
 
static void print_er_msg ()
 
void print_log_msg (int verbose, const char *fmt,...)
 
static void load_usage (const char *argv0)
 
static char * ldr_get_token (char *str, char **out_str, char start, char end)
 
int loaddb_user (UTIL_FUNCTION_ARG *arg)
 

Variables

const int LOAD_INDEX_MIN_SORT_BUFFER_PAGES = 8192
 
const char * LOAD_INDEX_MIN_SORT_BUFFER_PAGES_STRING = "8192"
 
const char * LOADDB_LOG_FILENAME_SUFFIX = "loaddb.log"
 
static FILE * loaddb_log_file
 
int interrupt_query = false
 
bool load_interrupted = false
 

Function Documentation

static FILE * ldr_check_file ( std::string &  file_name,
int &  error_code 
)
static

Definition at line 197 of file load_db.c.

References ER_FAILED, LOADDB_MSG_BAD_INFILE, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_LOADDB, NO_ERROR, NULL, print_log_msg(), and util_log_write_errstr().

Referenced by loaddb_internal().

Here is the caller graph for this function:

static int ldr_compare_attribute_with_meta ( char *  table_name,
char *  meta,
DB_ATTRIBUTE attribute 
)
static
static int ldr_compare_storage_order ( FILE *  schema_file)
static

Definition at line 377 of file load_db.c.

References db_attribute_class(), db_attribute_next(), db_find_class(), db_get_attributes(), ER_FAILED, error(), ldr_compare_attribute_with_meta(), ldr_get_token(), NO_ERROR, NULL, p, and print_log_msg().

Referenced by loaddb_internal().

Here is the caller graph for this function:

static void ldr_exec_query_interrupt_handler ( void  )
static

Definition at line 938 of file load_db.c.

References interrupt_query, and log_set_interrupt().

Referenced by ldr_exec_query_from_file().

Here is the caller graph for this function:

static int ldr_get_start_line_no ( std::string &  file_name)
static

Definition at line 218 of file load_db.c.

References char_isdigit(), and p.

Referenced by loaddb_internal().

Here is the caller graph for this function:

static char* ldr_get_token ( char *  str,
char **  out_str,
char  start,
char  end 
)
static

Definition at line 259 of file load_db.c.

References NULL, and p.

Referenced by ldr_compare_attribute_with_meta(), and ldr_compare_storage_order().

Here is the caller graph for this function:

static int load_has_authorization ( const std::string &  class_name,
DB_AUTH  au_type 
)
static
static int load_object_file ( load_args args,
int *  exit_status 
)
static
static void load_usage ( const char *  argv0)
static

Definition at line 147 of file load_db.c.

References basename(), LOADDB_MSG_USAGE, MSGCAT_CATALOG_UTILS, msgcat_message(), and MSGCAT_UTIL_SET_LOADDB.

Referenced by ldr_validate_object_file().

Here is the caller graph for this function:

static int loaddb_internal ( UTIL_FUNCTION_ARG arg,
int  dba_mode 
)
static

Definition at line 475 of file load_db.c.

References APP_NAME_LOADDB, UTIL_FUNCTION_ARG::arg_map, UTIL_FUNCTION_ARG::argv0, AU_DISABLE, AU_DISABLE_PASSWORDS, AU_ENABLE, au_is_dba_group_member(), Au_user, UTIL_FUNCTION_ARG::command_name, cubload::load_args::compare_storage_order, CT_INDEX_NAME, CT_INDEXKEY_NAME, CT_TRIGGER_NAME, DB_CLIENT_TYPE_ADMIN_UTILITY, db_commit_transaction(), db_disable_trigger(), db_end_session(), db_error_string(), db_login(), db_restart(), db_set_client_type(), db_shutdown(), ER_AU_INVALID_PASSWORD, er_errid(), ER_FAILED, ER_FILE_UNKNOWN_FILE, er_filter_fileset(), er_init(), ER_NEVER_EXIT, error(), cubload::load_args::error_file, fopen_ex(), get_ignored_errors(), get_loaddb_args(), cubload::load_args::ignore_class_file, cubload::load_args::ignore_logging, cubload::load_args::index_file, ldr_check_file(), ldr_compare_storage_order(), ldr_exec_query_from_file(), ldr_get_start_line_no(), ldr_sa_load(), ldr_server_load(), ldr_validate_object_file(), LOAD_CHECK_ONLY_L, LOAD_CS_FORCE_LOAD_S, LOAD_CS_MODE_S, LOAD_ERROR_CONTROL_FILE_L, LOAD_INDEX_FILE_S, LOAD_INDEX_MIN_SORT_BUFFER_PAGES, LOAD_INDEX_MIN_SORT_BUFFER_PAGES_STRING, LOAD_LOAD_ONLY_L, cubload::load_args::load_only, LOAD_SCHEMA_FILE_S, LOAD_TRIGGER_FILE_L, LOADDB_FILE_TYPE_INDEX, LOADDB_FILE_TYPE_SCHEMA, LOADDB_FILE_TYPE_TRIGGER, loaddb_log_file, LOADDB_LOG_FILENAME_SUFFIX, LOADDB_MSG_BAD_INFILE, LOADDB_MSG_CLOSING, LOADDB_MSG_INCOMPATIBLE_ARGS, LOADDB_MSG_PASSWORD_PROMPT, locator_log_force_nologging(), logddl_destroy(), logddl_init(), logddl_set_app_name(), logddl_set_db_name(), logddl_set_err_code(), logddl_set_load_filename(), logddl_set_loaddb_file_type(), logddl_set_logging_enabled(), logddl_set_pid(), logddl_set_user_name(), logddl_write_end(), cubload::load_args::m_ignored_errors, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_LOADDB, NO_ERROR, NULL, cubload::load_args::object_file, obt_Enable_autoincrement, cubload::load_args::parse_ignore_class_file(), cubload::load_args::password, PRINT_AND_LOG_ERR_MSG, print_log_msg(), prm_get_bool_value(), prm_get_integer_value(), prm_get_name(), PRM_ID_DDL_AUDIT_LOG, PRM_ID_HA_MODE, PRM_ID_JAVA_STORED_PROCEDURE, PRM_ID_SR_NBUFFERS, cubload::load_args::schema_file, sm_update_all_catalog_statistics(), sm_update_catalog_statistics(), STATS_WITH_FULLSCAN, strlen, cubload::load_args::syntax_check, SYSPRM_IGNORE_INTL_PARAMS, sysprm_load_and_init(), sysprm_set_force(), cubload::load_args::trigger_file, cubload::load_args::user_name, util_log_write_errstr(), utility_get_option_bool_value(), utility_get_option_int_value(), cubload::load_args::verbose, and cubload::load_args::volume.

Referenced by loaddb_user().

Here is the caller graph for this function:

int loaddb_user ( UTIL_FUNCTION_ARG arg)

Definition at line 927 of file load_db.c.

References loaddb_internal().

static void print_er_msg ( )
static

Definition at line 132 of file load_db.c.

References er_has_error(), and er_msg().

Referenced by ldr_server_load().

Here is the caller graph for this function:

void print_log_msg ( int  verbose,
const char *  fmt,
  ... 
)
void print_stats ( std::vector< cubload::stats > &  stats,
cubload::load_args args,
int *  status 
)
static

Definition at line 109 of file load_db.c.

References print_log_msg(), cubload::load_args::syntax_check, and cubload::load_args::verbose.

Referenced by ldr_server_load(), and load_object_file().

Here is the caller graph for this function:

static void register_signal_handlers ( )
static

Definition at line 1275 of file load_db.c.

References load_interrupted, loaddb_interrupt(), and util_arm_signal_handlers().

Referenced by ldr_server_load().

Here is the caller graph for this function:

Variable Documentation

int interrupt_query = false

Definition at line 50 of file load_db.c.

Referenced by ldr_exec_query_from_file(), and ldr_exec_query_interrupt_handler().

const int LOAD_INDEX_MIN_SORT_BUFFER_PAGES = 8192

Definition at line 42 of file load_db.c.

Referenced by loaddb_internal().

const char* LOAD_INDEX_MIN_SORT_BUFFER_PAGES_STRING = "8192"

Definition at line 43 of file load_db.c.

Referenced by loaddb_internal().

bool load_interrupted = false

Definition at line 51 of file load_db.c.

Referenced by ldr_server_load(), and register_signal_handlers().

FILE* loaddb_log_file
static

Definition at line 48 of file load_db.c.

Referenced by loaddb_internal(), and print_log_msg().

const char* LOADDB_LOG_FILENAME_SUFFIX = "loaddb.log"

Definition at line 44 of file load_db.c.

Referenced by loaddb_internal().