File: binlog_functional_index.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (62 lines) | stat: -rw-r--r-- 1,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--source include/have_grep.inc

--echo # Check that the hidden generated column is not included in the binlog
--echo # regardless of binlog_row_image

# Clear the binlog
RESET MASTER;

SET @start_row_image_value = @@session.binlog_row_image;

CREATE TABLE t1 (col1 INT, col2 INT NOT NULL, col3 INT, col4 INT, UNIQUE INDEX ((ABS(col2))));
SET @@session.binlog_row_image = MINIMAL;
INSERT INTO t1 VALUES (1, 2, 3, 4), (2, 3, 4, 5);
UPDATE t1 SET col1 = 2 WHERE ABS(col2) = 2;
SET @@session.binlog_row_image = FULL;
INSERT INTO t1 VALUES (10, 20, 30, 40), (20, 30, 40, 50);
UPDATE t1 SET col1 = 20 WHERE ABS(col2) = 20;
SET @@session.binlog_row_image = NOBLOB;
INSERT INTO t1 VALUES (100, 200, 300, 400), (200, 300, 400, 500);
UPDATE t1 SET col1 = 200 WHERE ABS(col2) = 200;
DROP TABLE t1;

FLUSH LOGS;

--let $datadir = `SELECT @@GLOBAL.DATADIR`
--let $mysqlbinlog_only_decoded_rows = 1
--let $mysqlbinlog_parameters = $datadir/binlog.000001
--source include/mysqlbinlog.inc

# Clear the binlog
RESET MASTER;

--echo # Check that when the only unique NOT NULL index is a functional index,
--echo # the binary log contains a full before-image regardless of
--echo # binlog_row_image.
CREATE TABLE t1 (
  col1 INT NOT NULL
, col2 INT NOT NULL
, col3 INT NOT NULL
, UNIQUE INDEX idx1 ((ABS(col1))));
INSERT INTO t1 VALUES (1, 1, 1);

SET binlog_row_image = MINIMAL;
UPDATE t1 SET col2 = 2 WHERE ABS(col1) = 1;

SET binlog_row_image = FULL;
UPDATE t1 SET col2 = 3 WHERE ABS(col1) = 1;

SET binlog_row_image = NOBLOB;
UPDATE t1 SET col2 = 4 WHERE ABS(col1) = 1;

DROP TABLE t1;
FLUSH LOGS;

SET @@session.binlog_row_image = @start_row_image_value;

--let $datadir = `SELECT @@GLOBAL.DATADIR`
--let $mysqlbinlog_only_decoded_rows = 1
--let $mysqlbinlog_parameters = $datadir/binlog.000001
--source include/mysqlbinlog.inc