[MDEV-25545] Auto-create: ODKU does not cause partition creation Created: 2021-04-27  Updated: 2021-05-02  Resolved: 2021-05-02

Status: Closed
Project: MariaDB Server
Component/s: Partitioning, Versioned Tables
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None
Environment:

bb-10.6-midenok-MDEV-17554


Issue Links:
Relates
relates to MDEV-17554 Auto-create history partitions for sy... Closed

 Description   

MDEV-17554 description says that INSERT... ON DUPLICATE KEY UPDATE should trigger auto-creation. It doesn't appear to be the case.

Here is a test case from versioning/partition.test, almost literal (I just added 1 second to the second timestamp, to avoid boundary issues)

--source include/have_partition.inc
 
set timestamp= unix_timestamp('2000-01-01 00:00:00');
create or replace table t1 (x int primary key) with system versioning
partition by system_time interval 1 hour auto;
insert into t1 values (1);
set timestamp= unix_timestamp('2000-01-01 01:00:01');
insert into t1 values (1) on duplicate key update x= x + 1;
show create table t1;

And just like in the test result file, the partition is not created:

bb-10.6-midenok-MDEV-17554 b96b96f9f

show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `x` int(11) NOT NULL,
  PRIMARY KEY (`x`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
 PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR STARTS TIMESTAMP'2000-01-01 00:00:00' AUTO
PARTITIONS 2

select *, row_end from t1 for system_time all;
x	row_end
1	2000-01-01 01:00:01.000000
2	2038-01-19 05:14:07.999999

I haven't found any other MTR tests for it. If it is not supposed to auto-create partition after all, then please update the description in MDEV-17554 and add a comment to the test. If it's meant to work, please add somewhat more comprehensive tests for it.


Generated at Thu Feb 08 09:38:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.