Debian Codegraph @

mysql-test/suite/gcol/r/rpl_gcol.result

raw
1 SET @@session.default_storage_engine = 'InnoDB';
2 include/master-slave.inc
3 Warnings:
4 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
5 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.
6 [connection master]
7 create table t1 (a int, b int generated always as (a+1) virtual);
8 show create table t1;
9 Table Create Table
10 t1 CREATE TABLE `t1` (
11 `a` int DEFAULT NULL,
12 `b` int GENERATED ALWAYS AS ((`a` + 1)) VIRTUAL
13 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
14 insert into t1 values (1,default);
15 insert into t1 values (2,default);
16 select * from t1;
17 a b
18 1 2
19 2 3
20 select * from t1;
21 a b
22 1 2
23 2 3
24 drop table t1;
25 #
26 # Bug#22241015: REPLICATION SERVERS CRASHES WHILE CHANGING A
27 # VALUE OF INDEXED JSON FIELD
28 #
29 CREATE TABLE gtable (doc JSON);
30 INSERT INTO gtable (doc) VALUES
31 ('{"id": 1, "name": "Omar Bras"}'),
32 ('{"id": 2, "name": "Omar Mex"}');
33 ALTER TABLE gtable ADD COLUMN gtext TEXT GENERATED ALWAYS AS
34 (JSON_UNQUOTE(JSON_EXTRACT(doc, '$.name'))) VIRTUAL,
35 ADD UNIQUE INDEX name_index (gtext(50));
36 UPDATE gtable SET doc=JSON_SET(doc,'$.name',"Omar Argentina") WHERE JSON_EXTRACT(doc, "$.id") = 2;
37 INSERT INTO gtable(doc) VALUES (NULL);
38 SELECT * FROM gtable;
39 doc gtext
40 {"id": 1, "name": "Omar Bras"} Omar Bras
41 {"id": 2, "name": "Omar Argentina"} Omar Argentina
42 NULL NULL
43 UPDATE gtable SET doc= '{ "id": 4, "name": "Omar Ara" }' where doc IS NULL;
44 SELECT * FROM gtable ORDER BY gtext;
45 doc gtext
46 {"id": 4, "name": "Omar Ara"} Omar Ara
47 {"id": 2, "name": "Omar Argentina"} Omar Argentina
48 {"id": 1, "name": "Omar Bras"} Omar Bras
49 UPDATE gtable SET doc= NULL WHERE JSON_EXTRACT(doc, "$.id") = 4;
50 SELECT * FROM gtable ORDER BY gtext;
51 doc gtext
52 NULL NULL
53 {"id": 2, "name": "Omar Argentina"} Omar Argentina
54 {"id": 1, "name": "Omar Bras"} Omar Bras
55 include/sync_slave_sql_with_master.inc
56 SHOW CREATE TABLE gtable;
57 Table Create Table
58 gtable CREATE TABLE `gtable` (
59 `doc` json DEFAULT NULL,
60 `gtext` text GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,_utf8mb4'$.name'))) VIRTUAL,
61 UNIQUE KEY `name_index` (`gtext`(50))
62 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
63 # Connection:slave - Row with value 3 is expected on slave.
64 SELECT * FROM gtable ORDER BY gtext;
65 doc gtext
66 NULL NULL
67 {"id": 2, "name": "Omar Argentina"} Omar Argentina
68 {"id": 1, "name": "Omar Bras"} Omar Bras
69 include/diff_tables.inc [master:gtable, slave:gtable]
70 DROP TABLE gtable;
71 include/sync_slave_sql_with_master.inc
72 DROP VIEW IF EXISTS v1,v2;
73 DROP TABLE IF EXISTS t1,t2,t3;
74 DROP PROCEDURE IF EXISTS p1;
75 DROP FUNCTION IF EXISTS f1;
76 DROP TRIGGER IF EXISTS trg1;
77 DROP TRIGGER IF EXISTS trg2;
78 set sql_warnings = 0;
79 include/rpl_end.inc