Debian Codegraph @

mysql-test/suite/ndb_rpl/t/ndb_rpl_cmp_varchar_charset.inc

raw
1
2 ##############################
3 # Include file used by test case forbug#34388068
4
5 --echo
6 --echo
7 --echo #####################################
8
9 show variables like 'ndb_log_update_%';
10
11 --echo #####################################
12 --echo ############## Varchar ##############
13
14 --connection master
15 create table t1(str varchar(32) primary key) engine = ndb;
16
17 --echo Insert space padded row, then update it to non-padded
18 insert into t1(str) values ("one ");
19 update t1 set str="one";
20
21 --echo Verify the replica update, no trailing spaces anymore!
22 --sync_slave_with_master
23 --connection slave
24 select concat("<<<",str,">>>") from t1;
25
26 --connection master
27 drop table t1;
28
29 --echo #########################################
30 --echo ############## Longvarchar ##############
31
32 --connection master
33 create table t1(str varchar(512) primary key) engine = ndb;
34
35 --echo Insert space padded row, then update it to non-padded
36 insert into t1(str) values ("one ");
37 update t1 set str="one";
38
39 --echo Verify the replica update, no trailing spaces anymore!
40 --sync_slave_with_master
41 --connection slave
42 select concat("<<<",str,">>>") from t1;
43
44 --connection master
45 drop table t1;
46
47 --echo #####################################
48 --echo ############ Varbinary ##############
49 # Varbinary not affected by bug as the binary representation
50 # compared as non equal from the beginning.
51 --connection master
52 create table t1(str varbinary(32) primary key) engine = ndb;
53
54 --echo Insert space padded row, then update it to non-padded
55 insert into t1(str) values ("one ");
56 update t1 set str="one";
57
58 --echo Verify the replica update, no trailing spaces anymore!
59 --sync_slave_with_master
60 --connection slave
61 select concat("<<<",str,">>>") from t1;
62
63 --connection master
64 drop table t1;
65
66 # Note that fixed-char data type is not used in the above
67 # test cases as fixed-chars are always stored space padded.
68 # Thus, updating to a non-space padded has no effect.
69
70
71 --echo ##########################################################
72 --echo # Lower and upper case are compared as equal.
73 --echo # Binary representation are unequal though, and update
74 --echo # Need to be propogated to replica even when the 'after' images
75 --echo # are 'compared-equal'.
76 --echo # Tests inserts 'xyz', then update it to 'XYZ'.
77 --echo # Check that rows are updated on replica as well.
78 --echo
79 --echo #####################################
80 --echo ############## Varchar ##############
81 --connection master
82 create table t1(str varchar(32) primary key) engine = ndb;
83
84 --echo Insert 'xyz', then update varchar(32) to 'XYZ'
85 insert into t1(str) values ("xyz");
86 update t1 set str="XYZ";
87
88 --echo Verify the replica updated varchar(32) to 'XYZ' as well
89 --sync_slave_with_master
90 --connection slave
91 select str from t1;
92
93 --connection master
94 drop table t1;
95
96 --echo ##################################
97 --echo ############## Char ##############
98 --connection master
99 create table t1(str char(32) primary key) engine = ndb;
100
101 --echo Insert 'xyz', then update char(32) to 'XYZ'
102 insert into t1(str) values ("xyz");
103 update t1 set str="XYZ";
104
105 --echo Verify the replica updated char(32) to 'XYZ' as well
106 --sync_slave_with_master
107 --connection slave
108 select str from t1;
109
110 --connection master
111 drop table t1;
112
113 --echo ##################################
114 --echo ############ Varbinary ###########
115 --connection master
116 create table t1(str varbinary(32) primary key) engine = ndb;
117
118 --echo Insert 'xyz', then update varbinary(32) to 'XYZ'
119 insert into t1(str) values ("xyz");
120 update t1 set str="XYZ";
121
122 --echo Verify the replica updated varbinary(32) to 'XYZ' as well
123 --sync_slave_with_master
124 --connection slave
125 select str from t1;
126
127 --connection master
128 drop table t1;