Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/main/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 1 kB image not shown  

Quelle  partition_range_interval_binlog.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[120] ABAP[76] Masm[64]} [Methode: maximale Elemente, drei Dimensionen]

--source include/have_partition.inc
--source include/have_innodb.inc
--source include/have_binlog_format_row.inc

--echo #
--echo # MDEV-39808 MDEV-15621: ROW-binlog + INSERT: auto-creates an interval partition & logs the row, but not the implicit ADD PARTITION
--echo #

--echo # same server

SET timestamp= UNIX_TIMESTAMP('2026-05-10 00:00:00');
CREATE TABLE t1 (c DATE) ENGINE=InnoDB
PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY
(PARTITION p0 VALUES LESS THAN ('2026-05-05'));
RESET MASTER;  # Clear the binlog so only the INSERT is captured
INSERT INTO t1 VALUES ('2026-05-08');
--let $binlog=query_get_value(SHOW MASTER STATUS, File, 1)

set statement sql_log_bin=0 for
DROP TABLE t1;
set statement sql_log_bin=0 for
CREATE TABLE t1 (c DATE) ENGINE=InnoDB
PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY
(PARTITION p0 VALUES LESS THAN ('2026-05-05'));
--let $datadir= `SELECT @@datadir`
--exec $MYSQL_BINLOG $datadir/$binlog 2>&1 | $MYSQL test

SELECT * FROM t1;
select partition_name, partition_method, partition_expression, partition_description, table_rows from information_schema.partitions where table_name='t1';
DROP TABLE t1;

--echo # master-slave

--source include/master-slave.inc

SET timestamp= UNIX_TIMESTAMP('2026-05-10 00:00:00');
CREATE TABLE t1 (c DATE) ENGINE=InnoDB
PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY
(PARTITION p0 VALUES LESS THAN ('2026-05-05'));
INSERT INTO t1 VALUES ('2026-05-08');

--sync_slave_with_master
SELECT * FROM t1;
select partition_name, partition_method, partition_expression, partition_description, table_rows from information_schema.partitions where table_name='t1';
drop table t1;

--connection master
drop table t1;
--source include/rpl_end.inc

[Dauer der Verarbeitung: 0.18 Sekunden, vorverarbeitet 2026-10-08]