CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <assert.h>
#include "dbi.h"
#include "porting.h"
#include "utility.h"
#include "databases_file.h"
#include "boot_sr.h"
#include "log_impl.h"
#include "btree.h"
#include "transform.h"
#include "message_catalog.h"
#include "error_manager.h"
#include "system_parameter.h"
#include "language_support.h"
Go to the source code of this file.
Classes | |
struct | r91_disk_var_header |
struct | VOLUME_UNDO_INFO |
Macros | |
#define | V9_1_LEVEL (9.1f) |
#define | V9_2_LEVEL (9.2f) |
#define | FOPEN_AND_CHECK(fp, filename, mode) |
#define | FSEEK_AND_CHECK(fp, size, origin, filename) |
#define | FREAD_AND_CHECK(ptr, size, n, fp, filename) |
#define | FWRITE_AND_CHECK(ptr, size, n, fp, filename) |
#define | FFLUSH_AND_CHECK(fp, filename) |
#define | FCLOSE_AND_CHECK(fp, filename) |
#define | UNDO_LIST_SIZE (32) |
#define | QUERY_SIZE 1024 |
Typedefs | |
typedef struct r91_disk_var_header | R91_DISK_VAR_HEADER |
Functions | |
static int | fix_all_volume_header (const char *db_path) |
static int | fix_volume_header (const char *vol_path) |
static int | undo_fix_volume_header (const char *vol_path, char *undo_page, int size) |
static char * | make_volume_header_undo_page (const char *vol_path, int size) |
static void | free_volume_header_undo_list (void) |
static int | get_active_log_vol_path (const char *db_path, char *logvol_path) |
static int | check_and_fix_compat_level (const char *db_name, const char *vol_path) |
static int | get_db_path (const char *db_name, char *db_full_path) |
static int | fix_codeset_in_active_log (const char *db_path, INTL_CODESET codeset) |
int | catcls_get_db_collation (THREAD_ENTRY *thread_p, LANG_COLL_COMPAT **db_collations, int *coll_cnt) |
static int | undo_fix_compat_level (const char *db_path) |
static void | intr_handler (int sig_no) |
static int | get_codeset_from_db_root (void) |
int | main (int argc, char *argv[]) |
Variables | |
static int | vol_undo_list_length |
static int | vol_undo_count |
static VOLUME_UNDO_INFO * | vol_undo_info |
#define FCLOSE_AND_CHECK | ( | fp, | |
filename | |||
) |
Definition at line 103 of file migrate.c.
Referenced by check_and_fix_compat_level(), fix_codeset_in_active_log(), fix_volume_header(), get_active_log_vol_path(), undo_fix_compat_level(), and undo_fix_volume_header().
#define FFLUSH_AND_CHECK | ( | fp, | |
filename | |||
) |
Definition at line 93 of file migrate.c.
Referenced by check_and_fix_compat_level(), fix_codeset_in_active_log(), fix_volume_header(), undo_fix_compat_level(), and undo_fix_volume_header().
#define FOPEN_AND_CHECK | ( | fp, | |
filename, | |||
mode | |||
) |
Definition at line 51 of file migrate.c.
Referenced by check_and_fix_compat_level(), fix_all_volume_header(), fix_codeset_in_active_log(), fix_volume_header(), get_active_log_vol_path(), undo_fix_compat_level(), and undo_fix_volume_header().
#define FREAD_AND_CHECK | ( | ptr, | |
size, | |||
n, | |||
fp, | |||
filename | |||
) |
Definition at line 71 of file migrate.c.
Referenced by check_and_fix_compat_level(), fix_codeset_in_active_log(), fix_volume_header(), and undo_fix_compat_level().
#define FSEEK_AND_CHECK | ( | fp, | |
size, | |||
origin, | |||
filename | |||
) |
#define FWRITE_AND_CHECK | ( | ptr, | |
size, | |||
n, | |||
fp, | |||
filename | |||
) |
Definition at line 82 of file migrate.c.
Referenced by check_and_fix_compat_level(), fix_codeset_in_active_log(), fix_volume_header(), undo_fix_compat_level(), and undo_fix_volume_header().
#define QUERY_SIZE 1024 |
Referenced by get_codeset_from_db_root().
#define UNDO_LIST_SIZE (32) |
Definition at line 112 of file migrate.c.
Referenced by fix_all_volume_header().
#define V9_1_LEVEL (9.1f) |
Definition at line 48 of file migrate.c.
Referenced by check_and_fix_compat_level(), and undo_fix_compat_level().
#define V9_2_LEVEL (9.2f) |
Definition at line 49 of file migrate.c.
Referenced by check_and_fix_compat_level(), and main().
typedef struct r91_disk_var_header R91_DISK_VAR_HEADER |
int catcls_get_db_collation | ( | THREAD_ENTRY * | thread_p, |
LANG_COLL_COMPAT ** | db_collations, | ||
int * | coll_cnt | ||
) |
Definition at line 4910 of file catalog_class.c.
Referenced by main().
Definition at line 231 of file migrate.c.
References log_page::area, log_header::db_charset, log_header::db_compatibility, log_header::db_logpagesize, ER_FAILED, FCLOSE_AND_CHECK, FFLUSH_AND_CHECK, FOPEN_AND_CHECK, FREAD_AND_CHECK, FWRITE_AND_CHECK, get_active_log_vol_path(), INTL_CODESET_NONE, IO_MAX_PAGE_SIZE, log_header::is_shutdown, LOG_PAGESIZE, NO_ERROR, NULL, rel_disk_compatible(), V9_1_LEVEL, and V9_2_LEVEL.
Referenced by main().
|
static |
Definition at line 623 of file migrate.c.
References ER_FAILED, fileio_make_volume_info_name(), fix_volume_header(), FOPEN_AND_CHECK, LOG_DBLOG_ACTIVE_VOLID, NO_ERROR, NULL, NULL_VOLID, UNDO_LIST_SIZE, vol_undo_count, vol_undo_list_length, and r91_disk_var_header::volid.
Referenced by main().
|
static |
Definition at line 200 of file migrate.c.
References log_page::area, log_header::db_charset, ER_FAILED, FCLOSE_AND_CHECK, FFLUSH_AND_CHECK, FOPEN_AND_CHECK, FREAD_AND_CHECK, FWRITE_AND_CHECK, get_active_log_vol_path(), IO_MAX_PAGE_SIZE, LOG_PAGESIZE, NO_ERROR, and NULL.
Referenced by main().
|
static |
Definition at line 672 of file migrate.c.
References r91_disk_var_header::boot_hfid, r91_disk_var_header::chkpt_lsa, CUBRID_MAGIC_MAX_LENGTH, r91_disk_var_header::db_creation, ER_FAILED, FCLOSE_AND_CHECK, FFLUSH_AND_CHECK, FOPEN_AND_CHECK, FREAD_AND_CHECK, r91_disk_var_header::free_pages, r91_disk_var_header::free_sects, FWRITE_AND_CHECK, HFID_COPY, r91_disk_var_header::hint_allocsect, IO_MAX_PAGE_SIZE, IO_PAGESIZE, r91_disk_var_header::iopagesize, fileio_page_reserved::lsa, LSA_COPY(), r91_disk_var_header::magic, make_volume_header_undo_page(), MAX_ALIGNMENT, NO_ERROR, NULL, r91_disk_var_header::offset_to_next_vol_fullname, r91_disk_var_header::offset_to_vol_fullname, r91_disk_var_header::offset_to_vol_remarks, fileio_page::page, r91_disk_var_header::page_alloctb_npages, r91_disk_var_header::page_alloctb_page1, fileio_page::prv, PTR_ALIGN, r91_disk_var_header::purpose, r91_disk_var_header::sect_alloctb_npages, r91_disk_var_header::sect_alloctb_page1, r91_disk_var_header::sect_npgs, strlen, r91_disk_var_header::sys_lastpage, r91_disk_var_header::total_pages, r91_disk_var_header::total_sects, r91_disk_var_header::var_fields, and r91_disk_var_header::volid.
Referenced by fix_all_volume_header().
|
static |
Definition at line 809 of file migrate.c.
References VOLUME_UNDO_INFO::filename, i, p, VOLUME_UNDO_INFO::page, and vol_undo_count.
Referenced by main().
|
static |
Definition at line 167 of file migrate.c.
References FCLOSE_AND_CHECK, fileio_make_volume_info_name(), FOPEN_AND_CHECK, LOG_DBLOG_ACTIVE_VOLID, NO_ERROR, NULL, NULL_VOLID, and r91_disk_var_header::volid.
Referenced by check_and_fix_compat_level(), fix_codeset_in_active_log(), and undo_fix_compat_level().
|
static |
Definition at line 362 of file migrate.c.
References DB_CURSOR_END, DB_CURSOR_SUCCESS, db_execute(), db_get_int(), db_query_end(), db_query_get_tuple_value(), db_query_next_tuple(), ER_FAILED, NO_ERROR, and QUERY_SIZE.
Referenced by main().
|
static |
Definition at line 313 of file migrate.c.
References cfg_find_db_list(), cfg_free_directory(), cfg_read_directory(), COMPOSE_FULL_NAME(), ER_FAILED, NO_ERROR, NULL, and database_info::pathname.
Referenced by main().
|
static |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 404 of file migrate.c.
References assert, au_disable(), AU_DISABLE_PASSWORDS, catcls_get_db_collation(), check_and_fix_compat_level(), check_database_name(), lang_coll_compat::checksum, coll_data::checksum, lang_collation::codeset, lang_coll_compat::codeset, lang_collation::coll, lang_coll_compat::coll_id, coll_data::coll_id, lang_coll_compat::coll_name, coll_data::coll_name, coll_data::count_contr, db_abort_transaction(), DB_CLIENT_TYPE_ADMIN_UTILITY, db_commit_transaction(), db_error_string(), db_login(), db_name, db_private_free, db_restart(), db_set_client_type(), db_shutdown(), DISK_ERROR, er_init(), ER_NEVER_EXIT, VOLUME_UNDO_INFO::filename, fix_all_volume_header(), fix_codeset_in_active_log(), free_volume_header_undo_list(), get_codeset_from_db_root(), get_db_path(), i, INTL_CODESET_ISO88591, INTL_CODESET_LAST, intr_handler(), lang_get_collation(), LANG_MAX_COLLATIONS, NO_ERROR, NULL, os_set_signal_handler(), p, VOLUME_UNDO_INFO::page, VOLUME_UNDO_INFO::page_size, prm_get_name(), PRM_ID_JAVA_STORED_PROCEDURE, PRM_ID_PB_NBUFFERS, rel_disk_compatible(), synccoll_force(), sysprm_set_force(), TRUE, undo_fix_compat_level(), undo_fix_volume_header(), utility_initialize(), V9_2_LEVEL, and vol_undo_count.
|
static |
Definition at line 752 of file migrate.c.
References VOLUME_UNDO_INFO::filename, NULL, VOLUME_UNDO_INFO::page, VOLUME_UNDO_INFO::page_size, vol_undo_count, and vol_undo_list_length.
Referenced by fix_volume_header().
|
static |
Definition at line 282 of file migrate.c.
References log_page::area, log_header::db_compatibility, ER_FAILED, FCLOSE_AND_CHECK, FFLUSH_AND_CHECK, FOPEN_AND_CHECK, FREAD_AND_CHECK, FWRITE_AND_CHECK, get_active_log_vol_path(), IO_MAX_PAGE_SIZE, LOG_PAGESIZE, NO_ERROR, NULL, and V9_1_LEVEL.
Referenced by main().
|
static |
Definition at line 796 of file migrate.c.
References FCLOSE_AND_CHECK, FFLUSH_AND_CHECK, FOPEN_AND_CHECK, FWRITE_AND_CHECK, NO_ERROR, and NULL.
Referenced by main().
|
static |
Definition at line 151 of file migrate.c.
Referenced by fix_all_volume_header(), free_volume_header_undo_list(), main(), and make_volume_header_undo_page().
|
static |
|
static |
Definition at line 150 of file migrate.c.
Referenced by fix_all_volume_header(), and make_volume_header_undo_page().