sistemazione partizioni

This commit is contained in:
cmaffio
2016-04-20 16:45:11 +02:00
parent 4e9e7e28ae
commit 8883758e0d

View File

@@ -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";