Details
-
Bug
-
Status: In Progress (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
13.1, 13.2
-
Q4/2026 Server Maintenance
Description
--source include/have_partition.inc
|
--source include/have_binlog_format_row.inc
|
--source include/master-slave.inc
|
|
|
--connection master
|
--error 0,ER_PARSE_ERROR,ER_PARTITIONS_MUST_BE_DEFINED_ERROR
|
CREATE TABLE t1 (c DATE) PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY (PARTITION p0 VALUES LESS THAN ('2026-04-30')); |
if ($mysql_errno) |
{
|
--skip Needs RANGE COLUMNS ... INTERVAL partitioning |
}
|
--sync_slave_with_master
|
# The replica applies the row events in the time zone +00:00 |
--source include/stop_slave_sql.inc
|
SET @save_time_zone= @@GLOBAL.time_zone; |
SET GLOBAL time_zone='+00:00'; |
START SLAVE SQL_THREAD;
|
--source include/wait_for_slave_sql_to_start.inc
|
|
|
--connection master
|
SET time_zone='+13:00'; |
SET timestamp= UNIX_TIMESTAMP('2026-05-03 01:00:00'); |
# 2026-05-03 is the current date in the time zone of the master session |
INSERT INTO t1 VALUES ('2026-05-03'); |
|
|
--connection slave
|
--let $i= 300
|
while ($i)
|
{
|
--let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1) |
if ($err) |
{
|
--die The replica stopped: it adds the INTERVAL partitions up to the current date in its own time zone, not in the time zone of the master session |
}
|
--let $n= query_get_value(SELECT COUNT(*) AS n FROM t1, n, 1) |
if ($n == 1) |
{
|
--let $i= 1 |
}
|
--sleep 0.1 |
--dec $i |
}
|
if ($n != 1) |
{
|
--die The row did not reach the replica within 30 seconds |
}
|
--source include/stop_slave_sql.inc
|
SET GLOBAL time_zone= @save_time_zone; |
START SLAVE SQL_THREAD;
|
--source include/wait_for_slave_sql_to_start.inc
|
|
|
--connection master
|
DROP TABLE t1; |
--source include/rpl_end.inc
|
Leads to:
|
CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Optimized, Clang 22.1.8-20260622) Build 06/10/2026 |
mysqltest: At line 42: The replica stopped: it adds the INTERVAL partitions up to the current date in its own time zone, not in the time zone of the master session
|
The replica error log:
|
CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Optimized, Clang 22.1.8-20260622) Build 06/10/2026 |
2026-10-07 10:21:06 10 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.t1; Table has no partition for value from column_list, Error_code: 1526; handler error HA_ERR_NO_PARTITION_FOUND; the event's master log master-bin.000001, end_log_pos 0, Gtid 0-1-2, Internal MariaDB error code: 1526
|
2026-10-07 10:21:06 10 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001' position 587; GTID position '0-1-1'
|
With the replica time zone set to +13:00, the row is applied. With binlog_format STATEMENT or MIXED, the row is applied too. Debug builds give the same result.
From the code it seems that, for a row event, range_interval_set_count() in sql/sql_partition_auto_interval.cc finds the current date from the event time in the time zone of the replica applier thread. On the master, the same function used the time zone of the session that ran the INSERT.
Attachments
Issue Links
- is caused by
-
MDEV-15621 Implement interval partitioning similar to Oracle
-
- Closed
-
- relates to
-
MDEV-39808 MDEV-15621: ROW-binlog + INSERT: auto-creates an interval partition & logs the row, but not the implicit ADD PARTITION
-
- Closed
-
-
MDEV-41596 Galera node leaves the cluster after an INSERT that adds INTERVAL partitions on another node
-
- Open
-