summaryrefslogtreecommitdiff
path: root/storage/innobase/include/dict0dict.ic
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-19 12:06:13 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-19 12:06:13 +0200
commitb05bf8ff0f1acf39afeb71e0e8a148090364d8fc (patch)
treed104ee5ed8a27edd28f716319f91992ef8880411 /storage/innobase/include/dict0dict.ic
parent833aa97cec771fbfb2ef8dd104de6a3d1e971daa (diff)
parent03497129371fe2c16d847b7e83a5eeecab9c34a2 (diff)
downloadmariadb-git-b05bf8ff0f1acf39afeb71e0e8a148090364d8fc.tar.gz
Merge 10.1 to 10.2.
Most notably, this includes MDEV-11623, which includes a fix and an upgrade procedure for the InnoDB file format incompatibility that is present in MariaDB Server 10.1.0 through 10.1.20. In other words, this merge should address MDEV-11202 InnoDB 10.1 -> 10.2 migration does not work
Diffstat (limited to 'storage/innobase/include/dict0dict.ic')
-rw-r--r--storage/innobase/include/dict0dict.ic77
1 files changed, 39 insertions, 38 deletions
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 3bb00294bfa..a75f0b245af 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2016, MariaDB Corporation
+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
@@ -968,54 +968,56 @@ dict_tf_set(
}
}
-/** Initialize a dict_table_t::flags pointer.
-@param[in] compact, Table uses Compact or greater
-@param[in] zip_ssize Zip Shift Size (log 2 minus 9)
-@param[in] atomic_blobs Table uses Compressed or Dynamic
-@param[in] data_dir Table uses DATA DIRECTORY
-@param[in] page_compression Table uses page compression
-@param[in] page_compression_level used compression level
-@param[in] not_used For future */
+/** Convert a 32 bit integer table flags to the 32 bit FSP Flags.
+Fsp Flags are written into the tablespace header at the offset
+FSP_SPACE_FLAGS and are also stored in the fil_space_t::flags field.
+The following chart shows the translation of the low order bit.
+Other bits are the same.
+========================= Low order bit ==========================
+ | REDUNDANT | COMPACT | COMPRESSED | DYNAMIC
+dict_table_t::flags | 0 | 1 | 1 | 1
+fil_space_t::flags | 0 | 0 | 1 | 1
+==================================================================
+@param[in] table_flags dict_table_t::flags
+@return tablespace flags (fil_space_t::flags) */
UNIV_INLINE
ulint
-dict_tf_init(
- bool compact,
- ulint zip_ssize,
- bool atomic_blobs,
- bool data_dir,
- bool page_compressed,
- ulint page_compression_level,
- ulint not_used)
+dict_tf_to_fsp_flags(ulint table_flags)
{
- ulint flags = 0;
+ ulint fsp_flags;
+ ulint page_compression_level = DICT_TF_GET_PAGE_COMPRESSION_LEVEL(
+ table_flags);
+ ulint atomic_writes = DICT_TF_GET_ATOMIC_WRITES(table_flags);
- if (compact) {
- flags |= DICT_TF_COMPACT;
- }
+ ut_ad((DICT_TF_GET_PAGE_COMPRESSION(table_flags) == 0)
+ == (page_compression_level == 0));
- if (zip_ssize) {
- flags |= (zip_ssize << DICT_TF_POS_ZIP_SSIZE);
- }
+ DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure",
+ return(ULINT_UNDEFINED););
- if (atomic_blobs) {
- flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS);
- }
+ /* Adjust bit zero. */
+ fsp_flags = DICT_TF_HAS_ATOMIC_BLOBS(table_flags) ? 1 : 0;
+
+ /* ZIP_SSIZE and ATOMIC_BLOBS are at the same position. */
+ fsp_flags |= table_flags
+ & (DICT_TF_MASK_ZIP_SSIZE | DICT_TF_MASK_ATOMIC_BLOBS);
+
+ fsp_flags |= FSP_FLAGS_PAGE_SSIZE();
- if (data_dir) {
- flags |= (1 << DICT_TF_POS_DATA_DIR);
+ if (page_compression_level) {
+ fsp_flags |= FSP_FLAGS_MASK_PAGE_COMPRESSION;
}
- if (page_compressed) {
- flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS)
- | (1 << DICT_TF_POS_PAGE_COMPRESSION)
- | (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL);
+ ut_a(fsp_flags_is_valid(fsp_flags));
- ut_ad(zip_ssize == 0);
- ut_ad(dict_tf_get_page_compression(flags) == TRUE);
- ut_ad(dict_tf_get_page_compression_level(flags) == page_compression_level);
+ if (DICT_TF_HAS_DATA_DIR(table_flags)) {
+ fsp_flags |= 1U << FSP_FLAGS_MEM_DATA_DIR;
}
- return(flags);
+ fsp_flags |= atomic_writes << FSP_FLAGS_MEM_ATOMIC_WRITES;
+ fsp_flags |= page_compression_level << FSP_FLAGS_MEM_COMPRESSION_LEVEL;
+
+ return(fsp_flags);
}
/********************************************************************//**
@@ -1863,4 +1865,3 @@ dict_table_have_virtual_index(
return(false);
}
-