~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_bit_npk.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# Original Author: JBM                                                      #
 
3
# Original Date: Sept/15/2005                                               #
 
4
#############################################################################
 
5
# Test: To test the replication of the bit field                            #
 
6
#############################################################################
 
7
 
 
8
-- source include/master-slave.inc
 
9
 
 
10
 
 
11
# Begin clean up test section
 
12
connection master;
 
13
--disable_warnings
 
14
DROP TABLE IF EXISTS test.t1;
 
15
--enable_warnings
 
16
# End of cleanup
 
17
 
 
18
# Begin test section 1
 
19
 
 
20
CREATE TABLE test.t1 (
 
21
                dummyKey INTEGER NOT NULL,
 
22
                f01 TINYINT,
 
23
                f10 TINYINT,
 
24
                f12 TINYINT,
 
25
                f15 TINYINT,
 
26
                f16 TINYINT,
 
27
                f7 TINYINT,
 
28
                f9 TINYINT,
 
29
                f29 TINYINT,
 
30
                f0 TINYINT,
 
31
                fA1 TINYINT,
 
32
                C32 TINYINT,
 
33
                A42 TINYINT,
 
34
                CA3 TINYINT,
 
35
                A044 TINYINT,
 
36
                f001 TINYINT,
 
37
                A3002 TINYINT,
 
38
                fC003 TINYINT,
 
39
                CA300 TINYINT,
 
40
                A305 TINYINT,
 
41
                CA321 TINYINT,
 
42
                r001 TINYINT,
 
43
                bit1 BIT(6),
 
44
                bit2 BIT(6),
 
45
                bit3 BIT(6),
 
46
                State1 TINYINT,
 
47
                State2 TINYINT,
 
48
                State3 TINYINT,
 
49
                State4 TINYINT,
 
50
                SubState TINYINT,
 
51
                gState TINYINT,
 
52
                oSupp TINYINT,
 
53
                tSupp TINYINT,
 
54
                sSuppD TINYINT,
 
55
                mSuppf TINYINT,
 
56
                GSuppDf TINYINT,
 
57
                VNotSupp TINYINT,
 
58
                x034 TINYINT);
 
59
 
 
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);
 
69
UNLOCK TABLES;
 
70
 
 
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
 
74
    FROM test.t1
 
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;
 
79
save_master_pos;
 
80
 
 
81
connection slave;
 
82
sync_with_master;
 
83
SELECT  oSupp, sSuppD, GSuppDf, VNotSupp, x034
 
84
    FROM test.t1
 
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;
 
89
 
 
90
connection master;
 
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';
 
95
 
 
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;
 
100
 
 
101
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
 
102
SELECT * FROM test.t3 ORDER BY a,b;
 
103
save_master_pos;
 
104
 
 
105
connection slave;
 
106
sync_with_master;
 
107
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
 
108
SELECT * FROM test.t3 ORDER BY a,b;
 
109
 
 
110
connection master;
 
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;
 
115
 
 
116
# End of 5.0 test case