From 229acc5afb8545d72972fc9778ce438bb804ee84 Mon Sep 17 00:00:00 2001 From: chriskl Date: Mon, 19 May 2003 15:08:09 +0000 Subject: [PATCH] fix long standing bug in vacuum analyze. xhtml fixes. printVal run --- classes/database/Postgres.php | 28 +++++++++++------- database.php | 56 +++++++++++++++++++---------------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index a7072f8c..e96e8641 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres.php,v 1.110 2003/05/18 12:48:11 chriskl Exp $ + * $Id: Postgres.php,v 1.111 2003/05/19 15:08:09 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -2059,24 +2059,30 @@ class Postgres extends BaseDB { /** * Vacuums a database - * @param $database The database to vacuum + * @param $table (optional) The table to vacuum */ - function vacuumDB($database) { - $this->fieldClean($database); - - $sql = "VACUUM \"{$database}\""; + function vacuumDB($table = '') { + if ($table != '') { + $this->fieldClean($table); + $sql = "VACUUM \"{$table}\""; + } + else + $sql = "VACUUM"; return $this->execute($sql); } /** * Analyze a database - * @param $database The database to analyze + * @param $table (optional) The table to analyze */ - function analyzeDB($database) { - $this->fieldClean($database); - - $sql = "ANALYZE \"{$database}\""; + function analyzeDB($table = '') { + if ($table != '') { + $this->fieldClean($table); + $sql = "ANALYZE \"{$table}\""; + } + else + $sql = "ANALYZE"; return $this->execute($sql); } diff --git a/database.php b/database.php index 3fb689d2..7f07fff5 100755 --- a/database.php +++ b/database.php @@ -3,7 +3,7 @@ /** * Manage schemas within a database * - * $Id: database.php,v 1.14 2003/04/30 07:28:10 chriskl Exp $ + * $Id: database.php,v 1.15 2003/05/19 15:08:09 chriskl Exp $ */ // Include application functions @@ -22,18 +22,18 @@ switch ($action) { case 'vacuum': - $status = $localData->vacuumDB($_REQUEST['database']); + $status = $localData->vacuumDB(); if ($status == 0) doAdmin('', $lang['strvacuumgood']); else doAdmin('', $lang['strvacuumbad']); break; case 'analyze': - $status = $localData->analyzeDB($_REQUEST['database']); + $status = $localData->analyzeDB(); if ($status == 0) doAdmin('', $lang['stranalyzegood']); else doAdmin('', $lang['stranalyzebad']); break; default: $misc->printDatabaseNav(); - echo "

", htmlspecialchars($_REQUEST['database']), ": {$lang['stradmin']}

\n"; + echo "

", $misc->printVal($_REQUEST['database']), ": {$lang['stradmin']}

\n"; $misc->printMsg($msg); echo "