From 9d2c1d09aaa88a74bd8a823a2ef0492fd429c870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sat, 6 May 2017 23:10:52 +0300 Subject: [PATCH] MDEV-12253 post-push fix: buf_read_page_low() can return DB_ERROR The function buf_read_page_low() invokes fil_io(), which can return DB_ERROR when the requested page is out of bounds (such as when restoring a buffer pool dump). The callers should be handling that. --- storage/innobase/buf/buf0rea.cc | 6 +++++- storage/xtradb/buf/buf0rea.cc | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index e2c088c57e9..5525d8dd534 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2015, 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -366,6 +366,7 @@ read_ahead: switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_WARN, @@ -503,6 +504,7 @@ buf_read_page_async( tablespace_version, offset); switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_ERROR, @@ -784,6 +786,7 @@ buf_read_ahead_linear( switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_WARN, @@ -885,6 +888,7 @@ buf_read_ibuf_merge_pages( switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: diff --git a/storage/xtradb/buf/buf0rea.cc b/storage/xtradb/buf/buf0rea.cc index 85b04d37a08..b2b737b8d40 100644 --- a/storage/xtradb/buf/buf0rea.cc +++ b/storage/xtradb/buf/buf0rea.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2017, MariaDB Corporation. All Rights Reserved. +Copyright (c) 2013, 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -416,6 +416,7 @@ read_ahead: switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_WARN, @@ -557,6 +558,7 @@ buf_read_page_async( switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_ERROR, @@ -848,6 +850,7 @@ buf_read_ahead_linear( switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: ib_logf(IB_LOG_LEVEL_WARN, @@ -950,6 +953,7 @@ buf_read_ibuf_merge_pages( switch(err) { case DB_SUCCESS: + case DB_ERROR: break; case DB_TABLESPACE_DELETED: