[sr-dev] git:adubovikov/homer: modules/sipcapture: fix mysql MAXVALUE error.

Alexandr Dubovikov alexandr.dubovikov at gmail.com
Thu Sep 22 15:41:57 CEST 2011


Module: sip-router
Branch: adubovikov/homer
Commit: 71ea0f261d080b623872304264198ea65d6033c8
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71ea0f261d080b623872304264198ea65d6033c8

Author: Alexandr Dubovikov <alexandr.dubovikov at gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov at gmail.com>
Date:   Thu Sep 22 15:41:02 2011 +0200

modules/sipcapture: fix mysql MAXVALUE error.

Thanks Dorn B. <djbinter at 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 at 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";




More information about the sr-dev mailing list