Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
13.1, 13.2
-
None
Description
--source include/have_partition.inc
|
 |
# In the MET time zone, the clocks go from 02:00 to 03:00 on 2026-03-29 |
SET time_zone='MET'; |
SET timestamp= UNIX_TIMESTAMP('2026-03-29 06:00:00'); |
--error 0,ER_PARSE_ERROR,ER_PARTITIONS_MUST_BE_DEFINED_ERROR,ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
|
CREATE TABLE t1 (ts TIMESTAMP) PARTITION BY RANGE COLUMNS (ts) INTERVAL 1 HOUR (PARTITION p0 VALUES LESS THAN ('2026-03-29 00:00:00')); |
if ($mysql_errno) |
{
|
--skip Needs RANGE COLUMNS ... INTERVAL partitioning |
}
|
# The row fits p0. The INSERT adds the partitions up to the current time |
--error 0,ER_RANGE_NOT_INCREASING_ERROR
|
INSERT INTO t1 VALUES ('2026-03-28 23:00:00'); |
if ($mysql_errno) |
{
|
--die An INSERT into a TIMESTAMP column with INTERVAL 1 HOUR partitioning fails when the new partitions cross the change to daylight saving time |
}
|
DROP TABLE t1; |
Leads to:
|
CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Debug, Clang 22.1.8-20260622) Build 06/10/2026 |
mysqltest: At line 17: An INSERT into a TIMESTAMP column with INTERVAL 1 HOUR partitioning fails when the new partitions cross the change to daylight saving time
|
The INSERT fails with ERROR 1493 (HY000): VALUES LESS THAN value must be strictly increasing for each partition and no row is added. Every later INSERT into t1 fails the same way, also with the current time set two weeks later, until a partition past the change is added with ALTER TABLE t1 ADD PARTITION. INTERVAL 30 MINUTE fails the same way. A DATETIME column, the time zone +01:00 and the change back to standard time in October work. Optimized builds give the same result.
In MET, UNIX_TIMESTAMP() gives the same value for 2026-03-29 02:00:00, 2026-03-29 02:30:00 and 2026-03-29 03:00:00. From the code it seems that check_range_interval_constants() in sql/sql_partition_auto_interval.cc adds the interval to the bound in local time and then stores each bound in the TIMESTAMP column in the session time zone, so two new partitions get the same bound.
Attachments
Issue Links
- is caused by
-
MDEV-15621 Implement interval partitioning similar to Oracle
-
- Closed
-