Skip to content

Commit 1fa19bf

Browse files
author
Jan Lindström
committed
Fixed issue on atomic writes setup and atomic blobs setup on system
tables.
1 parent f6ad325 commit 1fa19bf

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

storage/innobase/include/dict0dict.ic

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,16 @@ dict_sys_tables_type_validate(
681681

682682
if (redundant) {
683683
if (zip_ssize || atomic_blobs) {
684+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n",
685+
zip_ssize, atomic_blobs);
684686
return(ULINT_UNDEFINED);
685687
}
686688
}
687689

688690
/* Make sure there are no bits that we do not know about. */
689691
if (unused) {
692+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, unused %lu\n",
693+
type, unused);
690694
return(ULINT_UNDEFINED);
691695
}
692696

@@ -701,6 +705,8 @@ dict_sys_tables_type_validate(
701705

702706
} else if (zip_ssize) {
703707
/* Antelope does not support COMPRESSED format. */
708+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n",
709+
type, zip_ssize);
704710
return(ULINT_UNDEFINED);
705711
}
706712

@@ -710,11 +716,15 @@ dict_sys_tables_type_validate(
710716
should be in N_COLS, but we already know about the
711717
low_order_bit and DICT_N_COLS_COMPACT flags. */
712718
if (!atomic_blobs) {
719+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n",
720+
type, zip_ssize, atomic_blobs);
713721
return(ULINT_UNDEFINED);
714722
}
715723

716724
/* Validate that the number is within allowed range. */
717725
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
726+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n",
727+
type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
718728
return(ULINT_UNDEFINED);
719729
}
720730
}
@@ -731,13 +741,19 @@ dict_sys_tables_type_validate(
731741
low_order_bit and DICT_N_COLS_COMPACT flags. */
732742

733743
if (!atomic_blobs || !page_compression) {
744+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n"
745+
"InnoDB: Error: atomic_blobs %lu\n",
746+
type, page_compression, page_compression_level, atomic_blobs);
734747
return(ULINT_UNDEFINED);
735748
}
736749
}
737750

738751
if (awrites == ATOMIC_WRITES_ON ||
739752
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) {
740753
if (!atomic_blobs) {
754+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n",
755+
type, atomic_writes, atomic_blobs);
756+
741757
return(ULINT_UNDEFINED);
742758
}
743759
}
@@ -846,10 +862,9 @@ dict_tf_set(
846862
}
847863

848864
if (page_compressed) {
849-
*flags = DICT_TF_COMPACT
850-
| (1 << DICT_TF_POS_ATOMIC_BLOBS)
851-
| (1 << DICT_TF_POS_PAGE_COMPRESSION)
852-
| (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL);
865+
*flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS)
866+
| (1 << DICT_TF_POS_PAGE_COMPRESSION)
867+
| (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL);
853868

854869
ut_ad(zip_ssize == 0);
855870
ut_ad(dict_tf_get_page_compression(*flags) == TRUE);
@@ -863,7 +878,8 @@ dict_tf_set(
863878

864879
if (awrites == ATOMIC_WRITES_ON ||
865880
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) {
866-
*flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS);
881+
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES)
882+
| (1 << DICT_TF_POS_ATOMIC_BLOBS);
867883
}
868884

869885
if (use_data_dir) {
@@ -996,6 +1012,8 @@ dict_tf_to_sys_tables_type(
9961012
| DICT_TF_MASK_PAGE_COMPRESSION_LEVEL
9971013
| DICT_TF_MASK_ATOMIC_WRITES);
9981014

1015+
ut_a(dict_sys_tables_type_validate(type, 0));
1016+
9991017
return(type);
10001018
}
10011019

storage/xtradb/include/dict0dict.ic

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,12 +685,16 @@ dict_sys_tables_type_validate(
685685

686686
if (redundant) {
687687
if (zip_ssize || atomic_blobs) {
688+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=Redundant, zip_ssize %lu atomic_blobs %lu\n",
689+
zip_ssize, atomic_blobs);
688690
return(ULINT_UNDEFINED);
689691
}
690692
}
691693

