Debian Codegraph @

mysql-test/suite/ndb_rpl/r/ndb_rpl_gcol.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 --- Doing pre test setup and CREATE TABLE ---
7 CREATE TABLE test_gcol_stored
8 (id MEDIUMINT NOT NULL PRIMARY KEY,
9 gcol_int int GENERATED ALWAYS AS (100 + id) STORED,
10 misc int,
11 gcol_str varchar(20) GENERATED ALWAYS AS (concat("User ", id)) STORED
12 ) engine = ndb;
13 CREATE TABLE test_gcol_virtual
14 (id MEDIUMINT NOT NULL PRIMARY KEY,
15 gcol_int int GENERATED ALWAYS AS (100 + id),
16 misc int,
17 gcol_str varchar(20) GENERATED ALWAYS AS (concat("User ", id))
18 ) engine = ndb;
19 --- Show table on slave ---
20 SHOW CREATE TABLE test_gcol_stored;
21 Table Create Table
22 test_gcol_stored CREATE TABLE `test_gcol_stored` (
23 `id` mediumint NOT NULL,
24 `gcol_int` int GENERATED ALWAYS AS ((100 + `id`)) STORED,
25 `misc` int DEFAULT NULL,
26 `gcol_str` varchar(20) GENERATED ALWAYS AS (concat(_utf8mb4'User ',`id`)) STORED,
27 PRIMARY KEY (`id`)
28 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
29 --- Insert on master
30 insert into test_gcol_stored (id) values (1), (2), (3), (4), (5);
31 insert into test_gcol_virtual (id) values (1), (2), (3), (4), (5);
32 select * from test_gcol_stored order by id;
33 id gcol_int misc gcol_str
34 1 101 NULL User 1
35 2 102 NULL User 2
36 3 103 NULL User 3
37 4 104 NULL User 4
38 5 105 NULL User 5
39 select * from test_gcol_virtual order by id;
40 id gcol_int misc gcol_str
41 1 101 NULL User 1
42 2 102 NULL User 2
43 3 103 NULL User 3
44 4 104 NULL User 4
45 5 105 NULL User 5
46 --- Update by pk on master
47 update test_gcol_stored set misc = 44 where id = 4;
48 update test_gcol_virtual set misc = 44 where id = 4;
49 select * from test_gcol_stored order by id;
50 id gcol_int misc gcol_str
51 1 101 NULL User 1
52 2 102 NULL User 2
53 3 103 NULL User 3
54 4 104 44 User 4
55 5 105 NULL User 5
56 select * from test_gcol_virtual order by id;
57 id gcol_int misc gcol_str
58 1 101 NULL User 1
59 2 102 NULL User 2
60 3 103 NULL User 3
61 4 104 44 User 4
62 5 105 NULL User 5
63 --- Update by gcol on master
64 update test_gcol_stored set misc = 45 where gcol_int = 105;
65 update test_gcol_virtual set misc = 45 where gcol_int = 105;
66 select * from test_gcol_stored order by id;
67 id gcol_int misc gcol_str
68 1 101 NULL User 1
69 2 102 NULL User 2
70 3 103 NULL User 3
71 4 104 44 User 4
72 5 105 45 User 5
73 select * from test_gcol_virtual order by id;
74 id gcol_int misc gcol_str
75 1 101 NULL User 1
76 2 102 NULL User 2
77 3 103 NULL User 3
78 4 104 44 User 4
79 5 105 45 User 5
80 --- Delete by key on master
81 delete from test_gcol_stored where id = 1;
82 delete from test_gcol_virtual where id = 1;
83 select * from test_gcol_stored order by id;
84 id gcol_int misc gcol_str
85 2 102 NULL User 2
86 3 103 NULL User 3
87 4 104 44 User 4
88 5 105 45 User 5
89 select * from test_gcol_virtual order by id;
90 id gcol_int misc gcol_str
91 2 102 NULL User 2
92 3 103 NULL User 3
93 4 104 44 User 4
94 5 105 45 User 5
95 -- Delete by gcol on master
96 delete from test_gcol_stored where gcol_int = 102;
97 delete from test_gcol_virtual where gcol_int = 102;
98 select * from test_gcol_stored order by id;
99 id gcol_int misc gcol_str
100 3 103 NULL User 3
101 4 104 44 User 4
102 5 105 45 User 5
103 select * from test_gcol_virtual order by id;
104 id gcol_int misc gcol_str
105 3 103 NULL User 3
106 4 104 44 User 4
107 5 105 45 User 5
108 -- Delete by non-key stored column on master
109 delete from test_gcol_stored where misc is null;
110 delete from test_gcol_virtual where misc is null;
111 select * from test_gcol_stored order by id;
112 id gcol_int misc gcol_str
113 4 104 44 User 4
114 5 105 45 User 5
115 select * from test_gcol_virtual order by id;
116 id gcol_int misc gcol_str
117 4 104 44 User 4
118 5 105 45 User 5
119 -- Drop test table and clean up
120 drop table test_gcol_stored;
121 drop table test_gcol_virtual;
122 include/rpl_end.inc