From 4740565ebbad794a7e8a0d8fb75ee48ac17a9b00 Mon Sep 17 00:00:00 2001 From: "tomas@whalegate.ndb.mysql.com" <> Date: Mon, 10 Dec 2007 13:29:23 +0100 Subject: [PATCH] backport test for bug#30674 (bug not present in 5.1) --- .../extra/rpl_tests/rpl_extraMaster_Col.test | 9 +------- mysql-test/suite/ndb/r/ndb_blob.result | 21 +++++++++++++++++++ mysql-test/suite/ndb/t/ndb_blob.test | 20 ++++++++++++++++++ .../rpl/r/rpl_extraColmaster_innodb.result | 15 +++++++------ .../rpl/r/rpl_extraColmaster_myisam.result | 15 +++++++------ .../rpl_ndb/r/rpl_ndb_extraColMaster.result | 10 +++++---- 6 files changed, 66 insertions(+), 24 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test index d3959d10306..1cf11755b3f 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test @@ -973,14 +973,7 @@ SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; --echo --echo ** update from master ** connection master; -####################################### -# This test should be uncommented -# once bug30674 is patched -####################################### - -#*************************** -#UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -#*************************** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; --replace_column 5 CURRENT_TIMESTAMP SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; diff --git a/mysql-test/suite/ndb/r/ndb_blob.result b/mysql-test/suite/ndb/r/ndb_blob.result index 34f2c5fdd66..31ce36864af 100644 --- a/mysql-test/suite/ndb/r/ndb_blob.result +++ b/mysql-test/suite/ndb/r/ndb_blob.result @@ -568,3 +568,24 @@ select count(*) from t1; count(*) 0 drop table t1; +create table t1( +a int, +blob_nn blob not null, +text_nn text not null, +blob_nl blob, +text_nl text, +primary key(a) +) engine=ndb; +insert into t1(a) values (1); +Warnings: +Warning 1364 Field 'blob_nn' doesn't have a default value +Warning 1364 Field 'text_nn' doesn't have a default value +insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB'); +Warnings: +Warning 1364 Field 'blob_nn' doesn't have a default value +Warning 1364 Field 'text_nn' doesn't have a default value +select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a; +a length(blob_nn) length(text_nn) blob_nl text_nl +1 0 0 NULL NULL +2 0 0 NULL MySQL Cluster NDB +drop table t1; diff --git a/mysql-test/suite/ndb/t/ndb_blob.test b/mysql-test/suite/ndb/t/ndb_blob.test index b9a8c7e20ee..0388913df8b 100644 --- a/mysql-test/suite/ndb/t/ndb_blob.test +++ b/mysql-test/suite/ndb/t/ndb_blob.test @@ -497,3 +497,23 @@ select count(*) from t1; drop table t1; # End of 4.1 tests + + +# bug # 30674 : +# NOT NULL Blobs should default to zero-length. Not NULL TEXT +# should default to zero-chars +create table t1( + a int, + blob_nn blob not null, + text_nn text not null, + blob_nl blob, + text_nl text, + primary key(a) +) engine=ndb; + +insert into t1(a) values (1); +insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB'); + +select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a; + +drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index 28985eb8cba..5a98fa46785 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -1089,18 +1089,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; @@ -2229,18 +2230,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; @@ -3369,18 +3371,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 966f97e0578..27711666f37 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -1089,18 +1089,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; @@ -2229,18 +2230,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; @@ -3369,18 +3371,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result index 38c8ab2afc5..9aa7be985fc 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result @@ -1089,18 +1089,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18; @@ -2229,18 +2230,19 @@ c1 hex(c4) c5 3 62316231623162316231623162316231 QA ** update from master ** +UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; c1 hex(c4) c5 c6 c7 1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP ** Check slave ** SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; c1 hex(c4) c5 1 62316231623162316231623162316231 Kyle 2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA +3 62316231623162316231623162316231 TEST DROP TABLE t18;