From 1fa19bf777cb435e6630694fae029802260b5f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 12 Feb 2014 12:52:34 +0200 Subject: [PATCH] Fixed issue on atomic writes setup and atomic blobs setup on system tables. --- storage/innobase/include/dict0dict.ic | 28 ++++++++++++++++++++++----- storage/xtradb/include/dict0dict.ic | 28 ++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index ed891a00fd4..7cc0404e0eb 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -681,12 +681,16 @@ dict_sys_tables_type_validate( if (redundant) { if (zip_ssize || atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n", + zip_ssize, atomic_blobs); return(ULINT_UNDEFINED); } } /* Make sure there are no bits that we do not know about. */ if (unused) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, unused %lu\n", + type, unused); return(ULINT_UNDEFINED); } @@ -701,6 +705,8 @@ dict_sys_tables_type_validate( } else if (zip_ssize) { /* Antelope does not support COMPRESSED format. */ + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n", + type, zip_ssize); return(ULINT_UNDEFINED); } @@ -710,11 +716,15 @@ dict_sys_tables_type_validate( should be in N_COLS, but we already know about the low_order_bit and DICT_N_COLS_COMPACT flags. */ if (!atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n", + type, zip_ssize, atomic_blobs); return(ULINT_UNDEFINED); } /* Validate that the number is within allowed range. */ if (zip_ssize > PAGE_ZIP_SSIZE_MAX) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n", + type, zip_ssize, PAGE_ZIP_SSIZE_MAX); return(ULINT_UNDEFINED); } } @@ -731,6 +741,9 @@ dict_sys_tables_type_validate( low_order_bit and DICT_N_COLS_COMPACT flags. */ if (!atomic_blobs || !page_compression) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n" + "InnoDB: Error: atomic_blobs %lu\n", + type, page_compression, page_compression_level, atomic_blobs); return(ULINT_UNDEFINED); } } @@ -738,6 +751,9 @@ dict_sys_tables_type_validate( if (awrites == ATOMIC_WRITES_ON || (awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) { if (!atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n", + type, atomic_writes, atomic_blobs); + return(ULINT_UNDEFINED); } } @@ -846,10 +862,9 @@ dict_tf_set( } if (page_compressed) { - *flags = DICT_TF_COMPACT - | (1 << DICT_TF_POS_ATOMIC_BLOBS) - | (1 << DICT_TF_POS_PAGE_COMPRESSION) - | (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL); + *flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS) + | (1 << DICT_TF_POS_PAGE_COMPRESSION) + | (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL); ut_ad(zip_ssize == 0); ut_ad(dict_tf_get_page_compression(*flags) == TRUE); @@ -863,7 +878,8 @@ dict_tf_set( if (awrites == ATOMIC_WRITES_ON || (awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) { - *flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS); + *flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES) + | (1 << DICT_TF_POS_ATOMIC_BLOBS); } if (use_data_dir) { @@ -996,6 +1012,8 @@ dict_tf_to_sys_tables_type( | DICT_TF_MASK_PAGE_COMPRESSION_LEVEL | DICT_TF_MASK_ATOMIC_WRITES); + ut_a(dict_sys_tables_type_validate(type, 0)); + return(type); } diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic index 1ce4fe6a2f1..3f6d56fab1f 100644 --- a/storage/xtradb/include/dict0dict.ic +++ b/storage/xtradb/include/dict0dict.ic @@ -685,12 +685,16 @@ dict_sys_tables_type_validate( if (redundant) { if (zip_ssize || atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n", + zip_ssize, atomic_blobs); return(ULINT_UNDEFINED); } } /* Make sure there are no bits that we do not know about. */ if (unused) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, unused %lu\n", + type, unused); return(ULINT_UNDEFINED); } @@ -705,6 +709,8 @@ dict_sys_tables_type_validate( } else if (zip_ssize) { /* Antelope does not support COMPRESSED format. */ + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n", + type, zip_ssize); return(ULINT_UNDEFINED); } @@ -714,11 +720,15 @@ dict_sys_tables_type_validate( should be in N_COLS, but we already know about the low_order_bit and DICT_N_COLS_COMPACT flags. */ if (!atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n", + type, zip_ssize, atomic_blobs); return(ULINT_UNDEFINED); } /* Validate that the number is within allowed range. */ if (zip_ssize > PAGE_ZIP_SSIZE_MAX) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n", + type, zip_ssize, PAGE_ZIP_SSIZE_MAX); return(ULINT_UNDEFINED); } } @@ -735,6 +745,9 @@ dict_sys_tables_type_validate( low_order_bit and DICT_N_COLS_COMPACT flags. */ if (!atomic_blobs || !page_compression) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n" + "InnoDB: Error: atomic_blobs %lu\n", + type, page_compression, page_compression_level, atomic_blobs); return(ULINT_UNDEFINED); } } @@ -742,6 +755,9 @@ dict_sys_tables_type_validate( if (awrites == ATOMIC_WRITES_ON || (awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) { if (!atomic_blobs) { + fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n", + type, atomic_writes, atomic_blobs); + return(ULINT_UNDEFINED); } } @@ -854,10 +870,9 @@ dict_tf_set( } if (page_compressed) { - *flags = DICT_TF_COMPACT - | (1 << DICT_TF_POS_ATOMIC_BLOBS) - | (1 << DICT_TF_POS_PAGE_COMPRESSION) - | (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL); + *flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS) + | (1 << DICT_TF_POS_PAGE_COMPRESSION) + | (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL); ut_ad(zip_ssize == 0); ut_ad(dict_tf_get_page_compression(*flags) == TRUE); @@ -871,7 +886,8 @@ dict_tf_set( if (awrites == ATOMIC_WRITES_ON || (awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) { - *flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS); + *flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES) + | (1 << DICT_TF_POS_ATOMIC_BLOBS); } } @@ -1000,6 +1016,8 @@ dict_tf_to_sys_tables_type( | DICT_TF_MASK_PAGE_COMPRESSION_LEVEL | DICT_TF_MASK_ATOMIC_WRITES); + ut_a(dict_sys_tables_type_validate(type, 0)); + return(type); }