66# First we test tables with only an index.
77#
88
9+ connection master;
910eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
1011SELECT * FROM t1;
1112sync_slave_with_master;
@@ -156,6 +157,12 @@ SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5
156157# Testing special column types
157158#
158159
160+ if (`select char_length('$bit_field_special') > 0`) {
161+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
162+ connection slave;
163+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
164+ }
165+
159166connection master;
160167eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
161168
@@ -164,6 +171,10 @@ SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
164171sync_slave_with_master;
165172SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
166173
174+ if (`select char_length('$bit_field_special') > 0`) {
175+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
176+ }
177+
167178#
168179# Testing conflicting operations
169180#
@@ -350,6 +361,10 @@ eval CREATE TABLE t7 (i INT NOT NULL,
350361 c CHAR(255) CHARACTER SET utf8 NOT NULL,
351362 j INT NOT NULL) ENGINE = $type ;
352363
364+ connection slave;
365+ SET @saved_slave_type_conversions = @@slave_type_conversions;
366+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
367+
353368--echo [expecting slave to replicate correctly]
354369connection master;
355370INSERT INTO t1 VALUES (1, "", 1);
@@ -370,17 +385,9 @@ let $diff_table_1=master:test.t2;
370385let $diff_table_2=slave:test.t2;
371386source include/diff_tables.inc;
372387
373- --echo [expecting slave to stop]
374- connection master;
375- INSERT INTO t3 VALUES (1, "", 1);
376- INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
377-
378388connection slave;
379- source include/wait_for_slave_sql_to_stop.inc;
380- let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
381- disable_query_log;
382- eval SELECT "$last_error" AS Last_SQL_Error;
383- enable_query_log;
389+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
390+
384391connection master;
385392RESET MASTER;
386393connection slave;
@@ -600,7 +607,15 @@ sync_slave_with_master;
600607
601608connection master;
602609
610+ # Since t1 contain a bit field, we have to do this trick to handle InnoDB
611+ if (`select char_length('$bit_field_special') > 0`) {
612+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
613+ connection slave;
614+ eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
615+ }
616+
603617--disable_warnings
618+ connection master;
604619eval CREATE TABLE t1 (a bit) ENGINE=$type;
605620INSERT IGNORE INTO t1 VALUES (NULL);
606621INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -645,6 +660,10 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
645660
646661sync_slave_with_master;
647662
663+ if (`select char_length('$bit_field_special') > 0`) {
664+ SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
665+ }
666+
648667let $diff_table_1=master:test.t1;
649668let $diff_table_2=slave:test.t1;
650669source include/diff_tables.inc;
0 commit comments