=== modified file 'storage/xtradb/handler/ha_innodb.cc' --- storage/xtradb/handler/ha_innodb.cc 2009-09-09 21:06:57 +0000 +++ storage/xtradb/handler/ha_innodb.cc 2009-10-14 03:12:52 +0000 @@ -2405,6 +2405,9 @@ /* Get the current high water mark format. */ innobase_file_format_check = (char*) trx_sys_file_format_max_get();
+ /* Get the current log file size. */ + innobase_log_file_size = srv_log_file_size; + DBUG_RETURN(FALSE); error: DBUG_RETURN(TRUE);
=== modified file 'storage/xtradb/srv/srv0start.c' --- storage/xtradb/srv/srv0start.c 2009-09-16 17:43:01 +0000 +++ storage/xtradb/srv/srv0start.c 2009-10-14 03:17:20 +0000 @@ -547,6 +547,21 @@ }
/************************************************************************* +Calculates the number of database pages which are represented by the +file size in bytes. */ +static +ulint +srv_calc_pages( +/*============*/ + /* out: file size in database pages */ + ulint size, /* in: low 32 bits of file size in bytes */ + ulint size_high) /* in: high 32 bits of file size in bytes */ +{ + return((size >> UNIV_PAGE_SIZE_SHIFT) + | (size_high << (32 - UNIV_PAGE_SIZE_SHIFT)); +} + +/************************************************************************* Creates or opens the log files and closes them. */ static ulint @@ -611,8 +626,9 @@ ret = os_file_get_size(files[i], &size, &size_high); ut_a(ret);
- if (size != srv_calc_low32(srv_log_file_size) - || size_high != srv_calc_high32(srv_log_file_size)) { + if ((size != srv_calc_low32(srv_log_file_size) + || size_high != srv_calc_high32(srv_log_file_size)) + && log_file_has_been_opened) {
fprintf(stderr, "InnoDB: Error: log file %s is" @@ -625,6 +641,7 @@
return(DB_ERROR); } + srv_log_file_size = srv_calc_pages(size, size_high); } else { *log_file_created = TRUE;
=== modified file 'storage/ xtradb/ handler/ ha_innodb. cc' xtradb/ handler/ ha_innodb. cc 2009-09-09 21:06:57 +0000 xtradb/ handler/ ha_innodb. cc 2009-10-14 03:12:52 +0000 file_format_ check = (char*) trx_sys_ file_format_ max_get( );
--- storage/
+++ storage/
@@ -2405,6 +2405,9 @@
/* Get the current high water mark format. */
innobase_
+ /* Get the current log file size. */ log_file_ size = srv_log_file_size; RETURN( FALSE); RETURN( TRUE);
+ innobase_
+
DBUG_
error:
DBUG_
=== modified file 'storage/ xtradb/ srv/srv0start. c' xtradb/ srv/srv0start. c 2009-09-16 17:43:01 +0000 xtradb/ srv/srv0start. c 2009-10-14 03:17:20 +0000
--- storage/
+++ storage/
@@ -547,6 +547,21 @@
}
/***** ******* ******* ******* ******* ******* ******* ******* ******* ******* ***** SIZE_SHIFT) SIZE_SHIFT) ); ******* ******* ******* ******* ******* ******* ******* ******* ******* ***** get_size( files[i] , &size, &size_high);
+Calculates the number of database pages which are represented by the
+file size in bytes. */
+static
+ulint
+srv_calc_pages(
+/*============*/
+ /* out: file size in database pages */
+ ulint size, /* in: low 32 bits of file size in bytes */
+ ulint size_high) /* in: high 32 bits of file size in bytes */
+{
+ return((size >> UNIV_PAGE_
+ | (size_high << (32 - UNIV_PAGE_
+}
+
+/*****
Creates or opens the log files and closes them. */
static
ulint
@@ -611,8 +626,9 @@
ret = os_file_
ut_a(ret);
- if (size != srv_calc_ low32(srv_ log_file_ size) high32( srv_log_ file_size) ) { low32(srv_ log_file_ size) high32( srv_log_ file_size) ) has_been_ opened) {
- || size_high != srv_calc_
+ if ((size != srv_calc_
+ || size_high != srv_calc_
+ && log_file_
fprintf(stderr,
"InnoDB: Error: log file %s is"
@@ -625,6 +641,7 @@
return( DB_ERROR) ; pages(size, size_high); file_created = TRUE;
}
+ srv_log_file_size = srv_calc_
} else {
*log_