1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Sept/15/2005 #
4
#############################################################################
5
# Test: To test the replication of the bit field #
6
#############################################################################
8
-- source include/master-slave.inc
11
# Begin clean up test section
14
DROP TABLE IF EXISTS test.t1;
18
# Begin test section 1
20
CREATE TABLE test.t1 (
21
dummyKey INTEGER NOT NULL,
60
LOCK TABLES test.t1 WRITE;
61
INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,NULL,1);
62
INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
63
INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
64
INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
65
INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'0',1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
66
INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
67
INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
68
INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
71
UPDATE test.t1 set x034 = 50 where bit3 = b'000000';
72
UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0';
73
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
75
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
76
SELECT hex(bit1) from test.t1 ORDER BY bit1;
77
SELECT hex(bit2) from test.t1 ORDER BY bit2;
78
SELECT hex(bit3) from test.t1 ORDER BY bit3;
83
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
85
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
86
SELECT hex(bit1) from test.t1 ORDER BY bit1;
87
SELECT hex(bit2) from test.t1 ORDER BY bit2;
88
SELECT hex(bit3) from test.t1 ORDER BY bit3;
91
CREATE TABLE test.t2 (a INT, b BIT(1));
92
INSERT INTO test.t2 VALUES (1, b'0');
93
INSERT INTO test.t2 VALUES (1, b'1');
94
UPDATE test.t2 SET a = 2 WHERE b = b'1';
96
CREATE TABLE test.t3 (a INT, b INT);
97
INSERT INTO test.t3 VALUES (1, NULL);
98
INSERT INTO test.t3 VALUES (1, 0);
99
UPDATE test.t3 SET a = 2 WHERE b = 0;
101
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
102
SELECT * FROM test.t3 ORDER BY a,b;
107
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
108
SELECT * FROM test.t3 ORDER BY a,b;
111
DROP TABLE IF EXISTS test.t1;
112
DROP TABLE IF EXISTS test.t2;
113
DROP TABLE IF EXISTS test.t3;
114
sync_slave_with_master;
116
# End of 5.0 test case