From f0cc0a02460bc60e197fe26dedbe1c5f0033cdc3 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 10 Dec 2012 17:21:41 +0000 Subject: [PATCH] use a different calculation to determine initial partition --- db_scripts/diff/11722_not_replicated.up | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_scripts/diff/11722_not_replicated.up b/db_scripts/diff/11722_not_replicated.up index a68422bb..2821d966 100644 --- a/db_scripts/diff/11722_not_replicated.up +++ b/db_scripts/diff/11722_not_replicated.up @@ -1,6 +1,6 @@ use sipstats; alter table statistics remove partitioning; -set @stm = concat('alter table statistics partition by range (floor(timestamp)) (partition p_old values less than (', unix_timestamp() + 600, '))'); +set @stm = concat('alter table statistics partition by range (floor(timestamp)) (partition p_old values less than (', coalesce((select floor(max(timestamp)) from statistics), 0) + 600, '))'); prepare st from @stm; execute st; deallocate prepare st;