1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-11065: Compressed binary log. Fix BINLOG statement.

BINLOG statement output by mysqlbinlog actually has the base64 of the
non-compressed event. So remove my previous incorrect review change,
which allowed compressed event types for BINLOG statement.

Also add a couple test cases for this, running mysqlbinlog | mysql.
This commit is contained in:
Kristian Nielsen
2016-11-03 13:37:15 +01:00
parent 3c0ff6153f
commit 56a041cde6
5 changed files with 122 additions and 10 deletions

View File

@ -408,6 +408,46 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
DROP TABLE t1,t2;
Test mysqlbinlog | mysql type point-in-time recovery with compressed events.
FLUSH BINARY LOGS;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, c VARCHAR(100));
INSERT INTO t3 VALUES (0, 10, "hello");
BEGIN;
INSERT INTO t3 VALUES (1, 10, "cat"), (2, 10, "mouse"), (3, 10, "dog");
INSERT INTO t3 VALUES (4, 10, "goodbye");
COMMIT;
UPDATE t3 SET b=b+100 where a<>1;
DELETE FROM t3 WHERE a=2;
SET @old_image=@@binlog_row_image;
SET binlog_row_image=minimal;
INSERT INTO t3 VALUES (5, 20, "red"), (6, 30, "green"), (7, 40, "blue");
INSERT INTO t3 VALUES (8, 20, "rigel");
UPDATE t3 SET c = concat("colour of ", c) WHERE a > 5;
UPDATE t3 SET b=b*2 WHERE a IN (5,6,7);
DELETE FROM t3 WHERE a=6;
SET binlog_row_image=@old_image;
SELECT * FROM t3 ORDER BY a;
a b c
0 110 hello
1 10 cat
3 110 dog
4 110 goodbye
5 40 red
7 80 colour of blue
8 20 colour of rigel
FLUSH LOGS;
DROP TABLE t3;
SELECT * FROM t3 ORDER BY a;
a b c
0 110 hello
1 10 cat
3 110 dog
4 110 goodbye
5 40 red
7 80 colour of blue
8 20 colour of rigel
DROP TABLE t1,t2,t3;
SET GLOBAL log_bin_compress=off;
SET GLOBAL log_bin_compress_min_len=256;