From 9a0cbd31ce8576468981b14b066dea155cb922d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 4 Jul 2022 08:04:44 +0300 Subject: MDEV-26294 Duplicate entries in unique index not detected when changing collation ha_innobase::check_if_supported_inplace_alter(): Refuse to change the collation of a column that would become or remain indexed as part of the ALTER TABLE operation. In MariaDB Server 10.6, we will allow this type of operation; that fix depends on MDEV-15250. --- .../suite/innodb/r/change_column_collation.result | 19 +++ .../innodb/r/instant_alter_charset,redundant.rdiff | 13 +- .../suite/innodb/r/instant_alter_charset.result | 178 +++++++++++++++++++-- .../suite/innodb/t/change_column_collation.test | 24 +++ .../suite/innodb/t/instant_alter_charset.test | 23 +++ 5 files changed, 238 insertions(+), 19 deletions(-) create mode 100644 mysql-test/suite/innodb/r/change_column_collation.result create mode 100644 mysql-test/suite/innodb/t/change_column_collation.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/change_column_collation.result b/mysql-test/suite/innodb/r/change_column_collation.result new file mode 100644 index 00000000000..fa1df1df830 --- /dev/null +++ b/mysql-test/suite/innodb/r/change_column_collation.result @@ -0,0 +1,19 @@ +# +# MDEV-26294 Duplicate entries in unique index not detected when +# changing collation with INPLACE algorithm +# +SET NAMES utf8; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_swedish_ci UNIQUE +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'aaa'); +INSERT INTO t1 VALUES (2, 'ååå'); +ALTER TABLE t1 +MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, +ALGORITHM=NOCOPY; +ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ALTER TABLE t1 DROP INDEX msg, +MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, +ALGORITHM=NOCOPY; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff index 22b7e46ea9c..dd4caf125af 100644 --- a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff +++ b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff @@ -1,6 +1,4 @@ ---- instant_alter_charset.result 2019-06-17 14:36:02.311515062 +0300 -+++ instant_alter_charset,redundant.result 2019-06-17 14:50:11.888705725 +0300 -@@ -279,7 +279,6 @@ +@@ -288,7 +288,6 @@ alter table boundary_255 modify a varchar(70) charset utf8mb4, algorithm=instant; @@ -8,7 +6,7 @@ drop table boundary_255; create table t ( a char(10) collate utf8mb3_general_ci, -@@ -297,32 +296,21 @@ +@@ -306,35 +305,21 @@ repeat('a', 10), repeat('a', 10) ); alter table t modify a char(10) collate utf8mb4_general_ci, algorithm=instant; @@ -27,16 +25,19 @@ -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; +-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; +-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; +-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK @@ -44,8 +45,10 @@ alter table t modify d char(10) collate utf8mb4_spanish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify dd char(10) collate utf8mb4_spanish_ci, algorithm=instant; --ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY select * from t; a b c aa bb cc d dd aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa + +mysqltest: Result length mismatch diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result index 43b4b2453e8..8fcdca6fc93 100644 --- a/mysql-test/suite/innodb/r/instant_alter_charset.result +++ b/mysql-test/suite/innodb/r/instant_alter_charset.result @@ -199,6 +199,15 @@ a varchar(150) charset utf8mb3 unique key alter table key_part_bug modify a varchar(150) charset utf8mb4, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table key_part_bug +modify a varchar(150) charset utf8mb4, +algorithm=nocopy; +ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table key_part_bug +drop index a, +modify a varchar(150) charset utf8mb4, +algorithm=nocopy; drop table key_part_bug; create table latin1_swedish_special_case ( copy1 varchar(150) charset ascii collate ascii_general_ci, @@ -309,20 +318,23 @@ check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify d char(10) collate utf8mb4_spanish_ci, algorithm=instant; alter table t modify dd char(10) collate utf8mb4_spanish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY select * from t; a b c aa bb cc d dd aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa @@ -378,6 +390,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_general_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_general_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_general_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -391,6 +407,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_bin, modify b varchar(50) charset utf8mb4 collate utf8mb4_bin, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_bin, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -404,6 +424,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -417,6 +441,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -430,6 +458,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -443,6 +475,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -456,6 +492,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -469,6 +509,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -482,6 +526,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -495,6 +543,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -508,6 +560,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -521,6 +577,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -534,6 +594,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -547,6 +611,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -560,6 +628,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -573,6 +645,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -586,6 +662,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -599,6 +679,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -612,6 +696,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -625,6 +713,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -638,6 +730,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -651,6 +747,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -664,6 +764,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -677,6 +781,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -690,6 +798,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -703,6 +815,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -716,6 +832,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -729,6 +849,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -742,6 +866,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, modify b varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -755,6 +883,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -768,6 +900,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, modify b varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -781,6 +917,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -794,6 +934,10 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table tmp +change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, +algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -830,7 +974,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -847,7 +991,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -864,7 +1008,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -881,7 +1025,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -898,7 +1042,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset ascii collate ascii_bin, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset ascii collate ascii_bin, algorithm=instant; @@ -915,7 +1059,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci, algorithm=instant; @@ -932,7 +1076,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; @@ -949,7 +1093,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; @@ -966,7 +1110,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci, algorithm=instant; @@ -983,7 +1127,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset latin1 collate latin1_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset latin1 collate latin1_general_ci, algorithm=instant; @@ -1000,7 +1144,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf16 collate utf16_german2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table tmp modify c varchar(50) charset utf16 collate utf16_german2_ci, algorithm=instant; @@ -1887,8 +2031,11 @@ insert into t values alter table t modify a char(10) collate latin1_general_cs, algorithm=inplace; ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify b char(10) collate latin1_general_cs, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table t modify b char(10) collate latin1_general_cs, algorithm=nocopy; +ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table t modify b char(10) collate latin1_general_cs, +drop index b_key, algorithm=nocopy; check table t; Table Op Msg_type Msg_text test.t check status OK @@ -1908,8 +2055,11 @@ insert into t values alter table t modify a varchar(10) collate latin1_general_cs, algorithm=inplace; ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify b varchar(10) collate latin1_general_cs, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY alter table t modify b varchar(10) collate latin1_general_cs, algorithm=nocopy; +ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +alter table t modify b varchar(10) collate latin1_general_cs, +drop index b_key, algorithm=nocopy; check table t; Table Op Msg_type Msg_text test.t check status OK diff --git a/mysql-test/suite/innodb/t/change_column_collation.test b/mysql-test/suite/innodb/t/change_column_collation.test new file mode 100644 index 00000000000..1ba519535bd --- /dev/null +++ b/mysql-test/suite/innodb/t/change_column_collation.test @@ -0,0 +1,24 @@ +--source include/have_innodb.inc + +--echo # +--echo # MDEV-26294 Duplicate entries in unique index not detected when +--echo # changing collation with INPLACE algorithm +--echo # + +# Detect the duplicate entry after collation change of column + +SET NAMES utf8; +CREATE TABLE t1 ( + id INT PRIMARY KEY, + msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_swedish_ci UNIQUE +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'aaa'); +INSERT INTO t1 VALUES (2, 'ååå'); +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 +MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, +ALGORITHM=NOCOPY; +ALTER TABLE t1 DROP INDEX msg, +MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, +ALGORITHM=NOCOPY; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/instant_alter_charset.test b/mysql-test/suite/innodb/t/instant_alter_charset.test index d64e30402ed..de60c24c0cd 100644 --- a/mysql-test/suite/innodb/t/instant_alter_charset.test +++ b/mysql-test/suite/innodb/t/instant_alter_charset.test @@ -227,9 +227,18 @@ create table key_part_bug ( a varchar(150) charset utf8mb3 unique key ) engine=innodb; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table key_part_bug modify a varchar(150) charset utf8mb4, algorithm=instant; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +alter table key_part_bug + modify a varchar(150) charset utf8mb4, + algorithm=nocopy; +alter table key_part_bug + drop index a, + modify a varchar(150) charset utf8mb4, + algorithm=nocopy; drop table key_part_bug; @@ -347,10 +356,13 @@ check table t; alter table t modify c char(100) collate utf8mb4_general_ci, algorithm=instant; check table t; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; check table t; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; check table t; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; check table t; @@ -442,11 +454,16 @@ while ($counter <= $data_size) { insert into tmp values ('AAA', 'AAA'), ('bbb', 'bbb'); +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON eval alter table tmp change a a varchar(50) charset $to_charset collate $to_collate, modify b varchar(50) charset $to_charset collate $to_collate, algorithm=instant; + eval alter table tmp + change a a varchar(50) charset $to_charset collate $to_collate, + algorithm=instant; + check table tmp; drop table tmp; @@ -685,7 +702,10 @@ alter table t modify a char(10) collate latin1_general_cs, algorithm=inplace; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b char(10) collate latin1_general_cs, algorithm=instant; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b char(10) collate latin1_general_cs, algorithm=nocopy; +alter table t modify b char(10) collate latin1_general_cs, +drop index b_key, algorithm=nocopy; check table t; alter table t modify c char(10) collate latin1_general_cs, algorithm=instant; @@ -708,7 +728,10 @@ alter table t modify a varchar(10) collate latin1_general_cs, algorithm=inplace; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b varchar(10) collate latin1_general_cs, algorithm=instant; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b varchar(10) collate latin1_general_cs, algorithm=nocopy; +alter table t modify b varchar(10) collate latin1_general_cs, +drop index b_key, algorithm=nocopy; check table t; alter table t modify c varchar(10) collate latin1_general_cs, algorithm=instant; -- cgit v1.2.1 From f8240a2723f0cad948a02fc5381f050d02e45e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 4 Jul 2022 11:15:15 +0300 Subject: MDEV-26294 Duplicate entries in unique index not detected when changing collation Problem: ======= ALTER TABLE in InnoDB fails to detect duplicate entries for the unique index when the character set or collation of an indexed column is changed in such a way that the character encoding is compatible with the old table definition. In this case, any secondary indexes on the changed columns would be rebuilt (DROP INDEX, ADD INDEX). Solution: ======== During ALTER TABLE, InnoDB keeps track of columns whose collation changed, and will fill in the correct metadata when sorting the index records, or applying changes from concurrent DML. This metadata will be allocated in the dict_index_t::heap of the being-created secondary indexes. The fix was developed by Thirunarayanan Balathandayuthapani and simplified by me. --- .../suite/innodb/r/change_column_collation.result | 92 ++++++++++- .../innodb/r/instant_alter_charset,redundant.rdiff | 20 ++- .../suite/innodb/r/instant_alter_charset.result | 182 ++------------------- .../suite/innodb/t/change_column_collation.test | 113 ++++++++++++- .../suite/innodb/t/instant_alter_charset.test | 23 --- 5 files changed, 220 insertions(+), 210 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/change_column_collation.result b/mysql-test/suite/innodb/r/change_column_collation.result index fa1df1df830..54eff706276 100644 --- a/mysql-test/suite/innodb/r/change_column_collation.result +++ b/mysql-test/suite/innodb/r/change_column_collation.result @@ -9,11 +9,89 @@ msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_swedish_ci UNIQUE ) ENGINE=INNODB; INSERT INTO t1 VALUES (1, 'aaa'); INSERT INTO t1 VALUES (2, 'ååå'); -ALTER TABLE t1 -MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, -ALGORITHM=NOCOPY; -ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -ALTER TABLE t1 DROP INDEX msg, -MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, -ALGORITHM=NOCOPY; +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=inplace; +ERROR 23000: Duplicate entry 'NULL' for key 'msg' +DROP TABLE t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, +id_2 INT not null, +unique index(msg, id_2) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'aaa', 2); +INSERT INTO t1 VALUES (2, 'AAA', 3); +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=inplace; +DROP TABLE t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, +unique index(msg) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'aaa'); +INSERT INTO t1 VALUES (2, 'bbb'); +INSERT INTO t1 VALUES (3, 'ccc'); +SET DEBUG_SYNC = 'RESET'; +SET DEBUG_SYNC = 'row_log_apply_before SIGNAL before_apply WAIT_FOR go_ahead'; +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=NOCOPY; +connect con1,localhost,root,,; +connection con1; +SET DEBUG_SYNC = 'now WAIT_FOR before_apply'; +INSERT INTO t1 VALUES (4, 'AAA'); +UPDATE t1 set msg = "ddd" where id = 2; +DELETE FROM t1 WHERE id= 3; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +SET DEBUG_SYNC = 'RESET'; +connection default; +ERROR 23000: Duplicate entry 'NULL' for key 'msg' +SELECT * FROM t1; +id msg +4 AAA +1 aaa +2 ddd +DROP TABLE t1; +CREATE TABLE t1 ( +id INT PRIMARY KEY, +msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, +unique index(msg) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'aaa'); +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=NOCOPY; +connection con1; +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +SELECT * FROM t1; +id msg +1 aaa +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +connection con1; +rollback; +INSERT INTO t1 VALUES(2, 'bbb'); +disconnect con1; +connection default; +SET DEBUG_SYNC=reset; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `msg` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `msg` (`msg`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES(3, 'ccc'); +DROP TABLE t1; +CREATE TABLE t1(id INT PRIMARY KEY, msg VARCHAR(100), +msg_1 VARCHAR(100) AS (msg) VIRTUAL, +msg_2 VARCHAR(100) AS (msg) STORED, +UNIQUE(msg), UNIQUE(msg_1), +UNIQUE(msg_2))ENGINE=InnoDB; +ALTER TABLE t1 MODIFY msg_1 VARCHAR(100) CHARACTER SET utf8 +COLLATE utf8_unicode_ci, ALGORITHM=inplace; +ERROR HY000: This is not yet supported for generated columns +ALTER TABLE t1 MODIFY msg_2 VARCHAR(100) CHARACTER SET utf8 +COLLATE utf8_unicode_ci, ALGORITHM=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY DROP TABLE t1; diff --git a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff index dd4caf125af..90846ac4644 100644 --- a/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff +++ b/mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff @@ -1,4 +1,4 @@ -@@ -288,7 +288,6 @@ +@@ -279,7 +279,6 @@ alter table boundary_255 modify a varchar(70) charset utf8mb4, algorithm=instant; @@ -6,7 +6,7 @@ drop table boundary_255; create table t ( a char(10) collate utf8mb3_general_ci, -@@ -306,35 +305,21 @@ +@@ -297,32 +296,21 @@ repeat('a', 10), repeat('a', 10) ); alter table t modify a char(10) collate utf8mb4_general_ci, algorithm=instant; @@ -25,19 +25,16 @@ -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; --ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; --ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; --ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -check table t; -Table Op Msg_type Msg_text -test.t check status OK @@ -45,10 +42,17 @@ alter table t modify d char(10) collate utf8mb4_spanish_ci, algorithm=instant; +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify dd char(10) collate utf8mb4_spanish_ci, algorithm=instant; --ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY select * from t; a b c aa bb cc d dd aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa - -mysqltest: Result length mismatch +@@ -2066,7 +2054,7 @@ + ALTER TABLE t1 + CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, + ADD UNIQUE INDEX test_key (a); +-ERROR 23000: Duplicate entry 'NULL' for key 'test_key' ++ERROR 23000: Duplicate entry 'a1' for key 'test_key' + ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8MB4 COLLATE UTF8MB4_UNICODE_520_CI; + CHECK TABLE t1; + Table Op Msg_type Msg_text diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result index f999697a329..caca0640566 100644 --- a/mysql-test/suite/innodb/r/instant_alter_charset.result +++ b/mysql-test/suite/innodb/r/instant_alter_charset.result @@ -199,15 +199,6 @@ a varchar(150) charset utf8mb3 unique key alter table key_part_bug modify a varchar(150) charset utf8mb4, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table key_part_bug -modify a varchar(150) charset utf8mb4, -algorithm=nocopy; -ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table key_part_bug -drop index a, -modify a varchar(150) charset utf8mb4, -algorithm=nocopy; drop table key_part_bug; create table latin1_swedish_special_case ( copy1 varchar(150) charset ascii collate ascii_general_ci, @@ -318,23 +309,20 @@ check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY check table t; Table Op Msg_type Msg_text test.t check status OK alter table t modify d char(10) collate utf8mb4_spanish_ci, algorithm=instant; alter table t modify dd char(10) collate utf8mb4_spanish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY select * from t; a b c aa bb cc d dd aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa @@ -390,10 +378,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_general_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_general_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -407,10 +391,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_bin, modify b varchar(50) charset utf8mb4 collate utf8mb4_bin, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_bin, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -424,10 +404,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -441,10 +417,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_icelandic_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -458,10 +430,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_latvian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -475,10 +443,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_romanian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -492,10 +456,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_slovenian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -509,10 +469,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_polish_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -526,10 +482,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_estonian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -543,10 +495,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -560,10 +508,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_swedish_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -577,10 +521,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_turkish_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -594,10 +534,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_czech_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -611,10 +547,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_danish_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -628,10 +560,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_lithuanian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -645,10 +573,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_slovak_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -662,10 +586,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_spanish2_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -679,10 +599,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_roman_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -696,10 +612,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -713,10 +625,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_esperanto_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -730,10 +638,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_hungarian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -747,10 +651,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_sinhala_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -764,10 +664,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -781,10 +677,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_mysql561_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -798,10 +690,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -815,10 +703,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -832,10 +716,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_croatian_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -849,10 +729,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_myanmar_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -866,10 +742,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, modify b varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_thai_520_w2, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -883,10 +755,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_general_nopad_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -900,10 +768,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, modify b varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_nopad_bin, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -917,10 +781,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_nopad_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -934,10 +794,6 @@ alter table tmp change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, modify b varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table tmp -change a a varchar(50) charset utf8mb4 collate utf8mb4_unicode_520_nopad_ci, -algorithm=instant; check table tmp; Table Op Msg_type Msg_text test.tmp check status OK @@ -974,7 +830,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -991,7 +847,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -1008,7 +864,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -1025,7 +881,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_vietnamese_ci, algorithm=instant; @@ -1042,7 +898,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset ascii collate ascii_bin, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset ascii collate ascii_bin, algorithm=instant; @@ -1059,7 +915,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb3 collate utf8mb3_lithuanian_ci, algorithm=instant; @@ -1076,7 +932,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_persian_ci, algorithm=instant; @@ -1093,7 +949,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb4 collate utf8mb4_german2_ci, algorithm=instant; @@ -1110,7 +966,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf8mb3 collate utf8mb3_unicode_ci, algorithm=instant; @@ -1127,7 +983,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset latin1 collate latin1_general_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset latin1 collate latin1_general_ci, algorithm=instant; @@ -1144,7 +1000,7 @@ algorithm=instant; alter table tmp modify b varchar(50) charset utf16 collate utf16_german2_ci, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table tmp modify c varchar(50) charset utf16 collate utf16_german2_ci, algorithm=instant; @@ -2031,11 +1887,8 @@ insert into t values alter table t modify a char(10) collate latin1_general_cs, algorithm=inplace; ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify b char(10) collate latin1_general_cs, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table t modify b char(10) collate latin1_general_cs, algorithm=nocopy; -ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table t modify b char(10) collate latin1_general_cs, -drop index b_key, algorithm=nocopy; check table t; Table Op Msg_type Msg_text test.t check status OK @@ -2055,11 +1908,8 @@ insert into t values alter table t modify a varchar(10) collate latin1_general_cs, algorithm=inplace; ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY alter table t modify b varchar(10) collate latin1_general_cs, algorithm=instant; -ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY alter table t modify b varchar(10) collate latin1_general_cs, algorithm=nocopy; -ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY -alter table t modify b varchar(10) collate latin1_general_cs, -drop index b_key, algorithm=nocopy; check table t; Table Op Msg_type Msg_text test.t check status OK @@ -2201,7 +2051,7 @@ INSERT INTO t1 VALUES (1, 'a1'), (2, 'a1'); ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, ADD UNIQUE INDEX test_key (a); -ERROR 23000: Duplicate entry 'a1' for key 'test_key' +ERROR 23000: Duplicate entry 'NULL' for key 'test_key' ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8MB4 COLLATE UTF8MB4_UNICODE_520_CI; CHECK TABLE t1; Table Op Msg_type Msg_text @@ -2216,7 +2066,7 @@ INSERT INTO t1 VALUES (1, 'a1'), (2, 'a1'); ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci, ADD UNIQUE INDEX test_key (a); -ERROR 23000: Duplicate entry 'a1' for key 'test_key' +ERROR 23000: Duplicate entry 'NULL' for key 'test_key' ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8MB4 COLLATE UTF8MB4_UNICODE_520_CI; CHECK TABLE t1; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/innodb/t/change_column_collation.test b/mysql-test/suite/innodb/t/change_column_collation.test index 1ba519535bd..7d82aac7ec2 100644 --- a/mysql-test/suite/innodb/t/change_column_collation.test +++ b/mysql-test/suite/innodb/t/change_column_collation.test @@ -1,4 +1,8 @@ --source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc + +--source include/count_sessions.inc --echo # --echo # MDEV-26294 Duplicate entries in unique index not detected when @@ -14,11 +18,108 @@ CREATE TABLE t1 ( ) ENGINE=INNODB; INSERT INTO t1 VALUES (1, 'aaa'); INSERT INTO t1 VALUES (2, 'ååå'); +--error ER_DUP_ENTRY +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=inplace; +DROP TABLE t1; + +# PageBulk insert shouldn't fail like records are not in ascending order + +CREATE TABLE t1 ( + id INT PRIMARY KEY, + msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, + id_2 INT not null, + unique index(msg, id_2) +) ENGINE=INNODB; + +INSERT INTO t1 VALUES (1, 'aaa', 2); +INSERT INTO t1 VALUES (2, 'AAA', 3); + +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=inplace; + +DROP TABLE t1; + +# Detect the duplicate entry from concurrent DML + +CREATE TABLE t1 ( + id INT PRIMARY KEY, + msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, + unique index(msg) +) ENGINE=INNODB; + +INSERT INTO t1 VALUES (1, 'aaa'); +INSERT INTO t1 VALUES (2, 'bbb'); +INSERT INTO t1 VALUES (3, 'ccc'); + +SET DEBUG_SYNC = 'RESET'; +SET DEBUG_SYNC = 'row_log_apply_before SIGNAL before_apply WAIT_FOR go_ahead'; +--send +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=NOCOPY; + +connect (con1,localhost,root,,); +connection con1; + +SET DEBUG_SYNC = 'now WAIT_FOR before_apply'; +INSERT INTO t1 VALUES (4, 'AAA'); +UPDATE t1 set msg = "ddd" where id = 2; +DELETE FROM t1 WHERE id= 3; +SET DEBUG_SYNC = 'now SIGNAL go_ahead'; +SET DEBUG_SYNC = 'RESET'; + +connection default; + +--error ER_DUP_ENTRY +reap; + +SELECT * FROM t1; +DROP TABLE t1; + +# InnoDB should store the changed collation column into +# change_col_info in index when rollback of alter happens + +CREATE TABLE t1 ( + id INT PRIMARY KEY, + msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin, + unique index(msg) +) ENGINE=INNODB; + +INSERT INTO t1 VALUES (1, 'aaa'); +SET DEBUG_DBUG="+d,create_index_fail"; +SET DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con1_go WAIT_FOR alter_signal"; +--send +ALTER TABLE t1 MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, ALGORITHM=NOCOPY; + +connection con1; +SET DEBUG_SYNC="now WAIT_FOR con1_go"; +BEGIN; +SELECT * FROM t1; +SET DEBUG_SYNC="now SIGNAL alter_signal"; +connection default; +--error ER_DUP_ENTRY +reap; +connection con1; +rollback; +INSERT INTO t1 VALUES(2, 'bbb'); +disconnect con1; +connection default; +SET DEBUG_SYNC=reset; +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES(3, 'ccc'); +DROP TABLE t1; + +# Inplace Collation change is not supported for virtual column +# and stored column + +CREATE TABLE t1(id INT PRIMARY KEY, msg VARCHAR(100), + msg_1 VARCHAR(100) AS (msg) VIRTUAL, + msg_2 VARCHAR(100) AS (msg) STORED, + UNIQUE(msg), UNIQUE(msg_1), + UNIQUE(msg_2))ENGINE=InnoDB; +--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN +ALTER TABLE t1 MODIFY msg_1 VARCHAR(100) CHARACTER SET utf8 + COLLATE utf8_unicode_ci, ALGORITHM=inplace; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON -ALTER TABLE t1 -MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, -ALGORITHM=NOCOPY; -ALTER TABLE t1 DROP INDEX msg, -MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci, -ALGORITHM=NOCOPY; +ALTER TABLE t1 MODIFY msg_2 VARCHAR(100) CHARACTER SET utf8 + COLLATE utf8_unicode_ci, ALGORITHM=inplace; DROP TABLE t1; + +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb/t/instant_alter_charset.test b/mysql-test/suite/innodb/t/instant_alter_charset.test index f0366967ab8..5be4f7a5b83 100644 --- a/mysql-test/suite/innodb/t/instant_alter_charset.test +++ b/mysql-test/suite/innodb/t/instant_alter_charset.test @@ -227,18 +227,9 @@ create table key_part_bug ( a varchar(150) charset utf8mb3 unique key ) engine=innodb; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table key_part_bug modify a varchar(150) charset utf8mb4, algorithm=instant; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON -alter table key_part_bug - modify a varchar(150) charset utf8mb4, - algorithm=nocopy; -alter table key_part_bug - drop index a, - modify a varchar(150) charset utf8mb4, - algorithm=nocopy; drop table key_part_bug; @@ -356,13 +347,10 @@ check table t; alter table t modify c char(100) collate utf8mb4_general_ci, algorithm=instant; check table t; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant; check table t; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant; check table t; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant; check table t; @@ -454,16 +442,11 @@ while ($counter <= $data_size) { insert into tmp values ('AAA', 'AAA'), ('bbb', 'bbb'); ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON eval alter table tmp change a a varchar(50) charset $to_charset collate $to_collate, modify b varchar(50) charset $to_charset collate $to_collate, algorithm=instant; - eval alter table tmp - change a a varchar(50) charset $to_charset collate $to_collate, - algorithm=instant; - check table tmp; drop table tmp; @@ -702,10 +685,7 @@ alter table t modify a char(10) collate latin1_general_cs, algorithm=inplace; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b char(10) collate latin1_general_cs, algorithm=instant; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b char(10) collate latin1_general_cs, algorithm=nocopy; -alter table t modify b char(10) collate latin1_general_cs, -drop index b_key, algorithm=nocopy; check table t; alter table t modify c char(10) collate latin1_general_cs, algorithm=instant; @@ -728,10 +708,7 @@ alter table t modify a varchar(10) collate latin1_general_cs, algorithm=inplace; --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b varchar(10) collate latin1_general_cs, algorithm=instant; ---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON alter table t modify b varchar(10) collate latin1_general_cs, algorithm=nocopy; -alter table t modify b varchar(10) collate latin1_general_cs, -drop index b_key, algorithm=nocopy; check table t; alter table t modify c varchar(10) collate latin1_general_cs, algorithm=instant; -- cgit v1.2.1 From bdc1134deabb741d5b62a992d7478101adc617b3 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 6 Jul 2022 10:28:06 +0400 Subject: MDEV-29041 Redundant truncation warning on CAST(string_column AS DECIMAL) --- mysql-test/suite/funcs_1/r/innodb_func_view.result | 24 ---------------------- mysql-test/suite/funcs_1/r/memory_func_view.result | 24 ---------------------- mysql-test/suite/funcs_1/r/myisam_func_view.result | 24 ---------------------- 3 files changed, 72 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result index 737335afddd..917388437e5 100644 --- a/mysql-test/suite/funcs_1/r/innodb_func_view.result +++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result @@ -3413,11 +3413,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3433,11 +3430,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' DROP VIEW v1; @@ -3455,11 +3449,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3477,11 +3468,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3501,11 +3489,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3521,11 +3506,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3543,11 +3525,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3563,11 +3542,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result index 74dc4557f50..9cc133e96dc 100644 --- a/mysql-test/suite/funcs_1/r/memory_func_view.result +++ b/mysql-test/suite/funcs_1/r/memory_func_view.result @@ -3414,11 +3414,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3434,11 +3431,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' DROP VIEW v1; @@ -3456,11 +3450,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3478,11 +3469,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3502,11 +3490,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3522,11 +3507,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3544,11 +3526,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3564,11 +3543,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result index 74dc4557f50..9cc133e96dc 100644 --- a/mysql-test/suite/funcs_1/r/myisam_func_view.result +++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result @@ -3414,11 +3414,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3434,11 +3431,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 29 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- ' DROP VIEW v1; @@ -3456,11 +3450,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3478,11 +3469,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 28 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' @@ -3502,11 +3490,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3522,11 +3507,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 27 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; @@ -3544,11 +3526,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' SHOW CREATE VIEW v1; View Create View character_set_client collation_connection @@ -3564,11 +3543,8 @@ NULL NULL 1 -1.00 -1 5 -3333.33 -3333.3333 26 Warnings: -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->' -Warning 1918 Encountered illegal value '' when converting to DECIMAL Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- ' DROP VIEW v1; -- cgit v1.2.1 From 57f5c319af85b645f144425af285d117aeebd47a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 6 Jul 2022 15:42:21 +0400 Subject: MDEV-21445 Strange/inconsistent behavior of IN condition when mixing numbers and strings --- mysql-test/suite/gcol/r/gcol_bugfixes.result | 2 +- mysql-test/suite/gcol/r/gcol_select_innodb.result | 8 ++++---- mysql-test/suite/gcol/r/gcol_select_myisam.result | 12 ++++++------ mysql-test/suite/innodb_gis/r/1.result | 4 ++-- mysql-test/suite/innodb_gis/r/gis.result | 4 ++-- mysql-test/suite/maria/lock.result | 4 ++-- mysql-test/suite/maria/mrr.result | 8 ++++---- .../suite/sys_vars/r/keep_files_on_create_basic.result | 4 ++-- .../sys_vars/r/log_bin_trust_function_creators_basic.result | 2 +- .../suite/sys_vars/r/low_priority_updates_basic.result | 4 ++-- mysql-test/suite/sys_vars/r/skip_replication_basic.result | 2 +- mysql-test/suite/vcol/r/vcol_syntax.result | 12 ++++++------ 12 files changed, 33 insertions(+), 33 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result index 4bc424d1b1e..0fc609884d6 100644 --- a/mysql-test/suite/gcol/r/gcol_bugfixes.result +++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result @@ -250,7 +250,7 @@ HAVING x > '2000-02-06' ORDER BY col_time_nokey, pk; x Warnings: -Warning 1292 Truncated incorrect DOUBLE value: '2000-02-06' +Warning 1292 Truncated incorrect DECIMAL value: '2000-02-06' DROP TABLE c; # Bug#21341044: Conditional jump at sort_param::make_sort_key CREATE TABLE t1 ( diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result index 81194cf7e13..e6d88d99d90 100644 --- a/mysql-test/suite/gcol/r/gcol_select_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result @@ -489,10 +489,10 @@ ORDER BY field1, alias1.col_date_key, field1 ASC, field1 DESC, alias1.col_time_key ASC, field1; field1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'c' -Warning 1292 Truncated incorrect DOUBLE value: 't' -Warning 1292 Truncated incorrect DOUBLE value: 'm' -Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'c' +Warning 1292 Truncated incorrect DECIMAL value: 't' +Warning 1292 Truncated incorrect DECIMAL value: 'm' +Warning 1292 Truncated incorrect DECIMAL value: 'd' DROP TABLE cc; SET sql_mode=@save_old_sql_mode; # diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result index 05d9fa3a244..6ef8a2b41ca 100644 --- a/mysql-test/suite/gcol/r/gcol_select_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -1069,10 +1069,10 @@ ORDER BY field1, alias1.col_date_key, field1 ASC, field1 DESC, alias1.col_time_key ASC, field1; field1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'c' -Warning 1292 Truncated incorrect DOUBLE value: 't' -Warning 1292 Truncated incorrect DOUBLE value: 'm' -Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'c' +Warning 1292 Truncated incorrect DECIMAL value: 't' +Warning 1292 Truncated incorrect DECIMAL value: 'm' +Warning 1292 Truncated incorrect DECIMAL value: 'd' DROP TABLE cc; SET sql_mode=@save_old_sql_mode; # @@ -1171,13 +1171,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'cccc' -Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +Warning 1292 Truncated incorrect DECIMAL value: 'cccc' SELECT /*+ bka() */ 1 AS c FROM t AS b RIGHT JOIN t AS c ON b.a > c.c WHERE b.b>c.a; c Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'cccc' -Warning 1292 Truncated incorrect DOUBLE value: 'cccc' +Warning 1292 Truncated incorrect DECIMAL value: 'cccc' DROP TABLE t; set @optimizer_switch_save = @@optimizer_switch; set optimizer_switch='mrr_cost_based=off'; diff --git a/mysql-test/suite/innodb_gis/r/1.result b/mysql-test/suite/innodb_gis/r/1.result index bc1d9a4f4d7..dd66c880c08 100644 --- a/mysql-test/suite/innodb_gis/r/1.result +++ b/mysql-test/suite/innodb_gis/r/1.result @@ -1118,8 +1118,8 @@ SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'a' -Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DECIMAL value: 'a' +Warning 1292 Truncated incorrect DECIMAL value: 'a' DROP TABLE g1; End of 5.5 tests DROP DATABASE IF EXISTS gis_ogs; diff --git a/mysql-test/suite/innodb_gis/r/gis.result b/mysql-test/suite/innodb_gis/r/gis.result index b5b46110a38..ee926cecb8f 100644 --- a/mysql-test/suite/innodb_gis/r/gis.result +++ b/mysql-test/suite/innodb_gis/r/gis.result @@ -1119,8 +1119,8 @@ SELECT 1 FROM g1 WHERE a >= ANY (SELECT 1 FROM g1 WHERE a = ST_geomfromtext('') OR a) ; 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'a' -Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DECIMAL value: 'a' +Warning 1292 Truncated incorrect DECIMAL value: 'a' DROP TABLE g1; End of 5.5 tests DROP DATABASE IF EXISTS gis_ogs; diff --git a/mysql-test/suite/maria/lock.result b/mysql-test/suite/maria/lock.result index de24b987524..d081b6165d5 100644 --- a/mysql-test/suite/maria/lock.result +++ b/mysql-test/suite/maria/lock.result @@ -158,8 +158,8 @@ test.t1 optimize status OK connection default; DELETE FROM t2 WHERE c < 1; Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'a' -Warning 1292 Truncated incorrect DOUBLE value: 'b' +Warning 1292 Truncated incorrect DECIMAL value: 'a' +Warning 1292 Truncated incorrect DECIMAL value: 'b' connection con1; OPTIMIZE TABLE t1; Table Op Msg_type Msg_text diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result index 5f9fcb4f937..aa8034e0bb7 100644 --- a/mysql-test/suite/maria/mrr.result +++ b/mysql-test/suite/maria/mrr.result @@ -326,10 +326,10 @@ SELECT table2 .`col_datetime_key` FROM t2 JOIN ( t1 table2 JOIN t2 table3 ON table3 .`col_varchar_key` < table2 .`col_varchar_key` ) ON table3 .`col_varchar_nokey` ; col_datetime_key Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'd' -Warning 1292 Truncated incorrect DOUBLE value: 'd' -Warning 1292 Truncated incorrect DOUBLE value: 'd' -Warning 1292 Truncated incorrect DOUBLE value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'd' +Warning 1292 Truncated incorrect DECIMAL value: 'd' drop table t1, t2; set join_cache_level=@save_join_cache_level; CREATE TABLE t1( diff --git a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result index b7deea88a9c..01ad4659b46 100644 --- a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result +++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result @@ -23,13 +23,13 @@ SELECT @@global.keep_files_on_create = 'OFF'; @@global.keep_files_on_create = 'OFF' 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'OFF' +Warning 1292 Truncated incorrect DECIMAL value: 'OFF' SET @@session.keep_files_on_create = DEFAULT; SELECT @@session.keep_files_on_create = 'OFF'; @@session.keep_files_on_create = 'OFF' 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'OFF' +Warning 1292 Truncated incorrect DECIMAL value: 'OFF' '#--------------------FN_DYNVARS_054_03-------------------------#' SET @@global.keep_files_on_create = ON; SELECT @@global.keep_files_on_create; diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result index 7ed1b689f5a..411bf5a77e4 100644 --- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result +++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result @@ -14,7 +14,7 @@ SELECT @@global.log_bin_trust_function_creators = 'FALSE'; @@global.log_bin_trust_function_creators = 'FALSE' 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'FALSE' +Warning 1292 Truncated incorrect DECIMAL value: 'FALSE' '#--------------------FN_DYNVARS_063_03-------------------------#' SET @@global.log_bin_trust_function_creators = ON; SELECT @@global.log_bin_trust_function_creators; diff --git a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result index 633dc274dec..53381db3148 100644 --- a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result +++ b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result @@ -23,13 +23,13 @@ SELECT @@global.low_priority_updates = 'FALSE'; @@global.low_priority_updates = 'FALSE' 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'FALSE' +Warning 1292 Truncated incorrect DECIMAL value: 'FALSE' SET @@session.low_priority_updates = DEFAULT; SELECT @@session.low_priority_updates = 'FALSE'; @@session.low_priority_updates = 'FALSE' 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'FALSE' +Warning 1292 Truncated incorrect DECIMAL value: 'FALSE' '#--------------------FN_DYNVARS_069_03-------------------------#' SET @@global.low_priority_updates = ON; SELECT @@global.low_priority_updates; diff --git a/mysql-test/suite/sys_vars/r/skip_replication_basic.result b/mysql-test/suite/sys_vars/r/skip_replication_basic.result index bb04df169a1..b137e24da02 100644 --- a/mysql-test/suite/sys_vars/r/skip_replication_basic.result +++ b/mysql-test/suite/sys_vars/r/skip_replication_basic.result @@ -16,7 +16,7 @@ select @@session.skip_replication = variable_value from information_schema.sessi @@session.skip_replication = variable_value 1 Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'OFF' +Warning 1292 Truncated incorrect DECIMAL value: 'OFF' set session skip_replication=0; select @@session.skip_replication; @@session.skip_replication diff --git a/mysql-test/suite/vcol/r/vcol_syntax.result b/mysql-test/suite/vcol/r/vcol_syntax.result index 0d7252b62d2..e2131be2cce 100644 --- a/mysql-test/suite/vcol/r/vcol_syntax.result +++ b/mysql-test/suite/vcol/r/vcol_syntax.result @@ -184,16 +184,16 @@ a drop table t1; create table t1 (a int , b date as (1 in ('x' ,(database ()) ))) ; Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' -Warning 1292 Truncated incorrect DOUBLE value: 'test' +Warning 1292 Truncated incorrect DECIMAL value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'test' select b from t1; b Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' -Warning 1292 Truncated incorrect DOUBLE value: 'test' +Warning 1292 Truncated incorrect DECIMAL value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'test' select a from t1 order by 'x' = b; a Warnings: -Warning 1292 Truncated incorrect DOUBLE value: 'x' -Warning 1292 Truncated incorrect DOUBLE value: 'test' +Warning 1292 Truncated incorrect DECIMAL value: 'x' +Warning 1292 Truncated incorrect DECIMAL value: 'test' drop table t1; -- cgit v1.2.1 From 96be3fe8416d312e08d67b36608e7b2d5a865d5d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 11 Jul 2022 12:32:52 +0200 Subject: MDEV-21445 update test results followup for 57f5c319af8 --- mysql-test/suite/engines/iuds/r/insert_year.result | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result index c7a0dbcba86..8065f606aab 100644 --- a/mysql-test/suite/engines/iuds/r/insert_year.result +++ b/mysql-test/suite/engines/iuds/r/insert_year.result @@ -2224,6 +2224,7 @@ SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2; c1 c2 c3 c4 2020 2020 1998-12-16 1998-12-16 11:30:45 2020 2040 1998-12-10 1998-12-10 11:30:45 +2069 2069 1998-12-13 1998-12-13 11:30:45 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 2020 2020 1998-12-16 1998-12-16 11:30:45 @@ -2369,6 +2370,7 @@ SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 DESC; c1 c2 c3 c4 2020 2040 1998-12-10 1998-12-10 11:30:45 2020 2020 1998-12-16 1998-12-16 11:30:45 +2069 2069 1998-12-13 1998-12-13 11:30:45 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 2020 2040 1998-12-10 1998-12-10 11:30:45 @@ -4292,8 +4294,12 @@ SELECT * FROM t2 WHERE c2 BETWEEN '1970' AND 2155 ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IN ('1970',2155) ORDER BY c1,c2; c1 c2 c3 c4 +70 70 1998-12-12 1998-12-12 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t2 WHERE c2 IN ('1970',2155) ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 +70 70 1998-12-12 1998-12-12 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t2 WHERE c2 >= '1970' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1970' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 LIMIT 2; @@ -4429,8 +4435,12 @@ SELECT * FROM t2 WHERE c2 BETWEEN '1970' AND 2155 ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 IN ('1970',2155) ORDER BY c1,c2 DESC; c1 c2 c3 c4 +70 70 1998-12-12 1998-12-12 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t2 WHERE c2 IN ('1970',2155) ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 +70 70 1998-12-12 1998-12-12 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t2 WHERE c2 >= '1970' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t2 WHERE c2 >= '1970' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 DESC LIMIT 2; @@ -5212,10 +5222,13 @@ SELECT * FROM t3 WHERE c1 BETWEEN 69 AND '2020' ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2; c1 c2 c3 c4 +20 20 1998-12-16 1998-12-16 11:30:45 +20 40 1998-12-10 1998-12-10 11:30:45 69 69 1998-12-13 1998-12-13 11:30:45 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 -69 69 1998-12-13 1998-12-13 11:30:45 +20 20 1998-12-16 1998-12-16 11:30:45 +20 40 1998-12-10 1998-12-10 11:30:45 SELECT * FROM t3 WHERE c1 >= 69 AND c1 < '2020' AND c2 = '2009' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= 69 AND c1 < '2020' AND c2 = '2009' ORDER BY c1,c2 LIMIT 2; @@ -5344,10 +5357,13 @@ SELECT * FROM t3 WHERE c1 BETWEEN 69 AND '2020' ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 DESC; c1 c2 c3 c4 +20 40 1998-12-10 1998-12-10 11:30:45 +20 20 1998-12-16 1998-12-16 11:30:45 69 69 1998-12-13 1998-12-13 11:30:45 SELECT * FROM t3 WHERE c1 IN (69,'2020') ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 -69 69 1998-12-13 1998-12-13 11:30:45 +20 40 1998-12-10 1998-12-10 11:30:45 +20 20 1998-12-16 1998-12-16 11:30:45 SELECT * FROM t3 WHERE c1 >= 69 AND c1 < '2020' AND c2 = '2009' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c1 >= 69 AND c1 < '2020' AND c2 = '2009' ORDER BY c1,c2 DESC LIMIT 2; @@ -5595,8 +5611,14 @@ c1 c2 c3 c4 01 01 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c2 IN ('2000',2155) ORDER BY c1,c2; c1 c2 c3 c4 +00 00 2008-01-08 2008-01-09 00:00:00 +00 00 1998-12-29 1998-12-29 11:30:45 +00 00 1998-12-26 1998-12-26 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t3 WHERE c2 IN ('2000',2155) ORDER BY c1,c2 LIMIT 2; c1 c2 c3 c4 +00 00 2008-01-08 2008-01-09 00:00:00 +00 00 1998-12-29 1998-12-29 11:30:45 SELECT * FROM t3 WHERE c2 >= '2000' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '2000' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 LIMIT 2; @@ -5745,8 +5767,14 @@ c1 c2 c3 c4 01 01 1998-12-31 1998-12-31 11:30:45 SELECT * FROM t3 WHERE c2 IN ('2000',2155) ORDER BY c1,c2 DESC; c1 c2 c3 c4 +00 00 2008-01-08 2008-01-09 00:00:00 +00 00 1998-12-29 1998-12-29 11:30:45 +00 00 1998-12-26 1998-12-26 11:30:45 +55 55 1998-12-26 1998-12-26 11:30:45 SELECT * FROM t3 WHERE c2 IN ('2000',2155) ORDER BY c1,c2 DESC LIMIT 2; c1 c2 c3 c4 +00 00 2008-01-08 2008-01-09 00:00:00 +00 00 1998-12-29 1998-12-29 11:30:45 SELECT * FROM t3 WHERE c2 >= '2000' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 DESC; c1 c2 c3 c4 SELECT * FROM t3 WHERE c2 >= '2000' AND c2 < 2155 AND c1 = '1999' ORDER BY c1,c2 DESC LIMIT 2; -- cgit v1.2.1 From 02e85aeafdc3fbe7d628e155880390c4d623f9b4 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 5 Jul 2022 07:12:49 -0600 Subject: MDEV-28487: sequences not respect value of binlog_row_image with select nextval(seq_gen) Problem: ======== When using sequences, the function sequence_definition::write(TABLE *table, bool all_fields) is used to save DML/DDL updates to sequence tables (e.g. nextval, setval, and alter). Prior to this patch, the value all_fields was always false when invoked via nextval and setval, which forced the bitmap to only include changed columns. Solution: ======== Change all_fields when invoked via nextval and setval to be reliant on binlog_row_image, such that it is false when binlog_row_image is MINIMAL, and true otherwise. Reviewed By: =========== Andrei Elkin --- .../suite/rpl/include/rpl_row_img_sequence.inc | 90 + mysql-test/suite/rpl/r/rpl_row_img_sequence.result | 2290 ++++++++++++++++++++ mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf | 21 + mysql-test/suite/rpl/t/rpl_row_img_sequence.test | 65 + 4 files changed, 2466 insertions(+) create mode 100644 mysql-test/suite/rpl/include/rpl_row_img_sequence.inc create mode 100644 mysql-test/suite/rpl/r/rpl_row_img_sequence.result create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/rpl/include/rpl_row_img_sequence.inc b/mysql-test/suite/rpl/include/rpl_row_img_sequence.inc new file mode 100644 index 00000000000..be5b7600f0a --- /dev/null +++ b/mysql-test/suite/rpl/include/rpl_row_img_sequence.inc @@ -0,0 +1,90 @@ +# +# This include file validates that sequence events are properly binlogged +# and replicated. +# +# Parameters: +# expected_columns (list, in) : A list of positive integers which +# correspond to the column numbers that should be output in a binary +# log's write_rows event +# + +--echo # Create sequences with specific engines per server +--connection server_1 +--eval SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=$server_1_engine +--source include/save_master_gtid.inc + +--connection server_2 +--eval SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=$server_2_engine +--source include/sync_with_master_gtid.inc + +--connection server_3 +--eval SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=$server_3_engine +--source include/sync_with_master_gtid.inc + + +--echo # Pt.1 Ensure SETVAL replicates and binlogs correctly +--connection server_1 +SELECT SETVAL(s1, 10); +--source include/save_master_gtid.inc + +--echo # Validate SETVAL replicated correctly to other servers +--connection server_3 +--source include/sync_with_master_gtid.inc +--let $diff_tables= server_1:test.s1,server_2:test.s1,server_3:test.s1 +--source include/diff_tables.inc + +--echo # Validate server_1 binlogged SETVAL with the correct columns +--connection server_1 +--let binlog_filenamE= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + +--echo # Validate server_2 binlogged SETVAL with the correct columns +--connection server_2 +--let binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + +--echo # Validate server_3 binlogged SETVAL with the correct columns +--connection server_3 +--let binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + + +--echo # Pt.2 Ensure NEXTVAL replicates and binlogs correctly +--connection server_1 +SELECT NEXTVAL(s1); +--source include/save_master_gtid.inc + +--echo # Validate NEXTVAL replicated correctly to other servers +--connection server_3 +--source include/sync_with_master_gtid.inc +--let $diff_tables= server_1:test.s1,server_2:test.s1,server_3:test.s1 +--source include/diff_tables.inc + +--echo # Validate server_1 binlogged NEXTVAL with the correct columns +--connection server_1 +--let binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + +--echo # Validate server_2 binlogged NEXTVAL with the correct columns +--connection server_2 +--let binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + +--echo # Validate server_3 binlogged NEXTVAL with the correct columns +--connection server_3 +--let binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1) +FLUSH LOGS; +--source include/ensure_binlog_row_event_columns.inc + + +--echo # Cleanup +--connection server_1 +DROP TABLE s1; +--source include/save_master_gtid.inc +--connection server_3 +--source include/sync_with_master_gtid.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_img_sequence.result b/mysql-test/suite/rpl/r/rpl_row_img_sequence.result new file mode 100644 index 00000000000..aa9fb34ec02 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_img_sequence.result @@ -0,0 +1,2290 @@ +include/rpl_init.inc [topology=1->2->3] +connection server_1; +connection server_2; +connection server_3; +connection server_1; +# +# Test Case 1) binlog_row_image=MINIMAL should write only columns +# 1 and 8 to the binary log +# +CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'MINIMAL'; +SET GLOBAL binlog_row_image= 'MINIMAL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image MINIMAL +connection server_1; +### engines: MyISAM, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +# +# Test Case 2) binlog_row_image=NOBLOB should write all columns to the +# binary log +# +CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'NOBLOB'; +SET GLOBAL binlog_row_image= 'NOBLOB'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image NOBLOB +connection server_3; +### engines: MyISAM, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +# +# Test Case 3) binlog_row_image=NOBLOB should write all columns to the +# binary log +# +CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N' +connection server_1; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_2; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y' +connection server_3; +SET SESSION binlog_row_image= 'FULL'; +SET GLOBAL binlog_row_image= 'FULL'; +include/stop_slave.inc +include/start_slave.inc +FLUSH TABLES; +SHOW VARIABLES LIKE 'binlog_row_image'; +Variable_name Value +binlog_row_image FULL +connection server_3; +### engines: MyISAM, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: MyISAM, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, MyISAM, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, MyISAM +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +### engines: InnoDB, InnoDB, InnoDB +# Create sequences with specific engines per server +connection server_1; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/save_master_gtid.inc +connection server_2; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +connection server_3; +SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB; +include/sync_with_master_gtid.inc +# Pt.1 Ensure SETVAL replicates and binlogs correctly +connection server_1; +SELECT SETVAL(s1, 10); +SETVAL(s1, 10) +10 +include/save_master_gtid.inc +# Validate SETVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged SETVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged SETVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged SETVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Pt.2 Ensure NEXTVAL replicates and binlogs correctly +connection server_1; +SELECT NEXTVAL(s1); +NEXTVAL(s1) +11 +include/save_master_gtid.inc +# Validate NEXTVAL replicated correctly to other servers +connection server_3; +include/sync_with_master_gtid.inc +include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1] +# Validate server_1 binlogged NEXTVAL with the correct columns +connection server_1; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_2 binlogged NEXTVAL with the correct columns +connection server_2; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Validate server_3 binlogged NEXTVAL with the correct columns +connection server_3; +FLUSH LOGS; +include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)] +# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file +# Verifying all expected column ids appear in binlog event output.. +# ..success +# Verifying only expected column ids appear in binlog event output.. +# ..success +# Cleanup +connection server_1; +DROP TABLE s1; +include/save_master_gtid.inc +connection server_3; +include/sync_with_master_gtid.inc +include/rpl_end.inc +# End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf new file mode 100644 index 00000000000..7104b4e4502 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf @@ -0,0 +1,21 @@ +!include include/default_mysqld.cnf + +[mysqld.1] +log-slave-updates +innodb +gtid_domain_id=0 + +[mysqld.2] +log-slave-updates +innodb +gtid_domain_id=1 + +[mysqld.3] +log-slave-updates +innodb +gtid_domain_id=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence.test new file mode 100644 index 00000000000..23860fb2de5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence.test @@ -0,0 +1,65 @@ +# +# Purpose: +# This test verifies that sequence DML updates, i.e. NEXTVAL and SETVAL, +# respect the binlog_row_image variable value when written into the binary log. +# In particular, it ensures that only changed columns are written with MINIMAL +# image mode, and all columns are written otherwise. +# +# Methodology +# After issuing a sequence update, ensure that both 1) it was replicated +# correctly, and 2) it was binlogged respective to the binlog_row_image value. +# The sequence table does not use caching to ensure each update is immediately +# binlogged. Each command is binlogged into its own unique log file, and the +# entirety of the file is analyzed for correctness of its sequence event. +# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns +# which belong to the event, and the columns are analyzed to ensure the correct +# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple +# chained replicas, varying engines between InnoDB and MyISAM. +# +# References: +# MDEV-28487: sequences not respect value of binlog_row_image with select +# nextval(seq_gen) +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +--source include/have_binlog_format_row.inc + +--connection server_1 +--source include/have_innodb.inc +--connection server_2 +--source include/have_innodb.inc +--connection server_3 +--source include/have_innodb.inc +--connection server_1 + +--echo # +--echo # Test Case 1) binlog_row_image=MINIMAL should write only columns +--echo # 1 and 8 to the binary log +--echo # +--let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,8) +--let row_img_test_script= include/rpl_row_img_sequence.inc +--source include/rpl_row_img_general_loop.inc + +--echo # +--echo # Test Case 2) binlog_row_image=NOBLOB should write all columns to the +--echo # binary log +--echo # +--let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,2,3,4,5,6,7,8) +--source include/rpl_row_img_general_loop.inc + +--echo # +--echo # Test Case 3) binlog_row_image=NOBLOB should write all columns to the +--echo # binary log +--echo # +--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,2,3,4,5,6,7,8) +--source include/rpl_row_img_general_loop.inc + +--source include/rpl_end.inc +--echo # End of tests -- cgit v1.2.1 From 8aa37c264f1c67beb9dc5cd4127379f0e596e3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 25 Jul 2022 10:28:45 +0300 Subject: MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN dict_load_foreigns(): Use a correctly sized buffer for the maximum-length SYS_FOREIGN.ID. In case of overflow, do not crash the server but instead return DB_CORRUPTION. --- mysql-test/suite/innodb/r/foreign_key.result | 14 ++++++++ .../suite/innodb/r/foreign_key_not_windows.result | 16 +++++++++ mysql-test/suite/innodb/t/foreign_key.test | 29 +++++++++++++++ .../suite/innodb/t/foreign_key_not_windows.test | 41 ++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 mysql-test/suite/innodb/r/foreign_key_not_windows.result create mode 100644 mysql-test/suite/innodb/t/foreign_key_not_windows.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 79aa82a4898..60829759252 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -858,3 +858,17 @@ Error 1296 Got error 193 '`test`.`t1`, CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) DROP TABLE t1; FOUND 1 /InnoDB: Cannot delete/update rows with cascading foreign key constraints that exceed max depth of 15.*/ in mysqld.1.err # End of 10.2 tests +# +# MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +# +SET NAMES utf8; +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE DATABASE `db`; +CREATE TABLE `db`.u ( +a INT PRIMARY KEY, +CONSTRAINT `††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††` + FOREIGN KEY (a) REFERENCES test.t (a)) ENGINE=InnoDB; +DROP TABLE `db`.u; +DROP DATABASE `db`; +DROP TABLE t; +# End of 10.3 tests diff --git a/mysql-test/suite/innodb/r/foreign_key_not_windows.result b/mysql-test/suite/innodb/r/foreign_key_not_windows.result new file mode 100644 index 00000000000..764ba911214 --- /dev/null +++ b/mysql-test/suite/innodb/r/foreign_key_not_windows.result @@ -0,0 +1,16 @@ +# +# MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +# +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE DATABASE `d255`; +CREATE TABLE `d255`.`d255` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@ +CREATE TABLE `d255`.`_##################################################` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/_@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023 +CREATE TABLE `d255`.`##################################################` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +DROP DATABASE `d255`; +DROP TABLE t; +# End of 10.3 tests diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index af23dbdbb28..3fdaccbc42a 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -881,4 +881,33 @@ let SEARCH_PATTERN= InnoDB: Cannot delete/update rows with cascading foreign key --echo # End of 10.2 tests +--echo # +--echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +--echo # + +SET NAMES utf8; +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; +# The maximum identifier length is 64 characters. +# my_charset_filename will expand some characters to 5 characters, +# e.g., # to @0023. +# Many operating systems (such as Linux) or file systems +# limit the path component length to 255 bytes, such as 51*5 characters. +# The bug was repeated with a shorter length, which we will use here, +# to avoid exceeding MAX_PATH on Microsoft Windows. +let $db=##########################; +--replace_result $db db +eval CREATE DATABASE `$db`; +--replace_result $db db +eval CREATE TABLE `$db`.u ( + a INT PRIMARY KEY, + CONSTRAINT `††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††` + FOREIGN KEY (a) REFERENCES test.t (a)) ENGINE=InnoDB; +--replace_result $db db +eval DROP TABLE `$db`.u; +--replace_result $db db +eval DROP DATABASE `$db`; +DROP TABLE t; + +--echo # End of 10.3 tests + --source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb/t/foreign_key_not_windows.test b/mysql-test/suite/innodb/t/foreign_key_not_windows.test new file mode 100644 index 00000000000..99ede9d79b2 --- /dev/null +++ b/mysql-test/suite/innodb/t/foreign_key_not_windows.test @@ -0,0 +1,41 @@ +--source include/have_innodb.inc +--source include/not_windows.inc + +--echo # +--echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN +--echo # + +# The main test is innodb.foreign_key. This is an additional test that +# the maximum length cannot be exceeded for implicitly created +# constraint names. On Microsoft Windows, MAX_PATH is a much stricter +# limit than the 255-byte maximum path component length on many other systems, +# including Linux and IBM AIX. + +CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; + +# The maximum identifier length is 64 characters. +# my_charset_filename will expand some characters to 5 characters, +# e.g., # to @0023. +# Many operating systems (such as Linux) or file systems +# limit the path component length to 255 bytes, +# corresponding to the 51 characters below: 5*51=255. +let $d255=###################################################; +let $d250=##################################################; +--replace_result $d255 d255 +eval CREATE DATABASE `$d255`; +--replace_result $d255 d255 +--error ER_IDENT_CAUSES_TOO_LONG_PATH +eval CREATE TABLE `$d255`.`$d255` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +--error ER_IDENT_CAUSES_TOO_LONG_PATH +eval CREATE TABLE `$d255`.`_$d250` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +eval CREATE TABLE `$d255`.`$d250` +(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; +--replace_result $d255 d255 +eval DROP DATABASE `$d255`; +DROP TABLE t; + +--echo # End of 10.3 tests -- cgit v1.2.1 From 555c12a541c21ed71dc40ae7d246c150a2d2b06b Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 17 Dec 2019 15:23:55 +0530 Subject: MDEV-21087/MDEV-21433: ER_SLAVE_INCIDENT arrives at slave without failure specifics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: ======= This patch addresses two issues: 1. An incident event can be incorrectly reported for transactions which are rolled back successfully. That is, an incident event should only be generated for failed “non-transactional transactions” (i.e., those which modify non-transactional tables) because they cannot be rolled back. 2. When the mariadb slave (error) stops at receiving the incident event there's no description of what led to it. Neither in the event nor in the master's error log. Solution: ======== Before reporting an incident event for a transaction, first validate that it is “non-transactional” (i.e. cannot be safely rolled back). To determine if a transaction is non-transactional, lex->stmt_accessed_table(LEX::STMT_WRITES_NON_TRANS_TABLE) is used because it is set previously in THD::decide_logging_format(). Additionally, when an incident event is written, write an error message to the server’s error log to indicate the underlying issue. Reviewed by: =========== Andrei Elkin --- .../suite/binlog/include/binlog_write_error.inc | 2 + mysql-test/suite/binlog/r/binlog_bug23533.result | 1 + .../suite/binlog/r/binlog_write_error.result | 1 + mysql-test/suite/binlog/t/binlog_bug23533.test | 2 +- .../binlog_encryption/binlog_write_error.result | 1 + .../rpl_mixed_binlog_max_cache_size.result | 2 + .../rpl/include/rpl_binlog_max_cache_size.test | 2 + mysql-test/suite/rpl/r/rpl_mdev-11092.result | 211 ++++++++- .../rpl/r/rpl_mixed_binlog_max_cache_size.result | 2 + .../rpl/r/rpl_stm_binlog_max_cache_size.result | 2 + mysql-test/suite/rpl/t/rpl_mdev-11092.test | 498 ++++++++++++++++++++- 11 files changed, 716 insertions(+), 8 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/binlog/include/binlog_write_error.inc b/mysql-test/suite/binlog/include/binlog_write_error.inc index fa3ba087a7e..be5e9e0cfea 100644 --- a/mysql-test/suite/binlog/include/binlog_write_error.inc +++ b/mysql-test/suite/binlog/include/binlog_write_error.inc @@ -38,6 +38,8 @@ DROP TRIGGER IF EXISTS tr2; DROP VIEW IF EXISTS v1, v2; enable_warnings; +call mtr.add_suppression("Write to binary log failed: Error writing file*"); + --echo # --echo # Test injecting binlog write error when executing queries --echo # diff --git a/mysql-test/suite/binlog/r/binlog_bug23533.result b/mysql-test/suite/binlog/r/binlog_bug23533.result index cc9799506c3..aa357b58f2c 100644 --- a/mysql-test/suite/binlog/r/binlog_bug23533.result +++ b/mysql-test/suite/binlog/r/binlog_bug23533.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.*"); SET AUTOCOMMIT=0; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; SELECT COUNT(*) FROM t1; diff --git a/mysql-test/suite/binlog/r/binlog_write_error.result b/mysql-test/suite/binlog/r/binlog_write_error.result index 6e8a212035a..7e8e373c797 100644 --- a/mysql-test/suite/binlog/r/binlog_write_error.result +++ b/mysql-test/suite/binlog/r/binlog_write_error.result @@ -9,6 +9,7 @@ DROP PROCEDURE IF EXISTS p2; DROP TRIGGER IF EXISTS tr1; DROP TRIGGER IF EXISTS tr2; DROP VIEW IF EXISTS v1, v2; +call mtr.add_suppression("Write to binary log failed: Error writing file*"); # # Test injecting binlog write error when executing queries # diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test index ca610e399e4..a77497115e5 100644 --- a/mysql-test/suite/binlog/t/binlog_bug23533.test +++ b/mysql-test/suite/binlog/t/binlog_bug23533.test @@ -6,7 +6,7 @@ --source include/have_innodb.inc --source include/have_log_bin.inc --source include/have_binlog_format_row.inc - +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.*"); SET AUTOCOMMIT=0; # Create 1st table diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.result b/mysql-test/suite/binlog_encryption/binlog_write_error.result index 6e8a212035a..7e8e373c797 100644 --- a/mysql-test/suite/binlog_encryption/binlog_write_error.result +++ b/mysql-test/suite/binlog_encryption/binlog_write_error.result @@ -9,6 +9,7 @@ DROP PROCEDURE IF EXISTS p2; DROP TRIGGER IF EXISTS tr1; DROP TRIGGER IF EXISTS tr2; DROP VIEW IF EXISTS v1, v2; +call mtr.add_suppression("Write to binary log failed: Error writing file*"); # # Test injecting binlog write error when executing queries # diff --git a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result index 388c8e67b68..944ad9331ad 100644 --- a/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/binlog_encryption/rpl_mixed_binlog_max_cache_size.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size"); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; diff --git a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test index 4c93ad86209..d750554b4ec 100644 --- a/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test +++ b/mysql-test/suite/rpl/include/rpl_binlog_max_cache_size.test @@ -22,6 +22,8 @@ # ######################################################################################## call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size"); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size"); let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1); diff --git a/mysql-test/suite/rpl/r/rpl_mdev-11092.result b/mysql-test/suite/rpl/r/rpl_mdev-11092.result index 8bc8fe4a20b..a685e204e7a 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev-11092.result +++ b/mysql-test/suite/rpl/r/rpl_mdev-11092.result @@ -1,7 +1,12 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size.* "); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.* "); +call mtr.add_suppression("Incident event write to the binary log file failed"); +call mtr.add_suppression("handlerton rollback failed"); +"*********** Annotate Event write failure **************" SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; @@ -10,12 +15,212 @@ disconnect master; connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM; connection master; -ERROR HY000: Writing one row to the row-based binary log failed +"#######################################################################" +"# Test Case1: Annotate event write failure for MyISAM #" +"#######################################################################" +ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again +# Validating update was not binlogged.. +# ..success +# Validating that the inserted data was saved on the master.. +# ..success +connection slave; include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +# Validating that the insert was not replicated to the slave.. +# ..success +"#######################################################################" +"# Test Case2: Annotate event write failure for INNODB #" +"#######################################################################" connection master; +CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +# Validating binlog GTID position progressed from first insert.. +# ..success +# Validating that only the first insert into t2 saved.. +# ..success +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +# Validating the first insert into t2 replicated to slave.. +include/diff_tables.inc [master:test.t2,slave:test.t2] +# ..success +"#######################################################################" +"# Test Case3: Annotate event write failure for mixed engine UPDATE #" +"#######################################################################" +connection master; +ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again +# Validating update was not binlogged.. +# ..success +# Validating non-transactional part of update saved.. +# ..success +# Validating transactional part of update was rolled back.. +# ..success +include/save_master_gtid.inc +connection slave; +include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +# Validating the rolled-back multi-engine update did not replicate to slave at all.. +# ..success +connection master; +"****** Clean up *******" SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_cache_size= ORIGINAL_VALUE; SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE; SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE; -DROP TABLE t1; +DROP TABLE t1,t2; +"*********** TABLE MAP Event write failure **************" +CREATE TABLE tm (f INT) ENGINE=MYISAM; +CREATE TABLE ti (f INT) ENGINE=INNODB; +INSERT INTO tm VALUES (10); +INSERT INTO ti VALUES (20); +connection slave; +"#######################################################################" +"# Test Case4: Table_map event write failure for trans engine UPDATE #" +"#######################################################################" +# Transaction should be rolled back without writing incident event +connection master; +SET debug_dbug="+d,table_map_write_error"; +UPDATE ti, tm set ti.f=30; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +# Validating update was not binlogged.. +# ..success +# Validating update was rolled back from storage engines.. +# ..success +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +"#######################################################################" +"# Test Case5: Table_map event write failure for mixed engine UPDATE #" +"#######################################################################" +connection master; +# In case of mixed engines if non trans table is updated write INCIDENT event +UPDATE ti,tm SET tm.f=88, ti.f=120; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +# Validating update was not binlogged.. +# ..success +# Validating that only the non-transactional update saved on master.. +# ..success +connection slave; +include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +# Validating that neither of the updates replicated to slave.. +# ..success +"#######################################################################" +"# Test Case6: Committing a transaction consisting of two updates: +"# S1) Update transactional table +"# S2) Update transactional table +"# with a table_map event write failure on the second event should +"# roll-back only the second update without incident +"#######################################################################" +connection master; +SET debug_dbug=""; +BEGIN; +UPDATE ti, tm set ti.f=40; +SET debug_dbug="+d,table_map_write_error"; +UPDATE ti, tm set ti.f=50; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +COMMIT; +# Validating binlog GTID position progressed from first update.. +# ..success +# Validating the first update saved.. +# ..and that the second update did not save.. +# ..success +# Validating that only the first update replicated to slave without incident +connection master; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/diff_tables.inc [master:test.ti,slave:test.ti] +"#######################################################################" +"# Test Case7: Rolling back a transaction consisting of two updates: +"# S1) Update transactional table +"# S2) Update transactional table +"# with a table_map event write failure on the second event should +"# roll-back both updates without incident +"#######################################################################" +connection master; +SET debug_dbug=""; +BEGIN; +UPDATE ti, tm set ti.f=60; +SET debug_dbug="+d,table_map_write_error"; +UPDATE ti, tm set ti.f=70; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +ROLLBACK; +# Validating update was not binlogged.. +# ..success +# Validating that neither update saved on master.. +# ..success +# Validating the transaction did not replicate to the slave +connection master; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/diff_tables.inc [master:test.ti,slave:test.ti] +"#######################################################################" +"# Test Case8: Committing a transaction consisting of two updates: +"# S1) Update transactional table +"# S2) Update mixed trans/non-trans tables +"# with a table_map event write failure on the second event should +"# roll-back only the second update with incident +"#######################################################################" +connection master; +BEGIN; +SET debug_dbug=""; +UPDATE ti, tm set ti.f=80; +SET debug_dbug="+d,table_map_write_error"; +UPDATE ti, tm set ti.f=90,tm.f=99; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +COMMIT; +# Validating binlog GTID position progressed from first update.. +# ..success +# Validating the first update saved.. +# ..and the transactional part of the second update did not save.. +# ..whereas the non-trans part of the second update did save.. +# ..success +# Validating that the incident propagated to the slave +connection slave; +include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +# Validating that the first update replicated to the slave.. +# ..and neither part of the second update replicated.. +# ..success +"#######################################################################" +"# Test Case9: Rolling back a transaction consisting of two updates: +"# S1) Update transactional table +"# S2) Update mixed trans/non-trans tables +"# with a table_map event write failure on the second event should +"# roll-back both transactional updates, preserve the non-transactional +"# update on the master (only), and write an incident event +"#######################################################################" +connection master; +SET debug_dbug=""; +BEGIN; +UPDATE ti, tm set ti.f=100; +SET debug_dbug="+d,table_map_write_error"; +UPDATE ti, tm set ti.f=110,tm.f=111; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +ROLLBACK; +# Validating update was not binlogged.. +# ..success +# Validating trans updates rollback, but the non-trans update stays.. +# ..success +# Validating that the incident propagated to the slave +connection slave; +include/wait_for_slave_sql_error_and_skip.inc [errno=1590] +# Validating that none of the updates replicated to the slave +include/diff_tables.inc [master:test.ti,slave:test.ti] +# ..success +"#######################################################################" +"# Test Case10: If an incident event fails to write, a specific error +"# should be logged +"# +"# Note: This test case is the same as test case 5, with the caveat of +"# the incident event failing to write. +"#######################################################################" +connection master; +SET debug_dbug="d,table_map_write_error,incident_event_write_error"; +UPDATE ti, tm set ti.f=120, tm.f=122; +ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again +# Validate error message indicating incident event failed to write +FOUND 1 /Incident event write to the binary log file failed/ in mysqld.1.err +connection master; +"******** Clean Up **********" +SET GLOBAL debug_dbug = ''; +DROP TABLE tm,ti; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 388c8e67b68..944ad9331ad 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size"); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 388c8e67b68..944ad9331ad 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -1,6 +1,8 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size"); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.test b/mysql-test/suite/rpl/t/rpl_mdev-11092.test index 782d24803c7..0c020386b98 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev-11092.test +++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.test @@ -1,3 +1,4 @@ +--source include/have_debug.inc --source include/have_innodb.inc --source include/not_embedded.inc --source include/not_windows.inc @@ -6,13 +7,19 @@ ######################################################################################## call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); +call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size.* "); +call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.* "); +call mtr.add_suppression("Incident event write to the binary log file failed"); +call mtr.add_suppression("handlerton rollback failed"); let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1); let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1); let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1); +--echo "*********** Annotate Event write failure **************" + SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; @@ -26,19 +33,162 @@ let $data = `select concat('"', repeat('a',2000), '"')`; connection master; +# Insert a huge row into MyISAM table. The row will be inserted in engine and a +# request to write to binary log will be initiated. Since row annotations are +# enabled the size of the annotate event itself will exceed the +# "max_binlog_stmt_cache_size". This will result in ER_STMT_CACHE_FULL error +# and an incident event will be written to the binary log as row update in +# engine cannot be undone. + +--echo "#######################################################################" +--echo "# Test Case1: Annotate event write failure for MyISAM #" +--echo "#######################################################################" + --disable_query_log ---error ER_BINLOG_ROW_LOGGING_FAILED +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--error ER_STMT_CACHE_FULL eval INSERT INTO t1 (a, data) VALUES (2, CONCAT($data, $data, $data, $data, $data, $data)); --enable_query_log +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating that the inserted data was saved on the master.. +if(`SELECT COUNT(*)!=1 FROM t1`) +{ + --die The insertion should have saved on a non-transactional table +} +--echo # ..success + +--connection slave # Incident event # 1590=ER_SLAVE_INCIDENT --let $slave_sql_errno= 1590 --source include/wait_for_slave_sql_error_and_skip.inc -connection master; +--echo # Validating that the insert was not replicated to the slave.. +if(`SELECT COUNT(*) FROM t1`) +{ + --die The insertion should not have replicated to the slave +} +--echo # ..success + +# MDEV-21087 +# Insert two huge rows in to transaction cache. Have data such that first row +# fits inside the binary log cache. While writing the annotate event for the +# second row the binary log cache size will exceed "max_binlog_cache_size". +# Hence this statement cannot be written to binary log. As DMLs in Innodb can +# be safely rolled back only an error will be reported. Slave will continue to +# work. + +--echo "#######################################################################" +--echo "# Test Case2: Annotate event write failure for INNODB #" +--echo "#######################################################################" + +--connection master +CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB; +--disable_query_log +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +BEGIN; +eval INSERT INTO t2 (a, data) VALUES (1, CONCAT($data, $data)); +--error ER_TRANS_CACHE_FULL +eval INSERT INTO t2 (a, data) VALUES (2, CONCAT($data, $data)); +COMMIT; +--enable_query_log + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating binlog GTID position progressed from first insert.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") = 0`) +{ + --die Binlog GTID position should have updated +} +--echo # ..success + +--echo # Validating that only the first insert into t2 saved.. +if(`SELECT COUNT(*)!=1 FROM t2`) +{ + --die Only one row should exist in t2 from the first insert, the second should have rolled back +} +--echo # ..success +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--echo # Validating the first insert into t2 replicated to slave.. +--let $diff_tables= master:test.t2,slave:test.t2 +--source include/diff_tables.inc +--echo # ..success + +# Testing mixed engine UPDATE statement scenario. In the following multi +# update query 'ha_update_row' will be invoked for t1 (myisam) table. This +# intern invokes binlog_write_table_map() function call. While writing a huge +# annotate event binary log cache size will exceed max_binlog_cache_size. +# Writing to binary log fails. Since non transactional changes cannot be +# rolled back incident event will be written to binary log. + +--echo "#######################################################################" +--echo "# Test Case3: Annotate event write failure for mixed engine UPDATE #" +--echo "#######################################################################" + +--connection master +let $new_data = `select concat('"', repeat('b',2000), '"')`; +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--disable_query_log +--error ER_STMT_CACHE_FULL +eval UPDATE t1,t2 SET t1.data="Hello", t2.data=CONCAT($new_data,$new_data,$new_data,$new_data,$new_data); +--enable_query_log + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating non-transactional part of update saved.. +if(`SELECT COUNT(*)!=1 from t1 where data="Hello"`) +{ + --die Non-transactional part of update should have saved +} +--echo # ..success + +--echo # Validating transactional part of update was rolled back.. +if(`SELECT COUNT(*) from t2 where data LIKE "b%"`) +{ + --die Transactional part of update should have been rolled back +} +--echo # ..success +--source include/save_master_gtid.inc + +--connection slave + +# Incident event +# 1590=ER_SLAVE_INCIDENT +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo # Validating the rolled-back multi-engine update did not replicate to slave at all.. +if(`SELECT COUNT(*) from t1 where data="Hello"`) +{ + --die Non-transactional part of update should not have replicated +} +if(`SELECT COUNT(*) from t2 where data LIKE "b%"`) +{ + --die Transactional part of update should not have replicated +} +--echo # ..success + +--connection master + +--echo "****** Clean up *******" --replace_result $old_max_binlog_cache_size ORIGINAL_VALUE --eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size --replace_result $old_binlog_cache_size ORIGINAL_VALUE @@ -48,6 +198,346 @@ connection master; --replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE --eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size -DROP TABLE t1; +DROP TABLE t1,t2; + +--echo "*********** TABLE MAP Event write failure **************" + +--let $debug_save= `SELECT @@GLOBAL.debug_dbug` +CREATE TABLE tm (f INT) ENGINE=MYISAM; +CREATE TABLE ti (f INT) ENGINE=INNODB; +INSERT INTO tm VALUES (10); +INSERT INTO ti VALUES (20); +--sync_slave_with_master + +--echo "#######################################################################" +--echo "# Test Case4: Table_map event write failure for trans engine UPDATE #" +--echo "#######################################################################" +--echo # Transaction should be rolled back without writing incident event +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +SET debug_dbug="+d,table_map_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=30; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating update was rolled back from storage engines.. +if(`SELECT COUNT(*) FROM ti WHERE f=130`) +{ + --die Update for InnoDB table should not have saved +} +--echo # ..success + +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc + +--echo "#######################################################################" +--echo "# Test Case5: Table_map event write failure for mixed engine UPDATE #" +--echo "#######################################################################" +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # In case of mixed engines if non trans table is updated write INCIDENT event +--error ER_TRANS_CACHE_FULL +UPDATE ti,tm SET tm.f=88, ti.f=120; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating that only the non-transactional update saved on master.. +if(`SELECT COUNT(*)!=1 FROM tm WHERE f=88`) +{ + --die Update for MyISAM table should have saved +} +if(`SELECT COUNT(*) FROM ti WHERE f=120`) +{ + --die Update for InnoDB table should not have saved +} +--echo # ..success + + +--connection slave +# Incident event +# 1590=ER_SLAVE_INCIDENT +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo # Validating that neither of the updates replicated to slave.. +if(`SELECT COUNT(*) FROM tm WHERE f=88`) +{ + --die Update for MyISAM table should not have replicated to slave +} +if(`SELECT COUNT(*) FROM ti WHERE f=120`) +{ + --die Update for InnoDB table should not have replicated to slave +} +--echo # ..success + +--echo "#######################################################################" +--echo "# Test Case6: Committing a transaction consisting of two updates: +--echo "# S1) Update transactional table +--echo "# S2) Update transactional table +--echo "# with a table_map event write failure on the second event should +--echo "# roll-back only the second update without incident +--echo "#######################################################################" +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) + +SET debug_dbug=""; +BEGIN; +# successful update +UPDATE ti, tm set ti.f=40; +SET debug_dbug="+d,table_map_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=50; +COMMIT; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating binlog GTID position progressed from first update.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") = 0`) +{ + --die Binlog GTID position should have updated +} +--echo # ..success + +--echo # Validating the first update saved.. +if(`SELECT COUNT(*)!=1 FROM ti WHERE f=40`) +{ + --die The first update should have saved because it was transactional +} +--echo # ..and that the second update did not save.. +if(`SELECT COUNT(*) FROM ti WHERE f=50`) +{ + --die The second update should have rolled back because it failed +} +--echo # ..success + +--echo # Validating that only the first update replicated to slave without incident +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/sync_with_master_gtid.inc +--let $diff_tables= master:test.ti,slave:test.ti +--source include/diff_tables.inc + + +--echo "#######################################################################" +--echo "# Test Case7: Rolling back a transaction consisting of two updates: +--echo "# S1) Update transactional table +--echo "# S2) Update transactional table +--echo "# with a table_map event write failure on the second event should +--echo "# roll-back both updates without incident +--echo "#######################################################################" +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) + +SET debug_dbug=""; +BEGIN; +# successful update +UPDATE ti, tm set ti.f=60; +SET debug_dbug="+d,table_map_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=70; +ROLLBACK; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating that neither update saved on master.. +if(`SELECT COUNT(*) FROM ti WHERE f=60`) +{ + --die The first update should not have saved +} +if(`SELECT COUNT(*) FROM ti WHERE f=70`) +{ + --die The second update should not have saved +} +--echo # ..success + +--echo # Validating the transaction did not replicate to the slave +--connection master +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--let $diff_tables= master:test.ti,slave:test.ti +--source include/diff_tables.inc + + +--echo "#######################################################################" +--echo "# Test Case8: Committing a transaction consisting of two updates: +--echo "# S1) Update transactional table +--echo "# S2) Update mixed trans/non-trans tables +--echo "# with a table_map event write failure on the second event should +--echo "# roll-back only the second update with incident +--echo "#######################################################################" +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) + +BEGIN; +# successful update +SET debug_dbug=""; +UPDATE ti, tm set ti.f=80; +SET debug_dbug="+d,table_map_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=90,tm.f=99; +COMMIT; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating binlog GTID position progressed from first update.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") = 0`) +{ + --die Binlog GTID position should have updated +} +--echo # ..success + +--echo # Validating the first update saved.. +if(`SELECT COUNT(*)!=1 FROM ti WHERE f=80`) +{ + --die The first update should have saved because it was transactional +} +--echo # ..and the transactional part of the second update did not save.. +if(`SELECT COUNT(*) FROM ti WHERE f=90`) +{ + --die The transactional part of the second update should have rolled back because it failed +} +--echo # ..whereas the non-trans part of the second update did save.. +if(`SELECT COUNT(*)!=1 FROM tm WHERE f=99`) +{ + --die The non-trans part from the second update should have saved +} +--echo # ..success + +--echo # Validating that the incident propagated to the slave +--connection slave +# Incident event +# 1590=ER_SLAVE_INCIDENT +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo # Validating that the first update replicated to the slave.. +if(`SELECT COUNT(*)!=1 FROM ti WHERE f=80`) +{ + --die The first update should have replicated because it was transactional +} +--echo # ..and neither part of the second update replicated.. +if(`SELECT COUNT(*) FROM ti WHERE f=90`) +{ + --die The trans part from the second update should not have replicated because it was rolled back +} +if(`SELECT COUNT(*) FROM tm WHERE f=99`) +{ + --die The non-trans part from the second update should not have replicated because it was not binlogged +} +--echo # ..success + + +--echo "#######################################################################" +--echo "# Test Case9: Rolling back a transaction consisting of two updates: +--echo "# S1) Update transactional table +--echo "# S2) Update mixed trans/non-trans tables +--echo "# with a table_map event write failure on the second event should +--echo "# roll-back both transactional updates, preserve the non-transactional +--echo "# update on the master (only), and write an incident event +--echo "#######################################################################" +--connection master +--let $old_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) + +SET debug_dbug=""; +BEGIN; +# successful update +UPDATE ti, tm set ti.f=100; +SET debug_dbug="+d,table_map_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=110,tm.f=111; +ROLLBACK; + +--let $new_gtid_binlog_pos= query_get_value(SHOW VARIABLES LIKE 'gtid_binlog_pos', Value, 1) +--echo # Validating update was not binlogged.. +if(`SELECT strcmp("$old_gtid_binlog_pos","$new_gtid_binlog_pos") != 0`) +{ + --die Binlog GTID position should have been unchanged after failed update +} +--echo # ..success + +--echo # Validating trans updates rollback, but the non-trans update stays.. +if(`SELECT COUNT(*) FROM ti WHERE f=100`) +{ + --die The first update should not have saved +} +if(`SELECT COUNT(*) FROM ti WHERE f=110`) +{ + --die The transactional part of the second update should not have saved +} +if(`SELECT COUNT(*)!=1 FROM tm WHERE f=111`) +{ + --die The non-trans part of the second update should have saved +} +--echo # ..success + +--echo # Validating that the incident propagated to the slave +--connection slave +# Incident event +# 1590=ER_SLAVE_INCIDENT +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo # Validating that none of the updates replicated to the slave +--let $diff_tables= master:test.ti,slave:test.ti +--source include/diff_tables.inc +if(`SELECT COUNT(*) FROM tm WHERE f=111`) +{ + --die The non-trans part from the second update should not have replicated because it was not binlogged +} +--echo # ..success + + +--echo "#######################################################################" +--echo "# Test Case10: If an incident event fails to write, a specific error +--echo "# should be logged +--echo "# +--echo "# Note: This test case is the same as test case 5, with the caveat of +--echo "# the incident event failing to write. +--echo "#######################################################################" + +--connection master +SET debug_dbug="d,table_map_write_error,incident_event_write_error"; +--error ER_TRANS_CACHE_FULL +UPDATE ti, tm set ti.f=120, tm.f=122; + +--echo # Validate error message indicating incident event failed to write +let $log_error_= `SELECT @@GLOBAL.log_error`; +if(!$log_error_) +{ + # MySQL Server on windows is started with --console and thus + # does not know the location of its .err log, use default location + let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err; +} +--let SEARCH_PATTERN= Incident event write to the binary log file failed +--let SEARCH_FILE= $log_error_ +--source include/search_pattern_in_file.inc + + +--connection master +--echo "******** Clean Up **********" +--eval SET GLOBAL debug_dbug = '$debug_save' +DROP TABLE tm,ti; --source include/rpl_end.inc -- cgit v1.2.1 From 5d0f75349f21df63cc75cf2a1dfb9295a1c2b6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 26 Jul 2022 08:08:48 +0300 Subject: MDEV-28980: Disable the test for --embedded --- mysql-test/suite/innodb/t/foreign_key_not_windows.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/t/foreign_key_not_windows.test b/mysql-test/suite/innodb/t/foreign_key_not_windows.test index 99ede9d79b2..7ad3723d5de 100644 --- a/mysql-test/suite/innodb/t/foreign_key_not_windows.test +++ b/mysql-test/suite/innodb/t/foreign_key_not_windows.test @@ -1,5 +1,9 @@ --source include/have_innodb.inc +# On Microsoft Windows, there is an additional limit of MAX_PATH --source include/not_windows.inc +# The embedded server prepends --datadir or --innodb-data-home-dir +# to the path names, which reduces the maximum length of names further. +--source include/not_embedded.inc --echo # --echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN -- cgit v1.2.1 From 5bf4dee36943cb4cc95d10863d469192de854800 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sun, 24 Jul 2022 20:43:45 +0300 Subject: MDEV-28948 FLUSH BINARY LOGS waits/hangs on mysql_mutex_unlock(&LOCK_index) The hang may be caused by a 1pc branch that was fixed by MDEV-26031 in 10.6 and up. That commit did not look relevant in 10.5 and below so was not pushed to the low branches. To possibly tackle the reported issue the MDEV-26031 is backported now with a test that unlike 10.6 does not expose the former bug in 10.5. It is only needed for checking a refined logics inside MYSQL_BIN_LOG::write_transaction_to_binlog. The latter is made to do away with xid-unlogging (which is suspected to have been at fault) for xid-less transaction. --- mysql-test/suite/binlog/r/binlog_1pc.result | 34 +++++++++++++++++++++++++ mysql-test/suite/binlog/t/binlog_1pc.test | 39 +++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 mysql-test/suite/binlog/r/binlog_1pc.result create mode 100644 mysql-test/suite/binlog/t/binlog_1pc.test (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/binlog/r/binlog_1pc.result b/mysql-test/suite/binlog/r/binlog_1pc.result new file mode 100644 index 00000000000..4a1615d5f1c --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_1pc.result @@ -0,0 +1,34 @@ +RESET MASTER; +CREATE TABLE t (f INT) ENGINE=INNODB; +CREATE TABLE ta (f INT) ENGINE=Aria; +BEGIN; +INSERT INTO t SET f = 1; +INSERT INTO ta SET f = 1; +COMMIT; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; INSERT INTO ta SET f = 1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; INSERT INTO t SET f = 1 +master-bin.000001 # Query # # COMMIT +# Prove that binlog is resettable. Under the bug condition it was not. +RESET MASTER; +SET @@binlog_format = ROW; +CREATE TABLE ta2 ENGINE = Aria SELECT * from t; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TABLE `ta2` ( + `f` int(11) DEFAULT NULL +) ENGINE=Aria PAGE_CHECKSUM=1 +master-bin.000001 # Annotate_rows # # CREATE TABLE ta2 ENGINE = Aria SELECT * from t +master-bin.000001 # Table_map # # table_id: # (test.ta2) +master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +# Prove that binlog is resettable. Under the bug condition it was not. +RESET MASTER; +# Cleanup +DROP TABLE ta2, ta, t; +# End of the tests diff --git a/mysql-test/suite/binlog/t/binlog_1pc.test b/mysql-test/suite/binlog/t/binlog_1pc.test new file mode 100644 index 00000000000..8465ff171b3 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_1pc.test @@ -0,0 +1,39 @@ +# The test file contains tests specific to one phase commit +# execution and binlogging. +# +# MDEV-26031 unnessary xid logging in one phase commit case +# +--source include/have_innodb.inc +--source include/have_aria.inc +--source include/have_binlog_format_mixed.inc + +RESET MASTER; + +CREATE TABLE t (f INT) ENGINE=INNODB; +CREATE TABLE ta (f INT) ENGINE=Aria; + +--let $binlog_start = query_get_value(SHOW MASTER STATUS, Position, 1) +BEGIN; + INSERT INTO t SET f = 1; + INSERT INTO ta SET f = 1; +COMMIT; +--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1) +--source include/show_binlog_events.inc + +--echo # Prove that binlog is resettable. Under the bug condition it was not. +RESET MASTER; + +--let $binlog_start = query_get_value(SHOW MASTER STATUS, Position, 1) +--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1) +SET @@binlog_format = ROW; +CREATE TABLE ta2 ENGINE = Aria SELECT * from t; +--source include/show_binlog_events.inc + +--echo # Prove that binlog is resettable. Under the bug condition it was not. +RESET MASTER; + + +--echo # Cleanup +DROP TABLE ta2, ta, t; + +--echo # End of the tests -- cgit v1.2.1 From f076dc2f667d9270ca08421d466dcbc352738082 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 5 Jul 2022 18:21:21 +0530 Subject: MDEV-20797 FULLTEXT search with apostrophe, and mandatory words - InnoDB should ignore the single word followed by apostrophe while tokenising the document. Example is that if the input string is O'brien then right now, InnoDB seperates into two tokens as O, brien. But after this patch, InnoDB can ignore the token 'O' and consider only 'brien'. --- mysql-test/suite/innodb_fts/r/fulltext.result | 28 +++++++++++++++++++++++++++ mysql-test/suite/innodb_fts/t/fulltext.test | 13 +++++++++++++ 2 files changed, 41 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index 7775a46e0d8..a6c88511670 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -732,4 +732,32 @@ ALTER TABLE t1 DROP KEY `ftidx` ; INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL); DROP TABLE t1; SET @@global.innodb_file_per_table = @save; +# +# MDEV-20797 FULLTEXT search with apostrophe, +# and mandatory words +# +CREATE TABLE t1(f1 TINYTEXT NOT NULL, FULLTEXT(f1))ENGINE=InnoDB; +INSERT INTO t1 VALUES('O''Brien'), ('O Brien'), ('''Brien'); +INSERT INTO t1 VALUES('Brien'), ('O ''Brien'), ('O'' Brien'); +INSERT INTO t1 VALUES('Doh''nuts'); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+O'Brien" IN BOOLEAN MODE); +f1 +O'Brien +O Brien +'Brien +Brien +O 'Brien +O' Brien +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE); +f1 +Doh'nuts +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+''Brien" IN BOOLEAN MODE); +f1 +O'Brien +O Brien +'Brien +Brien +O 'Brien +O' Brien +DROP TABLE t1; # End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test index 4878a0bee3f..f6c53abd525 100644 --- a/mysql-test/suite/innodb_fts/t/fulltext.test +++ b/mysql-test/suite/innodb_fts/t/fulltext.test @@ -757,4 +757,17 @@ INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL); DROP TABLE t1; SET @@global.innodb_file_per_table = @save; +--echo # +--echo # MDEV-20797 FULLTEXT search with apostrophe, +--echo # and mandatory words +--echo # +CREATE TABLE t1(f1 TINYTEXT NOT NULL, FULLTEXT(f1))ENGINE=InnoDB; +INSERT INTO t1 VALUES('O''Brien'), ('O Brien'), ('''Brien'); +INSERT INTO t1 VALUES('Brien'), ('O ''Brien'), ('O'' Brien'); +INSERT INTO t1 VALUES('Doh''nuts'); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+O'Brien" IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+''Brien" IN BOOLEAN MODE); +DROP TABLE t1; + --echo # End of 10.3 tests -- cgit v1.2.1 From 15a68fc255b3eb78a2678a2aee4123dea5911a54 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 20 Jul 2022 16:05:33 +0530 Subject: MDEV-29058 Assertion `index->type == 32' failed in dict_index_build_internal_fts - Import tablespace re-evicts and reload the table definition. During that time, innodb has to load the table even though the secondary fts index marked as corrupted --- mysql-test/suite/innodb_fts/r/fulltext.result | 14 ++++++++++++++ mysql-test/suite/innodb_fts/t/fulltext.test | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index a6c88511670..085c8caf261 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -760,4 +760,18 @@ Brien O 'Brien O' Brien DROP TABLE t1; +# +# MDEV-29058 Assertion `index->type == 32' failed +# in dict_index_build_internal_fts +# +call mtr.add_suppression("InnoDB: Index `f` of table `test`.`t2` is corrupted"); +call mtr.add_suppression("InnoDB: Skip adjustment of root pages for index `f`."); +CREATE TABLE t1 (f CHAR(8), FULLTEXT KEY (f)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 DISCARD TABLESPACE; +FLUSH TABLES t1 FOR EXPORT; +UNLOCK TABLES; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t2 IMPORT TABLESPACE; +DROP TABLE t2, t1; # End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test index f6c53abd525..2cf82d0fe90 100644 --- a/mysql-test/suite/innodb_fts/t/fulltext.test +++ b/mysql-test/suite/innodb_fts/t/fulltext.test @@ -770,4 +770,24 @@ SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE); SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+''Brien" IN BOOLEAN MODE); DROP TABLE t1; +--echo # +--echo # MDEV-29058 Assertion `index->type == 32' failed +--echo # in dict_index_build_internal_fts +--echo # +call mtr.add_suppression("InnoDB: Index `f` of table `test`.`t2` is corrupted"); +call mtr.add_suppression("InnoDB: Skip adjustment of root pages for index `f`."); +let $MYSQLD_DATADIR = `SELECT @@datadir`; +CREATE TABLE t1 (f CHAR(8), FULLTEXT KEY (f)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +ALTER TABLE t2 DISCARD TABLESPACE; +--disable_warnings +FLUSH TABLES t1 FOR EXPORT; +--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg +UNLOCK TABLES; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t2 IMPORT TABLESPACE; +--enable_warnings +DROP TABLE t2, t1; + --echo # End of 10.3 tests -- cgit v1.2.1 From 8d238d47268bcd7470abed147d79eb9546b28ac4 Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 30 Jun 2022 15:46:19 +0300 Subject: MDEV-28609 refine gtid-strict-mode to ignore same server-id gtid from the past ... on semisync slave To provide semisync master crash-recovery the same server-id transactions were made to accept for execution on the semisync slave when the strict gtid mode (see MDEV-27760). That however caused out-of-order error on a master's transaction server of the circular setup. The error was fair in the sense of the gtid strict mode rule as indeed under the condition of the circular setup the replicated transaction already exists in the local binlog. This is fixed by the commit to ignore on the gtid strict mode semisync slave those gtids that exist in the slave's binlog that effectively restores the default same-server-id ignore policy. At the same time the fixes complies with MDEV-21117 semisync slave recovery to accept the same server-id transactions that do not exist in local binlog. --- .../suite/rpl/r/rpl_circular_semi_sync.result | 133 ++++++++++++++--- .../suite/rpl/r/rpl_semi_sync_fail_over.result | 30 +++- mysql-test/suite/rpl/t/rpl_circular_semi_sync.test | 163 +++++++++++++++------ .../suite/rpl/t/rpl_semi_sync_fail_over.test | 21 ++- .../sys_vars/r/sysvars_server_notembedded.result | 2 +- 5 files changed, 268 insertions(+), 81 deletions(-) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result index dcced9833ca..5664b7913d2 100644 --- a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result +++ b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result @@ -1,12 +1,9 @@ include/master-slave.inc [connection master] -# Master server_1 and Slave server_2 initialiation ... +# Master server_1 and Slave server_2 initialization ... connection server_2; include/stop_slave.inc connection server_1; -set @@sql_log_bin = off; -call mtr.add_suppression("Slave: An attempt was made to binlog GTID 10-1-1 which would create an out-of-order sequence number with existing GTID"); -set @@sql_log_bin = on; RESET MASTER; set @@session.gtid_domain_id=10; set @@global.rpl_semi_sync_master_enabled = 1; @@ -22,31 +19,48 @@ Warnings: Warning 1948 Specified value for @@gtid_slave_pos contains no value for replication domain 0. This conflicts with the binary log which contains GTID 0-2-1. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos CHANGE MASTER TO master_use_gtid= slave_pos; include/start_slave.inc -# ... server_1 -> server_2 is set up +# server_1 -> server_2 semisync link is set up. connection server_1; -CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Innodb; -INSERT INTO t1 VALUES (1); +CREATE TABLE t1 (a INT PRIMARY KEY, b INT default 0) ENGINE=Innodb; +INSERT INTO t1(a) VALUES (1); +include/save_master_gtid.inc connection server_2; -# Circular configuration server_2 -> server_1 initialiation ... +include/sync_with_master_gtid.inc +# Circular configuration server_1 -> server_2 -> server_1 ... connection server_1; -# A. ... first when server_1 is in gtid strict mode... set @@global.gtid_strict_mode = true; set @@global.rpl_semi_sync_slave_enabled = 1; CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS; -# ... only for it to fail 'cos if its inconsistent (empty) slave's gtid state: -SELECT @@global.gtid_slave_pos; -@@global.gtid_slave_pos - -START SLAVE; -include/wait_for_slave_sql_error.inc [errno=1950] -# B. ... Resume on the circular setup with the server_id now in the non-strict mode ... -set @@global.gtid_strict_mode = false; include/start_slave.inc -# ... to have succeeded. +... is done. +## A. no out-of-order gtid error for own transaction made round trip +connection server_2; +set @@global.gtid_strict_mode = true; +set @@global.rpl_semi_sync_master_enabled = 1; +INSERT INTO t1(a) VALUES (2); +include/save_master_gtid.inc +connection server_1; +# +# the successful sync is a required proof +# +include/sync_with_master_gtid.inc +update t1 set b=b+1 where a=2; +include/save_master_gtid.inc connection server_2; -INSERT INTO t1 VALUES (2); +include/sync_with_master_gtid.inc +# Post-execution state check on both servers synchronized with each other connection server_1; -INSERT INTO t1 VALUES (3); +# ... the gtid states on server_1 +SHOW VARIABLES LIKE 'gtid_slave_pos'; +Variable_name Value +gtid_slave_pos 0-2-1,10-1-3,20-2-1 +SHOW VARIABLES LIKE 'gtid_binlog_pos'; +Variable_name Value +gtid_binlog_pos 0-2-1,10-1-3,20-2-1 +SELECT * from t1; +a b +1 0 +2 1 connection server_2; # The gtid states on server_2 must be equal to ... SHOW VARIABLES LIKE 'gtid_binlog_pos'; @@ -55,22 +69,95 @@ gtid_binlog_pos 0-2-1,10-1-3,20-2-1 SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-2-1,10-1-3,20-2-1 +SELECT * from t1; +a b +1 0 +2 1 +## B. out-of-order gtid error for a "foreign" server-id transaction +connection server_1; +set statement sql_log_bin=0 for call mtr.add_suppression("Slave: An attempt was made to binlog GTID 10-2-4"); +set @@session.server_id=2; +INSERT INTO t1(a) VALUES (3); +set @@session.server_id=default; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +INSERT INTO t1(a) VALUES (4); +include/save_master_gtid.inc +connection server_1; +include/wait_for_slave_sql_error.inc [errno=1950] +set sql_slave_skip_counter=1; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection server_2; +set statement sql_log_bin=0 for call mtr.add_suppression("Slave: An attempt was made to binlog GTID 20-1-3"); +set @@session.server_id=1; +INSERT INTO t1(a) VALUES (5); +set @@session.server_id=default; +include/save_master_gtid.inc +connection server_1; +include/sync_with_master_gtid.inc +INSERT INTO t1(a) VALUES (6); +include/save_master_gtid.inc +connection server_2; +include/wait_for_slave_sql_error.inc [errno=1950] +set sql_slave_skip_counter=1; +include/start_slave.inc +include/sync_with_master_gtid.inc +# Post-execution state check on both servers synchronized with each other connection server_1; # ... the gtid states on server_1 SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value -gtid_slave_pos 0-2-1,10-1-3,20-2-1 +gtid_slave_pos 0-2-1,10-1-5,20-1-3 SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value -gtid_binlog_pos 0-2-1,10-1-3,20-2-1 +gtid_binlog_pos 0-2-1,10-1-5,20-1-3 +SELECT * from t1; +a b +1 0 +2 1 +3 0 +4 0 +5 0 +6 0 +connection server_2; +include/sync_with_master_gtid.inc +# The gtid states on server_2 must be equal to ... +SHOW VARIABLES LIKE 'gtid_binlog_pos'; +Variable_name Value +gtid_binlog_pos 0-2-1,10-1-5,20-1-3 +SHOW VARIABLES LIKE 'gtid_slave_pos'; +Variable_name Value +gtid_slave_pos 0-2-1,10-1-5,20-1-3 +SELECT * from t1; +a b +1 0 +2 1 +3 0 +4 0 +5 0 +6 0 +# # Cleanup +# +connection server_1; +DROP TABLE t1; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc connection server_1; include/stop_slave.inc set @@global.rpl_semi_sync_master_enabled = default; set @@global.rpl_semi_sync_slave_enabled = default; set @@global.rpl_semi_sync_master_wait_point=default; -DROP TABLE t1; +set @@global.gtid_ignore_duplicates = default; +set @@global.gtid_strict_mode = default; connection server_2; +include/stop_slave.inc +set @@global.gtid_ignore_duplicates = default; set @@global.rpl_semi_sync_master_enabled = default; set @@global.rpl_semi_sync_slave_enabled = default; +set @@global.gtid_strict_mode = default; +include/start_slave.inc include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result index 1c15b10da96..8956eee2d2f 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result @@ -70,6 +70,9 @@ INSERT INTO t1 VALUES (3, 'dummy3'); SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-2-5 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-1-4,0-2-5 SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-1-4 @@ -84,12 +87,15 @@ gtid_slave_pos 0-2-5 SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-2-5 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-1-4,0-2-5 connection server_2; # # Case:2 # # CRASH the new master, and FAILOVER back to the original -# INSERT INTO t1 VALUES (4, REPEAT("x", 4100)) +# SET STATEMENT server_id=1 FOR INSERT INTO t1 VALUES (4, REPEAT("x", 4100)) # INSERT INTO t1 VALUES (5, REPEAT("x", 4100)) # Rows 4 and 5 will be in master's binlog but not committed, they get # replicated to slave and applied. On crash master should have 3 rows @@ -98,14 +104,14 @@ connection server_2; # Expected State post crash: #================================================================= # Master | Slave | -# 0-2-6 (Not commited) | 0-2-6 (Received through semi-sync | +# 0-1-6 (Not commited) | 0-1-6 (Received through semi-sync | # | replication and applied) | # 0-2-7 (Not commited) | 0-2-7 (Received through semi-sync | # | replication and applied) | #================================================================= connect conn_client,127.0.0.1,root,,test,$SERVER_MYPORT_2,; SET DEBUG_SYNC= "commit_before_get_LOCK_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; -INSERT INTO t1 VALUES (4, REPEAT("x", 4100)); +SET STATEMENT server_id=1 FOR INSERT INTO t1 VALUES (4, REPEAT("x", 4100)); connect conn_client_2,127.0.0.1,root,,test,$SERVER_MYPORT_2,; SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; SET GLOBAL debug_dbug="d,Notify_binlog_EOF"; @@ -123,7 +129,7 @@ SELECT @@GLOBAL.gtid_current_pos; # restart: --skip-slave-start=1 --rpl-semi-sync-slave-enabled=1 connection server_2; include/assert.inc [Table t1 should have 3 rows.] -FOUND 1 /truncated binlog file:.*slave.*000002/ in mysqld.2.err +FOUND 1 /truncated binlog file:.*slave.*000002.* to remove transactions starting from GTID 0-1-6/ in mysqld.2.err disconnect conn_client; connection server_1; set global rpl_semi_sync_master_enabled = 1; @@ -134,7 +140,7 @@ set global rpl_semi_sync_slave_enabled = 1; set @@global.gtid_slave_pos=@@global.gtid_binlog_pos; include/start_slave.inc # -# Server_1 promoted as master will send 0-2-6 and 0-2-7 to slave Server_2 +# Server_1 promoted as master will send 0-1-6 and 0-2-7 to slave Server_2 # connection server_1; INSERT INTO t1 VALUES (6, 'dummy6'); @@ -142,6 +148,9 @@ INSERT INTO t1 VALUES (6, 'dummy6'); SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-1-8 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-2-7,0-1-8 SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-2-7 @@ -156,6 +165,9 @@ gtid_slave_pos 0-1-8 SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-1-8 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-2-7,0-1-8 include/diff_tables.inc [server_1:t1, server_2:t1] connection server_1; # @@ -196,7 +208,7 @@ SELECT @@GLOBAL.gtid_current_pos; # restart: --skip-slave-start=1 --rpl-semi-sync-slave-enabled=1 connection server_1; include/assert.inc [Table t1 should have 6 rows.] -NOT FOUND /truncated binlog file:.*master.*000003/ in mysqld.1.err +FOUND 1 /truncated binlog file:.*master.*000002.* to remove transactions starting from GTID 0-1-9/ in mysqld.1.err disconnect conn_client; connection server_2; set global rpl_semi_sync_master_enabled = 1; @@ -216,6 +228,9 @@ include/save_master_gtid.inc SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-2-10 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-1-9,0-2-10 SHOW VARIABLES LIKE 'gtid_slave_pos'; Variable_name Value gtid_slave_pos 0-1-9 @@ -231,6 +246,9 @@ gtid_slave_pos 0-2-10 SHOW VARIABLES LIKE 'gtid_binlog_pos'; Variable_name Value gtid_binlog_pos 0-2-10 +SHOW VARIABLES LIKE 'gtid_binlog_state'; +Variable_name Value +gtid_binlog_state 0-1-9,0-2-10 # # Cleanup # diff --git a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test index 51fa5a242ea..267fa621945 100644 --- a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test @@ -1,115 +1,188 @@ # ==== References ==== # # MDEV-27760 event may non stop replicate in circular semisync setup -# +# MDEV-28609 refine gtid-strict-mode to ignore same server-id gtid from the past +# on semisync slave --source include/have_innodb.inc ---source include/have_binlog_format_row.inc +--source include/have_binlog_format_mixed.inc --source include/master-slave.inc # The following tests prove -# A. out-of-order gtid error when the stict gtid mode semisync slave -# receives the same server-id gtid event inconsistent -# (rpl_semi_sync_fail_over tests the consistent case) with its state; -# B. in the non-strict mode the same server-id events remains ignored -# by default as usual. -# ---echo # Master server_1 and Slave server_2 initialiation ... +# A. +# no out-of-order gtid error is done to the stict gtid mode semisync +# slave receives the same server-id gtid event from the past (of its gtid +# state). Such transaction is silently ignored similarly to +# replicate_same_sever_id; and +# B. +# In contrast to A. the out-of-order gtid error is thrown when a "foreign" +# server-id transaction makes its round-trip to the originator server. + +--echo # Master server_1 and Slave server_2 initialization ... --connection server_2 --source include/stop_slave.inc # Initial master --connection server_1 -set @@sql_log_bin = off; -call mtr.add_suppression("Slave: An attempt was made to binlog GTID 10-1-1 which would create an out-of-order sequence number with existing GTID"); -set @@sql_log_bin = on; - RESET MASTER; - set @@session.gtid_domain_id=10; - set @@global.rpl_semi_sync_master_enabled = 1; set @@global.rpl_semi_sync_master_wait_point=AFTER_SYNC; --connection server_2 RESET MASTER; ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; - set @@session.gtid_domain_id=20; - set @@global.rpl_semi_sync_slave_enabled = 1; --echo # a 1948 warning is expected set @@global.gtid_slave_pos = ""; CHANGE MASTER TO master_use_gtid= slave_pos; --source include/start_slave.inc ---echo # ... server_1 -> server_2 is set up +--echo # server_1 -> server_2 semisync link is set up. --connection server_1 -CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Innodb; -INSERT INTO t1 VALUES (1); ---save_master_pos +CREATE TABLE t1 (a INT PRIMARY KEY, b INT default 0) ENGINE=Innodb; +INSERT INTO t1(a) VALUES (1); +--source include/save_master_gtid.inc --connection server_2 ---sync_with_master +--source include/sync_with_master_gtid.inc ---echo # Circular configuration server_2 -> server_1 initialiation ... +--echo # Circular configuration server_1 -> server_2 -> server_1 ... --connection server_1 ---echo # A. ... first when server_1 is in gtid strict mode... set @@global.gtid_strict_mode = true; set @@global.rpl_semi_sync_slave_enabled = 1; evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS; - ---echo # ... only for it to fail 'cos if its inconsistent (empty) slave's gtid state: -SELECT @@global.gtid_slave_pos; -START SLAVE; -# ER_GTID_STRICT_OUT_OF_ORDER ---let $slave_sql_errno = 1950 ---source include/wait_for_slave_sql_error.inc - ---echo # B. ... Resume on the circular setup with the server_id now in the non-strict mode ... -set @@global.gtid_strict_mode = false; --source include/start_slave.inc +--echo ... is done. ---echo # ... to have succeeded. +--echo ## A. no out-of-order gtid error for own transaction made round trip +# A0. server_1 has already originated the transaction +--let $wait_condition=select @@gtid_slave_pos=@@gtid_binlog_pos +--source include/wait_condition.inc + +# A1. server_2 originates --connection server_2 -INSERT INTO t1 VALUES (2); ---save_master_pos +set @@global.gtid_strict_mode = true; +set @@global.rpl_semi_sync_master_enabled = 1; +INSERT INTO t1(a) VALUES (2); +--source include/save_master_gtid.inc --connection server_1 ---sync_with_master +--echo # +--echo # the successful sync is a required proof +--echo # +--source include/sync_with_master_gtid.inc +# A2. server_1 is originating now +update t1 set b=b+1 where a=2; +--source include/save_master_gtid.inc -INSERT INTO t1 VALUES (3); ---save_master_pos +--connection server_2 +--source include/sync_with_master_gtid.inc + +--echo # Post-execution state check on both servers synchronized with each other +--connection server_1 +--echo # ... the gtid states on server_1 +--let $wait_condition=select @@gtid_slave_pos=@@gtid_binlog_pos +--source include/wait_condition.inc +SHOW VARIABLES LIKE 'gtid_slave_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SELECT * from t1; --connection server_2 ---sync_with_master --echo # The gtid states on server_2 must be equal to ... --let $wait_condition=select @@gtid_slave_pos=@@gtid_binlog_pos --source include/wait_condition.inc SHOW VARIABLES LIKE 'gtid_binlog_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos'; +SELECT * from t1; + +--echo ## B. out-of-order gtid error for a "foreign" server-id transaction +# B1. circulation starts from server_1 + +--connection server_1 +set statement sql_log_bin=0 for call mtr.add_suppression("Slave: An attempt was made to binlog GTID 10-2-4"); +set @@session.server_id=2; +INSERT INTO t1(a) VALUES (3); +set @@session.server_id=default; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +INSERT INTO t1(a) VALUES (4); +--source include/save_master_gtid.inc + +--connection server_1 +--let $slave_sql_errno = 1950 +--source include/wait_for_slave_sql_error.inc +set sql_slave_skip_counter=1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +# B2. circulation starts from server_2 +--connection server_2 +set statement sql_log_bin=0 for call mtr.add_suppression("Slave: An attempt was made to binlog GTID 20-1-3"); +set @@session.server_id=1; +INSERT INTO t1(a) VALUES (5); +set @@session.server_id=default; +--source include/save_master_gtid.inc +--connection server_1 +--source include/sync_with_master_gtid.inc +INSERT INTO t1(a) VALUES (6); +--source include/save_master_gtid.inc + + +--connection server_2 +--let $slave_sql_errno = 1950 +--source include/wait_for_slave_sql_error.inc +set sql_slave_skip_counter=1; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +--echo # Post-execution state check on both servers synchronized with each other --connection server_1 --echo # ... the gtid states on server_1 --let $wait_condition=select @@gtid_slave_pos=@@gtid_binlog_pos --source include/wait_condition.inc SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SELECT * from t1; + +--connection server_2 +--source include/sync_with_master_gtid.inc +--echo # The gtid states on server_2 must be equal to ... +--let $wait_condition=select @@gtid_slave_pos=@@gtid_binlog_pos +--source include/wait_condition.inc +SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_slave_pos'; +SELECT * from t1; +--echo # --echo # Cleanup +--echo # +--connection server_1 +DROP TABLE t1; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc + --connection server_1 --source include/stop_slave.inc set @@global.rpl_semi_sync_master_enabled = default; set @@global.rpl_semi_sync_slave_enabled = default; set @@global.rpl_semi_sync_master_wait_point=default; - -DROP TABLE t1; ---save_master_pos +set @@global.gtid_ignore_duplicates = default; +set @@global.gtid_strict_mode = default; --connection server_2 ---sync_with_master +--source include/stop_slave.inc +set @@global.gtid_ignore_duplicates = default; set @@global.rpl_semi_sync_master_enabled = default; set @@global.rpl_semi_sync_slave_enabled = default; +set @@global.gtid_strict_mode = default; +--source include/start_slave.inc --source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test b/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test index 0505e88d758..6a691ae04f6 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_fail_over.test @@ -1,6 +1,7 @@ # ==== References ==== # -# MDEV-21117: recovery for --rpl-semi-sync-slave-enabled server +# MDEV-21117 recovery for --rpl-semi-sync-slave-enabled server +# MDEV-27760 event may non stop replicate in circular semisync setup # --source include/have_innodb.inc @@ -72,6 +73,7 @@ INSERT INTO t1 VALUES (1, 'dummy1'); --save_master_pos --echo # The gtid state on current master must be equal to ... SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; SHOW VARIABLES LIKE 'gtid_slave_pos'; --connection server_1 @@ -80,6 +82,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; --echo # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; --connection server_2 --let $case = 2 @@ -89,7 +92,9 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos'; --echo # CRASH the new master, and FAILOVER back to the original # value 0 for the reverse server id 2 -> 1 failover --let $failover_to_slave=0 ---let $query_to_crash = INSERT INTO t1 VALUES (4, REPEAT("x", 4100)) +# Additionally through "foreign" server_id verify MDEV-27760's acceptance +# policy on the recient (to be promoted into master) server. +--let $query_to_crash = SET STATEMENT server_id=1 FOR INSERT INTO t1 VALUES (4, REPEAT("x", 4100)) --let $query2_to_crash= INSERT INTO t1 VALUES (5, REPEAT("x", 4100)) --echo # $query_to_crash --echo # $query2_to_crash @@ -100,18 +105,18 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos'; --echo # Expected State post crash: --echo #================================================================= --echo # Master | Slave | ---echo # 0-2-6 (Not commited) | 0-2-6 (Received through semi-sync | +--echo # 0-1-6 (Not commited) | 0-1-6 (Received through semi-sync | --echo # | replication and applied) | --echo # 0-2-7 (Not commited) | 0-2-7 (Received through semi-sync | --echo # | replication and applied) | --echo #================================================================= ---let $log_search_pattern=truncated binlog file:.*slave.*000002 +--let $log_search_pattern=truncated binlog file:.*slave.*000002.* to remove transactions starting from GTID 0-1-6 --let $expected_rows_on_master= 3 --let $expected_rows_on_slave= 5 --source rpl_semi_sync_crash.inc --echo # ---echo # Server_1 promoted as master will send 0-2-6 and 0-2-7 to slave Server_2 +--echo # Server_1 promoted as master will send 0-1-6 and 0-2-7 to slave Server_2 --echo # --connection server_1 --let $rows_so_far=6 @@ -119,6 +124,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos'; --save_master_pos --echo # The gtid state on current master must be equal to ... SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; SHOW VARIABLES LIKE 'gtid_slave_pos'; --connection server_2 @@ -127,6 +133,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; --echo # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; --let $diff_tables=server_1:t1, server_2:t1 --source include/diff_tables.inc @@ -154,7 +161,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos'; --echo # 0-1-10 (Not commited - | | --echo # never sent to slave) | | --echo #================================================================= ---let $log_search_pattern=truncated binlog file:.*master.*000003 +--let $log_search_pattern=truncated binlog file:.*master.*000002.* to remove transactions starting from GTID 0-1-9 --let $expected_rows_on_master= 6 --let $expected_rows_on_slave= 7 --source rpl_semi_sync_crash.inc @@ -168,6 +175,7 @@ SHOW VARIABLES LIKE 'gtid_binlog_pos'; --source include/save_master_gtid.inc --echo # The gtid state on current master must be equal to ... SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; SHOW VARIABLES LIKE 'gtid_slave_pos'; --connection server_1 @@ -176,6 +184,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; --echo # ... the gtid states on the slave: SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos'; +SHOW VARIABLES LIKE 'gtid_binlog_state'; --echo # --echo # Cleanup diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 7b811a011ff..a661a806ff6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -1185,7 +1185,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME GTID_STRICT_MODE VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Enforce strict seq_no ordering of events in the binary log. Slave stops with an error if it encounters an event that would cause it to generate an out-of-order binlog if executed. +VARIABLE_COMMENT Enforce strict seq_no ordering of events in the binary log. Slave stops with an error if it encounters an event that would cause it to generate an out-of-order binlog if executed. When ON the same server-id semisync-replicated transactions that duplicate exising ones in binlog are ignored without error and slave interruption. NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -- cgit v1.2.1 From 9a897335eb4387980aed7698b832a893dbaa3d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 26 Jul 2022 16:45:10 +0300 Subject: MDEV-26420 Buffer overflow on instant ADD/DROP of generated column prepare_inplace_add_virtual(): Over-estimate the size of the arrays by not subtracting table->s->virtual_fields (which may refer to stored, not virtual generated columns). InnoDB only distinguishes virtual columns. --- mysql-test/suite/innodb/r/instant_alter_bugs.result | 7 +++++++ mysql-test/suite/innodb/t/instant_alter_bugs.test | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index 0c82ee8f070..2d667737a99 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -458,3 +458,10 @@ f4 INT NOT NULL, f5 INT NOT NULL), CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; +# +# MDEV-26420 Buffer overflow on instant ADD/DROP of generated column +# +CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i; +DROP TABLE t1; +# End of 10.4 tests diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index b22d4bbbae1..74e5949818b 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -476,3 +476,12 @@ ALTER TABLE t1 ADD COLUMN(f2 INT NOT NULL, f3 INT NOT NULL, CHANGE COLUMN f1 f1 CHAR(10) DEFAULT NULL; DROP TABLE t1; SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency; + +--echo # +--echo # MDEV-26420 Buffer overflow on instant ADD/DROP of generated column +--echo # +CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i; +DROP TABLE t1; + +--echo # End of 10.4 tests -- cgit v1.2.1 From 772e3f61eb2956143bbdb1d85490bd5aad73d43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 27 Jul 2022 08:25:13 +0300 Subject: MDEV-28950: Add a test case After reverting commit commit 39f45f6f89ce2fc2db54bb8ab0f6076f923beeec all combinations of this test would crash the server. --- mysql-test/suite/innodb_zip/r/page_size.result | 13 +++++++++++++ mysql-test/suite/innodb_zip/t/page_size.test | 15 +++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'mysql-test/suite') diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result index ff4ec9738d4..6830aa4bf48 100644 --- a/mysql-test/suite/innodb_zip/r/page_size.result +++ b/mysql-test/suite/innodb_zip/r/page_size.result @@ -595,3 +595,16 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(293))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512)); DROP TABLE t1; +# +# MDEV-28950 Assertion `*err == DB_SUCCESS' in btr_page_split_and_insert +# +CREATE TABLE t1(c CHAR(255) NOT NULL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (''); +ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +INSERT INTO t1 VALUES (''),(''),(''); +SET @save_innodb_compression_level= @@innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +INSERT INTO t1 VALUES (''); +SET GLOBAL innodb_compression_level= @save_innodb_compression_level; +DROP TABLE t1; +# End of 10.6 tests diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test index bee2d585101..16d65a139cf 100644 --- a/mysql-test/suite/innodb_zip/t/page_size.test +++ b/mysql-test/suite/innodb_zip/t/page_size.test @@ -874,3 +874,18 @@ ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; --enable_warnings INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512)); DROP TABLE t1; + +--echo # +--echo # MDEV-28950 Assertion `*err == DB_SUCCESS' in btr_page_split_and_insert +--echo # +CREATE TABLE t1(c CHAR(255) NOT NULL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (''); +ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +INSERT INTO t1 VALUES (''),(''),(''); +SET @save_innodb_compression_level= @@innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +INSERT INTO t1 VALUES (''); +SET GLOBAL innodb_compression_level= @save_innodb_compression_level; +DROP TABLE t1; + +--echo # End of 10.6 tests -- cgit v1.2.1