Module: sip-router
Branch: adubovikov/homer
Commit: 71ea0f261d080b623872304264198ea65d6033c8
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71ea0f2…
Author: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Date: Thu Sep 22 15:41:02 2011 +0200
modules/sipcapture: fix mysql MAXVALUE error.
Thanks Dorn B. <djbinter(a)gmail.com> for report and fix.
---
modules/sipcapture/examples/partrotate_todays.pl | 5 +++--
.../examples/partrotate_unixtimestamp.pl | 6 ++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/sipcapture/examples/partrotate_todays.pl
b/modules/sipcapture/examples/partrotate_todays.pl
index f9e9059..2469a7c 100644
--- a/modules/sipcapture/examples/partrotate_todays.pl
+++ b/modules/sipcapture/examples/partrotate_todays.pl
@@ -74,8 +74,9 @@ for(my $i=0; $i<$newparts; $i++) {
if(!$exist) {
- $query = "ALTER TABLE ".$table." ADD PARTITION (PARTITION
".$newpartname
- ."\n VALUES LESS THAN (".$curtodays.") ENGINE =
MyISAM)";
+ $query = "ALTER TABLE ".$table." REORGANIZE PARTITION pmax INTO
(PARTITION ".$newpartname
+ ."\n VALUES LESS THAN (".$curtodays.") ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM)";
+
$db->do($query);
if (!$db->{Executed}) {
print "Couldn't add partition: $newpartname\n";
diff --git a/modules/sipcapture/examples/partrotate_unixtimestamp.pl
b/modules/sipcapture/examples/partrotate_unixtimestamp.pl
index 40d36a4..b9e221e 100644
--- a/modules/sipcapture/examples/partrotate_unixtimestamp.pl
+++ b/modules/sipcapture/examples/partrotate_unixtimestamp.pl
@@ -83,8 +83,10 @@ for(my $i=0; $i<$newparts; $i++) {
if(!$exist) {
- $query = "ALTER TABLE ".$table." ADD PARTITION (PARTITION
".$newpartname
- ."\n VALUES LESS THAN (".$curtstamp.") ENGINE =
MyISAM)";
+ # Fix MAXVALUE. Thanks Dorn B. <djbinter(a)gmail.com> for report and fix.
+ $query = "ALTER TABLE ".$table." REORGANIZE PARTITION pmax INTO
(PARTITION ".$newpartname
+ ."\n VALUES LESS THAN (".$curtstamp.") ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM)";
+
$db->do($query);
if (!$db->{Executed}) {
print "Couldn't add partition: $newpartname\n";