From: Max Semenik Date: Thu, 17 Dec 2009 15:48:49 +0000 (+0000) Subject: While coding r58014, I thought that VACUUM on a 0-byte databse results in an error... X-Git-Tag: 1.31.0-rc.0~38513 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=commitdiff_plain;h=1ddb7210be9e5910b5e0c2a87f5c300455d6b1ca;p=lhc%2Fweb%2Fwiklou.git While coding r58014, I thought that VACUUM on a 0-byte databse results in an error - it doesn't --- diff --git a/maintenance/sqlite.php b/maintenance/sqlite.php index 681631ae98..46a038ceca 100644 --- a/maintenance/sqlite.php +++ b/maintenance/sqlite.php @@ -49,6 +49,9 @@ class SqliteMaintenance extends Maintenance { private function vacuum() { $prevSize = filesize( $this->db->mDatabaseFile ); + if ( $prevSize == 0 ) { + $this->error( "Can't vacuum an empty database.\n", true ); + } $this->output( 'VACUUM: ' ); if ( $this->db->query( 'VACUUM' ) ) {