summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2016-02-17 12:32:07 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2016-02-17 12:32:07 +0200
commit36ca65b73bcd0152680c88e09558bbe1237577ee (patch)
tree9d078fa9e448929d2b590d89c9eb31fe24943dfc /storage
parent1ac64b7510fd006268936e46442f46a28250c249 (diff)
downloadmariadb-git-36ca65b73bcd0152680c88e09558bbe1237577ee.tar.gz
MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
There was two problems. Firstly, if page in ibuf is encrypted but decrypt failed we should not allow InnoDB to start because this means that system tablespace is encrypted and not usable. Secondly, if page decrypt is detected we should return false from buf_page_decrypt_after_read.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/btr/btr0btr.cc4
-rw-r--r--storage/innobase/buf/buf0buf.cc45
-rw-r--r--storage/innobase/dict/dict0boot.cc33
-rw-r--r--storage/innobase/fil/fil0crypt.cc15
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc23
-rw-r--r--storage/innobase/include/fil0crypt.h7
-rw-r--r--storage/innobase/include/ibuf0ibuf.h6
-rw-r--r--storage/xtradb/btr/btr0btr.cc4
-rw-r--r--storage/xtradb/buf/buf0buf.cc47
-rw-r--r--storage/xtradb/dict/dict0boot.cc33
-rw-r--r--storage/xtradb/fil/fil0crypt.cc15
-rw-r--r--storage/xtradb/ibuf/ibuf0ibuf.cc23
-rw-r--r--storage/xtradb/include/fil0crypt.h7
-rw-r--r--storage/xtradb/include/ibuf0ibuf.h6
14 files changed, 177 insertions, 91 deletions
diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc
index 68d5dd325ff..be5b04787dd 100644
--- a/storage/innobase/btr/btr0btr.cc
+++ b/storage/innobase/btr/btr0btr.cc
@@ -777,6 +777,10 @@ btr_root_get(
buf_block_t* root = btr_root_block_get(index, RW_X_LATCH,
mtr);
+ if (root && root->page.encrypted == true) {
+ root = NULL;
+ }
+
return(root ? buf_block_get_frame(root) : NULL);
}
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index f4e7c0d0c6b..bd424b7b598 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -4674,10 +4674,10 @@ corrupt:
ib_push_warning((void *)NULL, DB_DECRYPTION_FAILED,
"Table in tablespace %lu encrypted."
- "However key management plugin or used key_id %lu is not found or"
+ "However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
- bpage->key_version);
+ (ulint)bpage->space, bpage->key_version);
if (bpage->space > TRX_SYS_SPACE) {
if (corrupted) {
@@ -4701,10 +4701,19 @@ corrupt:
}
if (uncompressed && !recv_no_ibuf_operations) {
- ibuf_merge_or_delete_for_page(
- (buf_block_t*) bpage, bpage->space,
- bpage->offset, buf_page_get_zip_size(bpage),
- TRUE);
+ if (bpage && bpage->encrypted) {
+ fprintf(stderr,
+ "InnoDB: Warning: Table in tablespace %lu encrypted."
+ "However key management plugin or used key_id %u is not found or"
+ " used encryption algorithm or method does not match."
+ " Can't continue opening the table.\n",
+ (ulint)bpage->space, bpage->key_version);
+ } else {
+ ibuf_merge_or_delete_for_page(
+ (buf_block_t*) bpage, bpage->space,
+ bpage->offset, buf_page_get_zip_size(bpage),
+ TRUE);
+ }
}
} else {
/* io_type == BUF_IO_WRITE */
@@ -6156,6 +6165,7 @@ buf_page_decrypt_after_read(
bool page_compressed = fil_page_is_compressed(dst_frame);
bool page_compressed_encrypted = fil_page_is_compressed_encrypted(dst_frame);
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ bool success = true;
/* If page is encrypted read post-encryption checksum */
if (!page_compressed_encrypted && key_version != 0) {
@@ -6214,16 +6224,21 @@ buf_page_decrypt_after_read(
}
/* decrypt using crypt_buf to dst_frame */
- fil_space_decrypt(bpage->space,
- slot->crypt_buf,
- size,
- dst_frame);
+ byte* res = fil_space_decrypt(bpage->space,
+ slot->crypt_buf,
+ size,
+ dst_frame);
+
+ if (!res) {
+ bpage->encrypted = true;
+ success = false;
+ }
#ifdef UNIV_DEBUG
fil_page_type_validate(dst_frame);
#endif
}
- if (page_compressed_encrypted) {
+ if (page_compressed_encrypted && success) {
if (!slot) {
slot = buf_pool_reserve_tmp_slot(buf_pool, page_compressed);
}
@@ -6236,11 +6251,11 @@ buf_page_decrypt_after_read(
dst_frame,
size,
&bpage->write_size);
- }
#ifdef UNIV_DEBUG
- fil_page_type_validate(dst_frame);
+ fil_page_type_validate(dst_frame);
#endif
+ }
/* Mark this slot as free */
if (slot) {
@@ -6250,5 +6265,5 @@ buf_page_decrypt_after_read(
bpage->key_version = key_version;
- return (TRUE);
+ return (success);
}
diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc
index 1a1dd29a202..573357b54ee 100644
--- a/storage/innobase/dict/dict0boot.cc
+++ b/storage/innobase/dict/dict0boot.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -450,27 +451,29 @@ dict_boot(void)
/* Initialize the insert buffer table and index for each tablespace */
- ibuf_init_at_db_start();
-
dberr_t err = DB_SUCCESS;
- if (srv_read_only_mode && !ibuf_is_empty()) {
+ err = ibuf_init_at_db_start();
- ib_logf(IB_LOG_LEVEL_ERROR,
- "Change buffer must be empty when --innodb-read-only "
- "is set!");
+ if (err == DB_SUCCESS) {
+ if (srv_read_only_mode && !ibuf_is_empty()) {
- err = DB_ERROR;
- } else {
- /* Load definitions of other indexes on system tables */
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Change buffer must be empty when --innodb-read-only "
+ "is set!");
- dict_load_sys_table(dict_sys->sys_tables);
- dict_load_sys_table(dict_sys->sys_columns);
- dict_load_sys_table(dict_sys->sys_indexes);
- dict_load_sys_table(dict_sys->sys_fields);
- }
+ err = DB_ERROR;
+ } else {
+ /* Load definitions of other indexes on system tables */
- mutex_exit(&(dict_sys->mutex));
+ dict_load_sys_table(dict_sys->sys_tables);
+ dict_load_sys_table(dict_sys->sys_columns);
+ dict_load_sys_table(dict_sys->sys_indexes);
+ dict_load_sys_table(dict_sys->sys_fields);
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+ }
return(err);
}
diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc
index 3d9d6a18122..03020896542 100644
--- a/storage/innobase/fil/fil0crypt.cc
+++ b/storage/innobase/fil/fil0crypt.cc
@@ -799,6 +799,7 @@ fil_space_decrypt(
byte* src_frame) /*!< in/out: page buffer */
{
dberr_t err = DB_SUCCESS;
+ byte* res = NULL;
bool encrypted = fil_space_decrypt(
fil_space_get_crypt_data(space),
@@ -807,13 +808,17 @@ fil_space_decrypt(
src_frame,
&err);
- if (encrypted) {
- /* Copy the decrypted page back to page buffer, not
- really any other options. */
- memcpy(src_frame, tmp_frame, page_size);
+ if (err == DB_SUCCESS) {
+ if (encrypted) {
+ /* Copy the decrypted page back to page buffer, not
+ really any other options. */
+ memcpy(src_frame, tmp_frame, page_size);
+ }
+
+ res = src_frame;
}
- return src_frame;
+ return res;
}
/******************************************************************
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index c1e5051dc6f..9e8d8659739 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -383,12 +384,18 @@ ibuf_header_page_get(
buf_block_t* block;
ut_ad(!ibuf_inside(mtr));
+ page_t* page = NULL;
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
- return(buf_block_get_frame(block));
+ if (!block->page.encrypted) {
+ buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
+
+ page = buf_block_get_frame(block);
+ }
+
+ return page;
}
/******************************************************************//**
@@ -500,9 +507,10 @@ ibuf_size_update(
/******************************************************************//**
Creates the insert buffer data structure at a database startup and initializes
-the data structures for the insert buffer. */
+the data structures for the insert buffer.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void)
/*=======================*/
{
@@ -513,7 +521,7 @@ ibuf_init_at_db_start(void)
dict_index_t* index;
ulint n_used;
page_t* header_page;
- dberr_t error;
+ dberr_t error= DB_SUCCESS;
ibuf = static_cast<ibuf_t*>(mem_zalloc(sizeof(ibuf_t)));
@@ -543,6 +551,10 @@ ibuf_init_at_db_start(void)
header_page = ibuf_header_page_get(&mtr);
+ if (!header_page) {
+ return (DB_DECRYPTION_FAILED);
+ }
+
fseg_n_reserved_pages(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
&n_used, &mtr);
ibuf_enter(&mtr);
@@ -593,6 +605,7 @@ ibuf_init_at_db_start(void)
ut_a(error == DB_SUCCESS);
ibuf->index = dict_table_get_first_index(table);
+ return (error);
}
/*********************************************************************//**
diff --git a/storage/innobase/include/fil0crypt.h b/storage/innobase/include/fil0crypt.h
index cf2e022c006..aa601f28e25 100644
--- a/storage/innobase/include/fil0crypt.h
+++ b/storage/innobase/include/fil0crypt.h
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2015, 2016, 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
@@ -212,6 +212,7 @@ bool
fil_space_check_encryption_read(
/*============================*/
ulint space); /*!< in: tablespace id */
+
/******************************************************************
Decrypt a page
@return true if page is decrypted, false if not. */
@@ -226,7 +227,6 @@ fil_space_decrypt(
dberr_t* err); /*!< in: out: DB_SUCCESS or
error code */
-
/*********************************************************************
Encrypt buffer page
@return encrypted page, or original not encrypted page if encrypt
@@ -253,7 +253,8 @@ fil_space_decrypt(
ulint space, /*!< in: tablespace id */
byte* src_frame, /*!< in: page frame */
ulint page_size, /*!< in: size of data to encrypt */
- byte* dst_frame); /*!< in: where to decrypt to */
+ byte* dst_frame) /*!< in: where to decrypt to */
+ __attribute__((warn_unused_result));
/*********************************************************************
fil_space_verify_crypt_checksum
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 9c3b686c998..badafe6befd 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -91,9 +92,10 @@ separately committed mini-transaction, because in crash recovery, the
free bits could momentarily be set too high. */
/******************************************************************//**
-Creates the insert buffer data structure at a database startup. */
+Creates the insert buffer data structure at a database startup.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void);
/*=======================*/
/*********************************************************************//**
diff --git a/storage/xtradb/btr/btr0btr.cc b/storage/xtradb/btr/btr0btr.cc
index c8018e6582b..067cd4e5e1c 100644
--- a/storage/xtradb/btr/btr0btr.cc
+++ b/storage/xtradb/btr/btr0btr.cc
@@ -796,6 +796,10 @@ btr_root_get(
buf_block_t* root = btr_root_block_get(index, RW_X_LATCH,
mtr);
+ if (root && root->page.encrypted == true) {
+ root = NULL;
+ }
+
return(root ? buf_block_get_frame(root) : NULL);
}
diff --git a/storage/xtradb/buf/buf0buf.cc b/storage/xtradb/buf/buf0buf.cc
index 72d078b3139..556096ca7e4 100644
--- a/storage/xtradb/buf/buf0buf.cc
+++ b/storage/xtradb/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2015, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -4790,10 +4790,10 @@ corrupt:
ib_push_warning(innobase_get_trx(), DB_DECRYPTION_FAILED,
"Table in tablespace %lu encrypted."
- "However key management plugin or used key_id %lu is not found or"
+ "However key management plugin or used key_id %u is not found or"
" used encryption algorithm or method does not match."
" Can't continue opening the table.",
- bpage->key_version);
+ (ulint)bpage->space, bpage->key_version);
if (bpage->space > TRX_SYS_SPACE) {
if (corrupted) {
@@ -4827,17 +4827,26 @@ corrupt:
block = NULL;
update_ibuf_bitmap = FALSE;
-
} else {
block = (buf_block_t *) bpage;
update_ibuf_bitmap = TRUE;
}
- ibuf_merge_or_delete_for_page(
- block, bpage->space,
- bpage->offset, buf_page_get_zip_size(bpage),
- update_ibuf_bitmap);
+ if (bpage && bpage->encrypted) {
+ fprintf(stderr,
+ "InnoDB: Warning: Table in tablespace %lu encrypted."
+ "However key management plugin or used key_id %u is not found or"
+ " used encryption algorithm or method does not match."
+ " Can't continue opening the table.\n",
+ (ulint)bpage->space, bpage->key_version);
+ } else {
+ ibuf_merge_or_delete_for_page(
+ block, bpage->space,
+ bpage->offset, buf_page_get_zip_size(bpage),
+ update_ibuf_bitmap);
+ }
+
}
} else {
/* io_type == BUF_IO_WRITE */
@@ -6333,6 +6342,7 @@ buf_page_decrypt_after_read(
bool page_compressed = fil_page_is_compressed(dst_frame);
bool page_compressed_encrypted = fil_page_is_compressed_encrypted(dst_frame);
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ bool success = true;
/* If page is encrypted read post-encryption checksum */
if (!page_compressed_encrypted && key_version != 0) {
@@ -6391,16 +6401,21 @@ buf_page_decrypt_after_read(
}
/* decrypt using crypt_buf to dst_frame */
- fil_space_decrypt(bpage->space,
- slot->crypt_buf,
- size,
- dst_frame);
+ byte* res = fil_space_decrypt(bpage->space,
+ slot->crypt_buf,
+ size,
+ dst_frame);
+
+ if (!res) {
+ bpage->encrypted = true;
+ success = false;
+ }
#ifdef UNIV_DEBUG
fil_page_type_validate(dst_frame);
#endif
}
- if (page_compressed_encrypted) {
+ if (page_compressed_encrypted && success) {
if (!slot) {
slot = buf_pool_reserve_tmp_slot(buf_pool, page_compressed);
}
@@ -6413,11 +6428,11 @@ buf_page_decrypt_after_read(
dst_frame,
size,
&bpage->write_size);
- }
#ifdef UNIV_DEBUG
- fil_page_type_validate(dst_frame);
+ fil_page_type_validate(dst_frame);
#endif
+ }
/* Mark this slot as free */
if (slot) {
@@ -6427,5 +6442,5 @@ buf_page_decrypt_after_read(
bpage->key_version = key_version;
- return (TRUE);
+ return (success);
}
diff --git a/storage/xtradb/dict/dict0boot.cc b/storage/xtradb/dict/dict0boot.cc
index 94a3af2852b..0a21264e23d 100644
--- a/storage/xtradb/dict/dict0boot.cc
+++ b/storage/xtradb/dict/dict0boot.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -456,27 +457,29 @@ dict_boot(void)
/* Initialize the insert buffer table and index for each tablespace */
- ibuf_init_at_db_start();
-
dberr_t err = DB_SUCCESS;
- if (srv_read_only_mode && !ibuf_is_empty()) {
+ err = ibuf_init_at_db_start();
- ib_logf(IB_LOG_LEVEL_ERROR,
- "Change buffer must be empty when --innodb-read-only "
- "is set!");
+ if (err == DB_SUCCESS) {
+ if (srv_read_only_mode && !ibuf_is_empty()) {
- err = DB_ERROR;
- } else {
- /* Load definitions of other indexes on system tables */
+ ib_logf(IB_LOG_LEVEL_ERROR,
+ "Change buffer must be empty when --innodb-read-only "
+ "is set!");
- dict_load_sys_table(dict_sys->sys_tables);
- dict_load_sys_table(dict_sys->sys_columns);
- dict_load_sys_table(dict_sys->sys_indexes);
- dict_load_sys_table(dict_sys->sys_fields);
- }
+ err = DB_ERROR;
+ } else {
+ /* Load definitions of other indexes on system tables */
- mutex_exit(&(dict_sys->mutex));
+ dict_load_sys_table(dict_sys->sys_tables);
+ dict_load_sys_table(dict_sys->sys_columns);
+ dict_load_sys_table(dict_sys->sys_indexes);
+ dict_load_sys_table(dict_sys->sys_fields);
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+ }
return(err);
}
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 3d9d6a18122..03020896542 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -799,6 +799,7 @@ fil_space_decrypt(
byte* src_frame) /*!< in/out: page buffer */
{
dberr_t err = DB_SUCCESS;
+ byte* res = NULL;
bool encrypted = fil_space_decrypt(
fil_space_get_crypt_data(space),
@@ -807,13 +808,17 @@ fil_space_decrypt(
src_frame,
&err);
- if (encrypted) {
- /* Copy the decrypted page back to page buffer, not
- really any other options. */
- memcpy(src_frame, tmp_frame, page_size);
+ if (err == DB_SUCCESS) {
+ if (encrypted) {
+ /* Copy the decrypted page back to page buffer, not
+ really any other options. */
+ memcpy(src_frame, tmp_frame, page_size);
+ }
+
+ res = src_frame;
}
- return src_frame;
+ return res;
}
/******************************************************************
diff --git a/storage/xtradb/ibuf/ibuf0ibuf.cc b/storage/xtradb/ibuf/ibuf0ibuf.cc
index 9ee22d4d0f7..bac2a92dd0b 100644
--- a/storage/xtradb/ibuf/ibuf0ibuf.cc
+++ b/storage/xtradb/ibuf/ibuf0ibuf.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -384,12 +385,18 @@ ibuf_header_page_get(
buf_block_t* block;
ut_ad(!ibuf_inside(mtr));
+ page_t* page = NULL;
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
- buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
- return(buf_block_get_frame(block));
+ if (!block->page.encrypted) {
+ buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
+
+ page = buf_block_get_frame(block);
+ }
+
+ return page;
}
/******************************************************************//**
@@ -540,9 +547,10 @@ ibuf_size_update(
/******************************************************************//**
Creates the insert buffer data structure at a database startup and initializes
-the data structures for the insert buffer. */
+the data structures for the insert buffer.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void)
/*=======================*/
{
@@ -553,7 +561,7 @@ ibuf_init_at_db_start(void)
dict_index_t* index;
ulint n_used;
page_t* header_page;
- dberr_t error;
+ dberr_t error= DB_SUCCESS;
ibuf = static_cast<ibuf_t*>(mem_zalloc(sizeof(ibuf_t)));
@@ -583,6 +591,10 @@ ibuf_init_at_db_start(void)
header_page = ibuf_header_page_get(&mtr);
+ if (!header_page) {
+ return (DB_DECRYPTION_FAILED);
+ }
+
fseg_n_reserved_pages(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
&n_used, &mtr);
ibuf_enter(&mtr);
@@ -634,6 +646,7 @@ ibuf_init_at_db_start(void)
ut_a(error == DB_SUCCESS);
ibuf->index = dict_table_get_first_index(table);
+ return (error);
}
/*********************************************************************//**
diff --git a/storage/xtradb/include/fil0crypt.h b/storage/xtradb/include/fil0crypt.h
index c42a0cf7e3f..32462661cd6 100644
--- a/storage/xtradb/include/fil0crypt.h
+++ b/storage/xtradb/include/fil0crypt.h
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (c) 2015, MariaDB Corporation.
+Copyright (c) 2015, 2016, 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
@@ -212,6 +212,7 @@ bool
fil_space_check_encryption_read(
/*============================*/
ulint space); /*!< in: tablespace id */
+
/******************************************************************
Decrypt a page
@return true if page is decrypted, false if not. */
@@ -226,7 +227,6 @@ fil_space_decrypt(
dberr_t* err); /*!< in: out: DB_SUCCESS or
error code */
-
/*********************************************************************
Encrypt buffer page
@return encrypted page, or original not encrypted page if encrypt
@@ -253,7 +253,8 @@ fil_space_decrypt(
ulint space, /*!< in: tablespace id */
byte* src_frame, /*!< in: page frame */
ulint page_size, /*!< in: size of data to encrypt */
- byte* dst_frame); /*!< in: where to decrypt to */
+ byte* dst_frame) /*!< in: where to decrypt to */
+ __attribute__((warn_unused_result));
/*********************************************************************
fil_space_verify_crypt_checksum
diff --git a/storage/xtradb/include/ibuf0ibuf.h b/storage/xtradb/include/ibuf0ibuf.h
index ac16b10e097..3c8fa874dcf 100644
--- a/storage/xtradb/include/ibuf0ibuf.h
+++ b/storage/xtradb/include/ibuf0ibuf.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2016, 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
@@ -91,9 +92,10 @@ separately committed mini-transaction, because in crash recovery, the
free bits could momentarily be set too high. */
/******************************************************************//**
-Creates the insert buffer data structure at a database startup. */
+Creates the insert buffer data structure at a database startup.
+@return DB_SUCCESS or failure */
UNIV_INTERN
-void
+dberr_t
ibuf_init_at_db_start(void);
/*=======================*/
/*********************************************************************//**