692694
/* Make sure there are no bits that we do not know about. */
693695
if (unused) {
696+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, unused %lu\n",
697+
type, unused);
694698
return(ULINT_UNDEFINED);
695699
}
696700

@@ -705,6 +709,8 @@ dict_sys_tables_type_validate(
705709

706710
} else if (zip_ssize) {
707711
/* Antelope does not support COMPRESSED format. */
712+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu\n",
713+
type, zip_ssize);
708714
return(ULINT_UNDEFINED);
709715
}
710716

@@ -714,11 +720,15 @@ dict_sys_tables_type_validate(
714720
should be in N_COLS, but we already know about the
715721
low_order_bit and DICT_N_COLS_COMPACT flags. */
716722
if (!atomic_blobs) {
723+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu atomic_blobs %lu\n",
724+
type, zip_ssize, atomic_blobs);
717725
return(ULINT_UNDEFINED);
718726
}
719727

720728
/* Validate that the number is within allowed range. */
721729
if (zip_ssize > PAGE_ZIP_SSIZE_MAX) {
730+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, zip_ssize %lu max %d\n",
731+
type, zip_ssize, PAGE_ZIP_SSIZE_MAX);
722732
return(ULINT_UNDEFINED);
723733
}
724734
}
@@ -735,13 +745,19 @@ dict_sys_tables_type_validate(
735745
low_order_bit and DICT_N_COLS_COMPACT flags. */
736746

737747
if (!atomic_blobs || !page_compression) {
748+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, page_compression %lu page_compression_level %lu\n"
749+
"InnoDB: Error: atomic_blobs %lu\n",
750+
type, page_compression, page_compression_level, atomic_blobs);
738751
return(ULINT_UNDEFINED);
739752
}
740753
}
741754

742755
if (awrites == ATOMIC_WRITES_ON ||
743756
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes)) {
744757
if (!atomic_blobs) {
758+
fprintf(stderr, "InnoDB Error: SYS_TABLES::TYPE=%lu, atomic_writes %lu atomic_blobs %lu\n",
759+
type, atomic_writes, atomic_blobs);
760+
745761
return(ULINT_UNDEFINED);
746762
}
747763
}
@@ -854,10 +870,9 @@ dict_tf_set(
854870
}
855871

856872
if (page_compressed) {
857-
*flags = DICT_TF_COMPACT
858-
| (1 << DICT_TF_POS_ATOMIC_BLOBS)
859-
| (1 << DICT_TF_POS_PAGE_COMPRESSION)
860-
| (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL);
873+
*flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS)
874+
| (1 << DICT_TF_POS_PAGE_COMPRESSION)
875+
| (page_compression_level << DICT_TF_POS_PAGE_COMPRESSION_LEVEL);
861876

862877
ut_ad(zip_ssize == 0);
863878
ut_ad(dict_tf_get_page_compression(*flags) == TRUE);
@@ -871,7 +886,8 @@ dict_tf_set(
871886

872887
if (awrites == ATOMIC_WRITES_ON ||
873888
(awrites == ATOMIC_WRITES_DEFAULT && srv_use_atomic_writes )) {
874-
*flags |= (1 << DICT_TF_POS_ATOMIC_BLOBS);
889+
*flags |= (atomic_writes << DICT_TF_POS_ATOMIC_WRITES)
890+
| (1 << DICT_TF_POS_ATOMIC_BLOBS);
875891
}
876892
}
877893

@@ -1000,6 +1016,8 @@ dict_tf_to_sys_tables_type(
10001016
| DICT_TF_MASK_PAGE_COMPRESSION_LEVEL
10011017
| DICT_TF_MASK_ATOMIC_WRITES);
10021018

1019+
ut_a(dict_sys_tables_type_validate(type, 0));
1020+
10031021
return(type);
10041022
}
10051023

0 commit comments

Comments
 (0)