From 98a01f2adf165412020ac0f892d4e38bbf026e10 Mon Sep 17 00:00:00 2001 From: ioguix Date: Thu, 26 Aug 2010 23:56:44 +0200 Subject: [PATCH] Fix buggy method Postgres.php:beginDump() that was calling its non-existant (anymore) parent class --- classes/database/Postgres.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index db263484e..430717b22 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -2329,9 +2329,26 @@ function dropColumnDefault($table, $column) { * @return 0 success */ function beginDump() { - $status = parent::beginDump(); - if ($status != 0) return $status; + // Begin serializable transaction (to dump consistent data) + $status = $this->beginTransaction(); + if ($status != 0) return -1; + // Set serializable + $sql = "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"; + $status = $this->execute($sql); + if ($status != 0) { + $this->rollbackTransaction(); + return -1; + } + + // Set datestyle to ISO + $sql = "SET DATESTYLE = ISO"; + $status = $this->execute($sql); + if ($status != 0) { + $this->rollbackTransaction(); + return -1; + } + // Set extra_float_digits to 2 $sql = "SET extra_float_digits TO 2"; $status = $this->execute($sql); @@ -2339,7 +2356,9 @@ function beginDump() { $this->rollbackTransaction(); return -1; } - } + + return 0; + } /** * Ends the data object for a dump.