[Commits] 3b252380d1e: Merge branch 'bb-10.1-MDEV-11759' into 10.1

jan jan.lindstrom at mariadb.com
Mon Mar 27 10:51:18 EEST 2017


revision-id: 3b252380d1e0df81102539857bc0f689243d12bb (mariadb-10.1.22-15-g3b252380d1e)
parent(s): ba298b1f022aa5e1247d07a97325c0a09bdd1dc2 dc166632ca30071d83c4a1c14de9b322c9510f6e
author: Jan Lindström
committer: Jan Lindström
timestamp: 2017-03-27 10:51:12 +0300
message:

Merge branch 'bb-10.1-MDEV-11759' into 10.1


 .../encryption/r/innodb-bad-key-change.result      |   5 -
 .../encryption/r/innodb-compressed-blob.result     |  23 ++
 .../suite/encryption/r/innodb-force-corrupt.result |  55 ++++
 .../suite/encryption/t/innodb-compressed-blob.opt  |   4 +
 .../suite/encryption/t/innodb-compressed-blob.test |  84 +++++++
 .../suite/encryption/t/innodb-force-corrupt.test   | 131 ++++++++++
 .../suite/innodb/r/innodb_bug14147491.result       |   1 +
 mysql-test/suite/innodb/t/innodb_bug14147491.test  |   1 +
 storage/innobase/btr/btr0cur.cc                    |   6 +-
 storage/innobase/buf/buf0buf.cc                    | 280 +++++++++------------
 storage/innobase/buf/buf0flu.cc                    |   9 +-
 storage/innobase/buf/buf0rea.cc                    | 209 +++++++++------
 storage/innobase/fil/fil0fil.cc                    |  10 +-
 storage/innobase/include/buf0buf.h                 |  28 +--
 storage/innobase/include/buf0rea.h                 |  36 ++-
 storage/innobase/include/db0err.h                  |   2 +
 storage/xtradb/btr/btr0cur.cc                      |   8 +-
 storage/xtradb/buf/buf0buf.cc                      | 269 +++++++++-----------
 storage/xtradb/buf/buf0flu.cc                      |   9 +-
 storage/xtradb/buf/buf0rea.cc                      | 225 +++++++++++------
 storage/xtradb/fil/fil0fil.cc                      |  21 +-
 storage/xtradb/include/buf0buf.h                   |  22 +-
 storage/xtradb/include/buf0rea.h                   |  41 +--
 storage/xtradb/include/db0err.h                    |   2 +
 24 files changed, 932 insertions(+), 549 deletions(-)

diff --cc storage/innobase/buf/buf0buf.cc
index c7e2183fa7b,d27097a46c6..34f56a5ce04
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@@ -4480,14 -4454,12 +4454,15 @@@ buf_page_check_corrupt
  	byte* dst_frame = (zip_size) ? bpage->zip.data :
  		((buf_block_t*) bpage)->frame;
  	ulint space_id = bpage->space;
 -	fil_space_t* space = fil_space_found_by_id(space_id);
 -	fil_space_crypt_t* crypt_data = space->crypt_data;
 +	fil_space_t* space = fil_space_acquire_silent(space_id);
  	bool still_encrypted = false;
+ 	dberr_t err = DB_SUCCESS;
  	bool corrupted = false;
  	ulint page_type = mach_read_from_2(dst_frame + FIL_PAGE_TYPE);
 +	fil_space_crypt_t* crypt_data = NULL;
 +
 +	ut_ad(space);
 +	crypt_data = space->crypt_data;
  
  	/* In buf_decrypt_after_read we have either decrypted the page if
  	page post encryption checksum matches and used key_id is found
@@@ -4526,11 -4500,11 +4503,11 @@@
  
  		ib_logf(IB_LOG_LEVEL_ERROR,
  			"Block in space_id " ULINTPF " in file %s encrypted.",
 -			space_id, space->name ? space->name : "NULL");
 +			space_id, (space && space->name) ? space->name : "NULL");
  		ib_logf(IB_LOG_LEVEL_ERROR,
- 				"However key management plugin or used key_version %u is not found or"
- 				" used encryption algorithm or method does not match.",
- 				bpage->key_version);
+ 			"However key management plugin or used key_version %u is not found or"
+ 			" used encryption algorithm or method does not match.",
+ 			bpage->key_version);
  		if (space_id > TRX_SYS_SPACE) {
  			ib_logf(IB_LOG_LEVEL_ERROR,
  				"Marking tablespace as missing. You may drop this table or"
@@@ -4538,11 -4512,7 +4515,11 @@@
  		}
  	}
  
 +	if (space) {
 +		fil_space_release(space);
 +	}
 +
- 	return corrupted;
+ 	return (err);
  }
  
  /********************************************************************//**
diff --cc storage/xtradb/buf/buf0buf.cc
index 5016445b8e7,e699c4ad9e2..313c5c9d696
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@@ -4571,14 -4548,12 +4539,15 @@@ buf_page_check_corrupt
  	byte* dst_frame = (zip_size) ? bpage->zip.data :
  		((buf_block_t*) bpage)->frame;
  	ulint space_id = bpage->space;
 -	fil_space_t* space = fil_space_found_by_id(space_id);
 -	fil_space_crypt_t* crypt_data = space->crypt_data;
 +	fil_space_t* space = fil_space_acquire_silent(space_id);
  	bool still_encrypted = false;
+ 	dberr_t err = DB_SUCCESS;
  	bool corrupted = false;
  	ulint page_type = mach_read_from_2(dst_frame + FIL_PAGE_TYPE);
 +	fil_space_crypt_t* crypt_data = NULL;
 +
 +	ut_ad(space);
 +	crypt_data = space->crypt_data;
  
  	/* In buf_decrypt_after_read we have either decrypted the page if
  	page post encryption checksum matches and used key_id is found
@@@ -4618,11 -4595,11 +4589,11 @@@
  
  		ib_logf(IB_LOG_LEVEL_ERROR,
  			"Block in space_id " ULINTPF " in file %s encrypted.",
 -			space_id, space->name ? space->name : "NULL");
 +			space_id, (space && space->name) ? space->name : "NULL");
  		ib_logf(IB_LOG_LEVEL_ERROR,
- 				"However key management plugin or used key_version %u is not found or"
- 				" used encryption algorithm or method does not match.",
- 				bpage->key_version);
+ 			"However key management plugin or used key_version %u is not found or"
+ 			" used encryption algorithm or method does not match.",
+ 			bpage->key_version);
  		if (space_id > TRX_SYS_SPACE) {
  			ib_logf(IB_LOG_LEVEL_ERROR,
  				"Marking tablespace as missing. You may drop this table or"
@@@ -4630,11 -4607,7 +4601,11 @@@
  		}
  	}
  
 +	if (space) {
 +		fil_space_release(space);
 +	}
 +
- 	return corrupted;
+ 	return (err);
  }
  
  /********************************************************************//**


More information about the commits mailing list