Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
11.8, 12.3, 13.1
-
None
Description
row_end equal to 2038-01-19 03:14:07.999999 is also the pre-11.5 marker for current rows, so is_max() takes a real history row for a current one. The row goes to the current partition instead of a history partition. Queries return the right rows and CHECK TABLE is OK; the row is just in the wrong partition. Code that looks for history with is_max() (for example ALTER ... INTERVAL ... AUTO from MDEV-25529) does not see it.
Not reproducible on 10.11 and 11.4: set timestamp truncates the fractional part there (warning 1292), so row_end never equals the marker.
--source include/have_innodb.inc
|
--source include/have_partition.inc
|
create table t1 (a int) engine=innodb with system versioning |
partition by system_time interval 1 year starts '2037-01-01 00:00:00' |
(partition p0 history, partition p1 history, partition pn current); |
set timestamp=unix_timestamp('2037-06-01 00:00:00'); |
insert into t1 values (1); |
set timestamp=2147483647.999999; |
delete from t1; |
--echo # BUG if the row is in pn
|
select partition_name, table_rows from information_schema.partitions where table_name='t1'; |
drop table t1; |
 |
--echo # control: one microsecond earlier goes to p1
|
create table t1 (a int) engine=innodb with system versioning |
partition by system_time interval 1 year starts '2037-01-01 00:00:00' |
(partition p0 history, partition p1 history, partition pn current); |
set timestamp=unix_timestamp('2037-06-01 00:00:00'); |
insert into t1 values (1); |
set timestamp=2147483647.999998; |
delete from t1; |
select partition_name, table_rows from information_schema.partitions where table_name='t1'; |
drop table t1; |
11.8.10-MariaDB-asan-debug source revision: 118b60144d9a02ba7c035e882388b3965ef39d3c
|
# BUG if the row is in pn
|
select partition_name, table_rows from information_schema.partitions where table_name='t1';
|
partition_name table_rows
|
p0 0
|
p1 0
|
pn 1
|
# control: one microsecond earlier goes to p1
|
select partition_name, table_rows from information_schema.partitions where table_name='t1';
|
partition_name table_rows
|
p0 0
|
p1 1
|
pn 0
|
Attachments
Issue Links
- relates to
-
MDEV-25529 Auto-create: Pre-existing historical data is not partitioned as specified by ALTER
-
- In Testing
-
-
MDEV-42176 Assertion `max_ts.cmp(Timestamp(0, 0)) == 0' failed in prep_alter_part_table() on ALTER ... INTERVAL ... AUTO when the only history row has row_end within the first second of 1970
-
- Confirmed
-