Debian Codegraph @

mysql-test/suite/vcol/r/binlog.result

raw
1 include/master-slave.inc
2 [connection master]
3 CREATE TABLE t1 (
4 pk SERIAL,
5 vcol_date DATE AS (col_date) PERSISTENT,
6 vcol_int INT AS (col_int) VIRTUAL,
7 vcol_year YEAR AS (col_year) PERSISTENT,
8 vcol_blob BLOB AS (col_blob) VIRTUAL,
9 col_date DATE,
10 col_int INT NULL,
11 col_blob BLOB NULL,
12 col_year YEAR,
13 PRIMARY KEY(pk)
14 ) ENGINE=InnoDB;
15 INSERT INTO t1 (col_date,col_int,col_blob,col_year) VALUES ('2010-04-24',5,'foo',1981);
16 SET SQL_MODE='';
17 set binlog_row_image="FULL";
18 CREATE VIEW v1 AS SELECT * FROM t1;
19 REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1982 FROM t1;
20 Warnings:
21 Warning 1906 The value specified for generated column 'vcol_date' in table 't1' has been ignored
22 Warning 1906 The value specified for generated column 'vcol_int' in table 't1' has been ignored
23 Warning 1906 The value specified for generated column 'vcol_year' in table 't1' has been ignored
24 Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' has been ignored
25 select col_date,col_int,col_blob,col_year from v1;
26 col_date col_int col_blob col_year
27 2010-04-24 5 foo 1982
28 connection slave;
29 select col_date,col_int,col_blob,col_year from v1;
30 col_date col_int col_blob col_year
31 2010-04-24 5 foo 1982
32 connection master;
33 DROP VIEW v1;
34 set binlog_row_image="MINIMAL";
35 CREATE VIEW v1 AS SELECT * FROM t1;
36 REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1983 FROM t1;
37 Warnings:
38 Warning 1906 The value specified for generated column 'vcol_date' in table 't1' has been ignored
39 Warning 1906 The value specified for generated column 'vcol_int' in table 't1' has been ignored
40 Warning 1906 The value specified for generated column 'vcol_year' in table 't1' has been ignored
41 Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' has been ignored
42 select col_date,col_int,col_blob,col_year from v1;
43 col_date col_int col_blob col_year
44 2010-04-24 5 foo 1983
45 connection slave;
46 select col_date,col_int,col_blob,col_year from v1;
47 col_date col_int col_blob col_year
48 2010-04-24 5 foo 1983
49 connection master;
50 DROP VIEW v1;
51 set @@binlog_row_image="NOBLOB";
52 CREATE VIEW v1 AS SELECT * FROM t1;
53 REPLACE INTO v1 SELECT pk, vcol_date, vcol_int, vcol_year, vcol_blob, col_date, col_int, col_blob, 1984 FROM t1;
54 Warnings:
55 Warning 1906 The value specified for generated column 'vcol_date' in table 't1' has been ignored
56 Warning 1906 The value specified for generated column 'vcol_int' in table 't1' has been ignored
57 Warning 1906 The value specified for generated column 'vcol_year' in table 't1' has been ignored
58 Warning 1906 The value specified for generated column 'vcol_blob' in table 't1' has been ignored
59 select col_date,col_int,col_blob,col_year from v1;
60 col_date col_int col_blob col_year
61 2010-04-24 5 foo 1984
62 connection slave;
63 select col_date,col_int,col_blob,col_year from v1;
64 col_date col_int col_blob col_year
65 2010-04-24 5 foo 1984
66 connection master;
67 DROP VIEW v1;
68 set @@binlog_row_image=default;
69 DROP TABLE t1;
70 SET SQL_MODE=default;
71 CREATE TABLE t1 (pk INT, a VARCHAR(3), b VARCHAR(1) AS (a) VIRTUAL, PRIMARY KEY (pk));
72 INSERT IGNORE INTO t1 (pk, a) VALUES (1,'foo'),(2,'bar');
73 Warnings:
74 Warning 1265 Data truncated for column 'b' at row 1
75 Warning 1265 Data truncated for column 'b' at row 2
76 REPLACE INTO t1 (pk) VALUES (2);
77 ERROR 22001: Data too long for column 'b' at row 1
78 UPDATE IGNORE t1 SET a = NULL;
79 Warnings:
80 Warning 1265 Data truncated for column 'b' at row 1
81 Warning 1265 Data truncated for column 'b' at row 2
82 DROP TABLE t1;
83 #
84 # MDEV-18166 ASSERT_COLUMN_MARKED_FOR_READ failed on tables with vcols
85 #
86 SET SESSION binlog_row_image= noblob;
87 CREATE TEMPORARY TABLE t1 SELECT UUID();
88 show create table t1;
89 Table Create Table
90 t1 CREATE TEMPORARY TABLE `t1` (
91 `UUID()` uuid NOT NULL
92 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
93 CREATE TABLE t2 (a INT PRIMARY KEY, b TEXT, c INT GENERATED ALWAYS AS(b));
94 INSERT INTO t2 (a,b) VALUES (1,1);
95 SET SESSION binlog_row_image= default;
96 DROP TABLE t2;
97 include/rpl_end.inc