Debian Codegraph @

mysql-test/suite/ndb_rpl/t/ndb_rpl_blob_size.test

raw
1 # WL#15044 Configurable BLOB inline size
2 # CREATE and INSERT definitions of extended Blob feature BLOB_INLINE_SIZE
3
4 --source include/have_ndb.inc
5 --source include/have_binlog_format_mixed_or_row.inc
6 --source suite/ndb_rpl/ndb_master-slave.inc
7
8 --connection slave
9 stop replica;
10
11 --echo ## CREATE TABLE in master with custom Blob inline size
12 --connection master
13 CREATE TABLE test.t1 (a int primary key,
14 b blob comment "NDB_COLUMN=BLOB_INLINE_SIZE=64",
15 bm mediumblob comment "NDB_COLUMN=BLOB_INLINE_SIZE=700",
16 bl longblob,
17 t text comment "NDB_COLUMN=BLOB_INLINE_SIZE=100",
18 tm mediumtext comment "NDB_COLUMN=BLOB_INLINE_SIZE=512",
19 tl longtext comment "NDB_COLUMN=BLOB_INLINE_SIZE=128")
20 engine=ndb;
21
22 --echo ## Verify inline and partition sizes of test.t1 on master
23 SELECT inline_size, part_size FROM ndbinfo.blobs WHERE table_name = 't1';
24
25 reset master;
26
27 --echo ## Create table in replica with other custom Blob inline size
28 --connection slave
29 CREATE TABLE test.t1 (a int primary key,
30 b blob comment "NDB_COLUMN=BLOB_INLINE_SIZE=96",
31 bm mediumblob comment "NDB_COLUMN=BLOB_INLINE_SIZE=456",
32 bl longblob comment "NDB_COLUMN=BLOB_INLINE_SIZE=766",
33 t text,
34 tm mediumtext comment "NDB_COLUMN=BLOB_INLINE_SIZE=255",
35 tl longtext comment "NDB_COLUMN=BLOB_INLINE_SIZE=255")
36 engine=ndb;
37
38 start replica;
39
40 --echo ## Verify inline and partition sizes of test.t1 on replica
41 SELECT inline_size, part_size FROM ndbinfo.blobs WHERE table_name = 't1';
42
43 --echo ## Connect to master and insert values on test.t1
44 --connection master
45
46 INSERT INTO test.t1 VALUES
47 (
48 1,
49 repeat('J',60000),
50 repeat('J',60000),
51 repeat('J',60000),
52 repeat(_utf32 0x1F47E,15000),
53 repeat(_utf32 0x1F47E,60000),
54 repeat(_utf32 0x1F47E,60000)),
55 (
56 2,
57 repeat('K',60000),
58 repeat('K',60000),
59 repeat('K',60000),
60 repeat(_utf32 0x1F47D,15000),
61 repeat(_utf32 0x1F47D,60000),
62 repeat(_utf32 0x1F47D,60000)),
63 (
64 3,
65 repeat('L',60000),
66 repeat('L',60000),
67 repeat('L',60000),
68 repeat(_utf32 0x1F47C,15000),
69 repeat(_utf32 0x1F47C,60000),
70 repeat(_utf32 0x1F47C,60000));
71
72 --echo
73
74 --echo ## Verify inserted values on master, sync and verify those on replica
75
76 SELECT a, sha1(b), sha1(bm), sha1(bl), sha1(t), sha1(tm), sha1(tl) FROM test.t1 ORDER BY a;
77
78 --sync_slave_with_master
79 --connection slave
80
81 SELECT a, sha1(b), sha1(bm), sha1(bl), sha1(t), sha1(tm), sha1(tl) FROM test.t1 ORDER BY a;
82
83 --echo
84
85 --echo ## Update values on master, verify, sync and verify those on replica
86
87 --connection master
88
89 UPDATE test.t1 SET
90 b=left(b,59000),
91 bm=left(bm, 59000),
92 bl=left(bl, 59000),
93 t=left(t,14000),
94 tm=left(tm, 59000),
95 tl=left(tl, 59000);
96
97 SELECT a, sha1(b), sha1(bm), sha1(bl), sha1(t), sha1(tm), sha1(tl) FROM test.t1 order by a;
98
99 --sync_slave_with_master
100 --connection slave
101
102 SELECT a, sha1(b), sha1(bm), sha1(bl), sha1(t), sha1(tm), sha1(tl) FROM test.t1 order by a;
103
104 --echo
105
106 --connection master
107
108 --echo ## Delete on master, sync and verify deletion on replica
109
110 DELETE FROM test.t1;
111
112 --sync_slave_with_master
113 --connection slave
114
115 SELECT a, sha1(b), sha1(bm), sha1(bl), sha1(t), sha1(tm), sha1(tl) FROM test.t1 order by a;
116
117 --connection master
118 DROP TABLE test.t1;
119
120 --source include/rpl_end.inc