From 7c47d95403d8ff9a93848a6ad9de9dcedca84bde Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 5 Jun 2010 20:30:34 +0000 Subject: [PATCH] should really fix bug commiting between each table upgrade, arg, RT#8580 --- FS/FS/Upgrade.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index a33c510b4..8597b9d6b 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -42,6 +42,10 @@ sub upgrade { my $data = upgrade_data(%opt); + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + local $FS::UID::AutoCommit = 0; + foreach my $table ( keys %$data ) { my $class = "FS::$table"; @@ -53,13 +57,10 @@ sub upgrade { my $start = time; - my $oldAutoCommit = $FS::UID::AutoCommit; - local $FS::UID::AutoCommit = 0; - local $FS::UID::AutoCommit = 0; - $class->_upgrade_data(%opt); if ( $oldAutoCommit ) { + warn " committing"; dbh->commit or die dbh->errstr; } -- 2.11.0