summaryrefslogtreecommitdiff
path: root/storage/innobase/include/btr0btr.ic
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2016-09-26 12:29:31 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2016-09-27 07:54:27 +0300
commit452e84952228a290b3c1fb16a8f60e2990aa8710 (patch)
treefdfac1ee276f6da64eff7a2a4385794649ed271e /storage/innobase/include/btr0btr.ic
parent4e2a0c34b02dd556c2a521555662ed993cdc66a6 (diff)
downloadmariadb-git-452e84952228a290b3c1fb16a8f60e2990aa8710.tar.gz
MDEV-10886: encryption.innodb-bad-key-change fails (crashes) in buildbot
Problem was that NULL-pointer was accessed inside a macro when page read from tablespace is encrypted but decrypt fails because of incorrect key file. Removed unsafe macro using inlined function where used pointers are checked.
Diffstat (limited to 'storage/innobase/include/btr0btr.ic')
-rw-r--r--storage/innobase/include/btr0btr.ic32
1 files changed, 32 insertions, 0 deletions
diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic
index e9410310213..5acbee1751e 100644
--- a/storage/innobase/include/btr0btr.ic
+++ b/storage/innobase/include/btr0btr.ic
@@ -98,6 +98,38 @@ btr_page_set_index_id(
mlog_write_ull(page + (PAGE_HEADER + PAGE_INDEX_ID), id, mtr);
}
}
+
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param idx index tree, may be NULL if not the insert buffer tree
+@param mtr mini-transaction handle
+@return the uncompressed page frame */
+UNIV_INLINE
+page_t*
+btr_page_get(
+/*=========*/
+ ulint space,
+ ulint zip_size,
+ ulint root_page_no,
+ ulint mode,
+ dict_index_t* index,
+ mtr_t* mtr)
+{
+ buf_block_t* block=NULL;
+ buf_frame_t* frame=NULL;
+
+ block = btr_block_get(space, zip_size, root_page_no, mode, index, mtr);
+
+ if (block) {
+ frame = buf_block_get_frame(block);
+ }
+
+ return ((page_t*)frame);
+}
+
#endif /* !UNIV_HOTBACKUP */
/**************************************************************//**