From 3784432256a30e4d453dde10c875d8446519e7c1 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 13 Oct 2013 23:20:57 +0300 Subject: [PATCH] Give a warning, not an error, if the log file size in innodb doesn't match what is on disk This helps when moving from MariaDB 5.5 to MariaDB 10.0 as sometimes the log file size is rounded differently. storage/innobase/srv/srv0start.c: Give a warning, not an error, if the log file size in innodb doesn't match what is on disk storage/xtradb/srv/srv0start.c: Give a warning, not an error, if the log file size in innodb doesn't match what is on disk --- storage/innobase/srv/srv0start.c | 5 +++-- storage/xtradb/srv/srv0start.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 86669a50895..0cf3eb6c6b7 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -621,7 +621,7 @@ open_or_create_log_file( || size_high != srv_calc_high32(srv_log_file_size)) { fprintf(stderr, - "InnoDB: Error: log file %s is" + "InnoDB: Warning: log file %s is" " of different size %lu %lu bytes\n" "InnoDB: than specified in the .cnf" " file %lu %lu bytes!\n", @@ -629,7 +629,8 @@ open_or_create_log_file( (ulong) srv_calc_high32(srv_log_file_size), (ulong) srv_calc_low32(srv_log_file_size)); - return(DB_ERROR); + srv_log_file_size= size + + (((longlong) size_high) << 32); } } else { *log_file_created = TRUE; diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c index 9e0477253cd..bafbd00e654 100644 --- a/storage/xtradb/srv/srv0start.c +++ b/storage/xtradb/srv/srv0start.c @@ -624,7 +624,7 @@ open_or_create_log_file( || size_high != srv_calc_high32(srv_log_file_size)) { fprintf(stderr, - "InnoDB: Error: log file %s is" + "InnoDB: Warning: log file %s is" " of different size %lu %lu bytes\n" "InnoDB: than specified in the .cnf" " file %lu %lu bytes!\n", @@ -632,7 +632,9 @@ open_or_create_log_file( (ulong) srv_calc_high32(srv_log_file_size), (ulong) srv_calc_low32(srv_log_file_size)); - return(DB_ERROR); + srv_log_file_size= ((size + + (((longlong) size_high) << 32)) / + UNIV_PAGE_SIZE); } } else { *log_file_created = TRUE;