Skip to content

Commit

Permalink
Fix buggy method Postgres.php:beginDump() that was calling its non-ex…
Browse files Browse the repository at this point in the history
…istant (anymore) parent class
  • Loading branch information
ioguix committed Aug 26, 2010
1 parent 36c782e commit 98a01f2
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions classes/database/Postgres.php
Expand Up @@ -2329,17 +2329,36 @@ 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);
if ($status != 0) {
$this->rollbackTransaction();
return -1;
}
}

return 0;
}

/**
* Ends the data object for a dump.
Expand Down

0 comments on commit 98a01f2

Please sign in to comment.