Comment 2 for bug 303124

Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

=== 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;