From 8883758e0d985c55a0e298b63a33721ea4945da1 Mon Sep 17 00:00:00 2001 From: cmaffio Date: Wed, 20 Apr 2016 16:45:11 +0200 Subject: [PATCH] sistemazione partizioni --- script/partitioning.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script/partitioning.pl b/script/partitioning.pl index 51773ed..be14d46 100755 --- a/script/partitioning.pl +++ b/script/partitioning.pl @@ -103,11 +103,12 @@ sub aggiorna { my $ultimo = ""; foreach $riga (@risp) { - if ($riga =~ /^[\(\s]?PARTITION p(\d+) VALUES LESS THAN \(\'(\S+) (\S+)\'\) .*$/) { + if ($riga =~ /^[\(\s]?PARTITION p(\d+) VALUES LESS THAN \((\d+)'\) .*$/) { next if ($1 eq '19700101'); - $ultimo = $2; - my $diff = diffgg ($2); + my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($2); + $ultimo = $year+1900."-".$mon+1."-".$mday; + my $diff = diffgg ($ultimo); if ($diff > 365) { my $query = "ALTER TABLE $tabella DROP PARTITION p$1";