include/reset_master.inc
set TIMESTAMP= UNIX_TIMESTAMP("1970-01-21 15:32:22");
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
*** Test dumping all binlog files, including the last empty one.
FLUSH BINARY LOGS;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
use `test`/*!*/;
SET TIMESTAMP=1773142/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
/*!*/;
DELIMITER ;
DELIMITER /*!*/;
DELIMITER ;
DELIMITER /*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
INSERT INTO t1 VALUES (1, 0), (2, 0), (3, 0);
UPDATE t1 SET b=1 WHERE a=1;
DELETE FROM t1 WHERE a=2;
REPLACE INTO t1 VALUES (3, 3);
FLUSH BINARY LOGS;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
START TRANSACTION
/*!*/;
# Annotate_rows:
#Q> INSERT INTO t1 VALUES (1, 0), (2, 0), (3, 0)
COMMIT/*!*/;
START TRANSACTION
/*!*/;
# Annotate_rows:
#Q> UPDATE t1 SET b=1 WHERE a=1
COMMIT/*!*/;
START TRANSACTION
/*!*/;
# Annotate_rows:
#Q> DELETE FROM t1 WHERE a=2
COMMIT/*!*/;
START TRANSACTION
/*!*/;
# Annotate_rows:
#Q> REPLACE INTO t1 VALUES (3, 3)
COMMIT/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
*** Test dumping the last, pre-allocated, empty file.
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
SELECT * FROM t1 ORDER BY a;
a	b
1	1
3	3
SELECT * FROM t1 ORDER BY a;
a	b
SELECT * FROM t1 ORDER BY a;
a	b
1	1
3	3
SET SESSION binlog_format= MIXED;
INSERT INTO t1 SELECT a+10, 10 FROM t1;
UPDATE t1 SET b=11 WHERE a <= 12;
SELECT * FROM t1 ORDER BY a;
a	b
1	11
3	11
11	11
13	10
FLUSH BINARY LOGS;
FLUSH BINARY LOGS;
TRUNCATE t1;
SELECT * FROM t1 ORDER BY a;
a	b
1	11
3	11
11	11
13	10
DROP TABLE t1;
#
# MDEV-39582 mariadb-binlog missing sanity checks for ibb files
#
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ERROR: Invalid/unsupported page size in InnoDB binlog file, cannot read
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ERROR: Corrupt InnoDB binlog found on page 1 in binlog number 0: Invalid chunk length
ERROR: Could not read entry at offset 4: Error in log format or read error.
# End of 12.3 tests
