[MDEV-25479] Auto-create: 2nd and further executions of PS or SP fail to create partition Created: 2021-04-21  Updated: 2021-04-22  Resolved: 2021-04-22

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

Type: Bug Priority: Major
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   

First execution of PS can auto-create partition fine (if it's needed). But the 2nd execution cannot.

--source include/have_partition.inc
 
create table t (a int) with system versioning
  partition by system_time interval 1 hour auto;
 
insert into t values (1),(2);
prepare stmt from "update t set a = a + 1";
set @@timestamp= @@timestamp+3601;
execute stmt;
set @@timestamp= @@timestamp+3601;
execute stmt;
 
# Cleanup
drop table t;

bb-10.6-midenok-MDEV-17554 edbc73ac4

prepare stmt from "update t set a = a + 1";
set @@timestamp= @@timestamp+3601;
execute stmt;
set @@timestamp= @@timestamp+3601;
execute stmt;
Warnings:
Warning	4114	Versioned table `test`.`t`: last HISTORY partition (`p1`) is out of INTERVAL, need more HISTORY partitions

Same with stored procedures.


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