| 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/not_group_replication_plugin.inc |
| 9 |
-- source include/master-slave.inc |
| 10 |
|
| 11 |
|
| 12 |
# Begin clean up test section |
| 13 |
connection master; |
| 14 |
--disable_warnings |
| 15 |
DROP TABLE IF EXISTS test.t1; |
| 16 |
--enable_warnings |
| 17 |
# End of cleanup |
| 18 |
|
| 19 |
# Begin test section 1 |
| 20 |
|
| 21 |
CREATE TABLE test.t1 ( |
| 22 |
dummyKey INTEGER NOT NULL, |
| 23 |
f01 TINYINT, |
| 24 |
f10 TINYINT, |
| 25 |
f12 TINYINT, |
| 26 |
f15 TINYINT, |
| 27 |
f16 TINYINT, |
| 28 |
f7 TINYINT, |
| 29 |
f9 TINYINT, |
| 30 |
f29 TINYINT, |
| 31 |
f0 TINYINT, |
| 32 |
fA1 TINYINT, |
| 33 |
C32 TINYINT, |
| 34 |
A42 TINYINT, |
| 35 |
CA3 TINYINT, |
| 36 |
A044 TINYINT, |
| 37 |
f001 TINYINT, |
| 38 |
A3002 TINYINT, |
| 39 |
fC003 TINYINT, |
| 40 |
CA300 TINYINT, |
| 41 |
A305 TINYINT, |
| 42 |
CA321 TINYINT, |
| 43 |
r001 TINYINT, |
| 44 |
bit1 BIT(6), |
| 45 |
bit2 BIT(6), |
| 46 |
bit3 BIT(6), |
| 47 |
State1 TINYINT, |
| 48 |
State2 TINYINT, |
| 49 |
State3 TINYINT, |
| 50 |
State4 TINYINT, |
| 51 |
SubState TINYINT, |
| 52 |
gState TINYINT, |
| 53 |
oSupp TINYINT, |
| 54 |
tSupp TINYINT, |
| 55 |
sSuppD TINYINT, |
| 56 |
mSuppf TINYINT, |
| 57 |
GSuppDf TINYINT, |
| 58 |
VNotSupp TINYINT, |
| 59 |
x034 TINYINT); |
| 60 |
|
| 61 |
LOCK TABLES test.t1 WRITE; |
| 62 |
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); |
| 63 |
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); |
| 64 |
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); |
| 65 |
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); |
| 66 |
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); |
| 67 |
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); |
| 68 |
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); |
| 69 |
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); |
| 70 |
UNLOCK TABLES; |
| 71 |
|
| 72 |
UPDATE test.t1 set x034 = 50 where bit3 = b'000000'; |
| 73 |
UPDATE test.t1 set VNotSupp = 33 where bit1 = b'0'; |
| 74 |
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 |
| 75 |
FROM test.t1 |
| 76 |
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; |
| 77 |
SELECT hex(bit1) from test.t1 ORDER BY bit1; |
| 78 |
SELECT hex(bit2) from test.t1 ORDER BY bit2; |
| 79 |
SELECT hex(bit3) from test.t1 ORDER BY bit3; |
| 80 |
--source include/sync_slave_sql_with_master.inc |
| 81 |
|
| 82 |
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 |
| 83 |
FROM test.t1 |
| 84 |
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034; |
| 85 |
SELECT hex(bit1) from test.t1 ORDER BY bit1; |
| 86 |
SELECT hex(bit2) from test.t1 ORDER BY bit2; |
| 87 |
SELECT hex(bit3) from test.t1 ORDER BY bit3; |
| 88 |
|
| 89 |
connection master; |
| 90 |
CREATE TABLE test.t2 (a INT, b BIT(1)); |
| 91 |
INSERT INTO test.t2 VALUES (1, b'0'); |
| 92 |
INSERT INTO test.t2 VALUES (1, b'1'); |
| 93 |
UPDATE test.t2 SET a = 2 WHERE b = b'1'; |
| 94 |
|
| 95 |
CREATE TABLE test.t3 (a INT, b INT); |
| 96 |
INSERT INTO test.t3 VALUES (1, NULL); |
| 97 |
INSERT INTO test.t3 VALUES (1, 0); |
| 98 |
UPDATE test.t3 SET a = 2 WHERE b = 0; |
| 99 |
|
| 100 |
SELECT a, hex(b) FROM test.t2 ORDER BY a,b; |
| 101 |
SELECT * FROM test.t3 ORDER BY a,b; |
| 102 |
--source include/sync_slave_sql_with_master.inc |
| 103 |
|
| 104 |
SELECT a, hex(b) FROM test.t2 ORDER BY a,b; |
| 105 |
SELECT * FROM test.t3 ORDER BY a,b; |
| 106 |
|
| 107 |
connection master; |
| 108 |
DROP TABLE IF EXISTS test.t1; |
| 109 |
DROP TABLE IF EXISTS test.t2; |
| 110 |
DROP TABLE IF EXISTS test.t3; |
| 111 |
--source include/sync_slave_sql_with_master.inc |
| 112 |
|
| 113 |
# End of 5.0 test case |
| 114 |
--source include/rpl_end.inc |