diff options
author | guilhem@mysql.com <> | 2004-06-23 23:52:49 +0200 |
---|---|---|
committer | guilhem@mysql.com <> | 2004-06-23 23:52:49 +0200 |
commit | bccf57fbb238ace44ae97d0e8d96e32d64a22508 (patch) | |
tree | cb0e5539d9cb336a3feffb4f64e960f60c923cdf /innobase/trx/trx0sys.c | |
parent | 334eb77356e6e189419517fa42f0a5567017e85f (diff) | |
parent | c267b19db286e1a6bd955ee7736c257fa3f7e578 (diff) | |
download | mariadb-git-bccf57fbb238ace44ae97d0e8d96e32d64a22508.tar.gz |
Merge gbichot@213.136.52.20:/home/bk/mysql-4.1
into mysql.com:/home/mysql_src/mysql-4.1-1717
Diffstat (limited to 'innobase/trx/trx0sys.c')
-rw-r--r-- | innobase/trx/trx0sys.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index 5c8ae0952ef..54bd5be01a1 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -45,6 +45,15 @@ or there was no master log position info inside InnoDB. */ char trx_sys_mysql_master_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN]; ib_longlong trx_sys_mysql_master_log_pos = -1; +/* If this MySQL server uses binary logging, after InnoDB has been inited +and if it has done a crash recovery, we store the binlog file name and position +here. If .._pos is -1, it means there was no binlog position info inside +InnoDB. */ + +char trx_sys_mysql_bin_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN]; +ib_longlong trx_sys_mysql_bin_log_pos = -1; + + /******************************************************************** Determines if a page number is located inside the doublewrite buffer. */ @@ -648,8 +657,8 @@ trx_sys_print_mysql_binlog_offset_from_page( } /********************************************************************* -Prints to stderr the MySQL binlog offset info in the trx system header if -the magic number shows it valid. */ +Stores the MySQL binlog offset info in the trx system header if +the magic number shows it valid, and print the info to stderr */ void trx_sys_print_mysql_binlog_offset(void) @@ -657,7 +666,8 @@ trx_sys_print_mysql_binlog_offset(void) { trx_sysf_t* sys_header; mtr_t mtr; - + ulong trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low; + mtr_start(&mtr); sys_header = trx_sysf_get(&mtr); @@ -671,14 +681,22 @@ trx_sys_print_mysql_binlog_offset(void) return; } - fprintf(stderr, - "InnoDB: Last MySQL binlog file position %lu %lu, file name %s\n", - (ulong) mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_HIGH), - (ulong) mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO - + TRX_SYS_MYSQL_LOG_OFFSET_LOW), - sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME); + trx_sys_mysql_bin_log_pos_high = mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_OFFSET_HIGH); + trx_sys_mysql_bin_log_pos_low = mach_read_from_4(sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_OFFSET_LOW); + + trx_sys_mysql_bin_log_pos = (((ib_longlong)trx_sys_mysql_bin_log_pos_high) << 32) + + (ib_longlong)trx_sys_mysql_bin_log_pos_low; + + ut_memcpy(trx_sys_mysql_bin_log_name, sys_header + TRX_SYS_MYSQL_LOG_INFO + + TRX_SYS_MYSQL_LOG_NAME, TRX_SYS_MYSQL_LOG_NAME_LEN); + fprintf(stderr, + "InnoDB: Last MySQL binlog file position %lu %lu, file name %s\n", + trx_sys_mysql_bin_log_pos_high, trx_sys_mysql_bin_log_pos_low, + trx_sys_mysql_bin_log_name); + mtr_commit(&mtr); } |