1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-29 16:59:49 +02:00

- added DibiVariable (experimental)

- fixed bug in DibiPostgreDriver::insertId()
This commit is contained in:
David Grudl
2007-11-22 10:35:23 +00:00
parent 981a1adaad
commit 3f42b2cf55
9 changed files with 75 additions and 25 deletions

View File

@@ -140,14 +140,14 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
{
if ($sequence === NULL) {
// PostgreSQL 8.1 is needed
$res = $this->query("SELECT LASTVAL() AS seq");
$has = $this->query("SELECT LASTVAL() AS seq");
} else {
$res = $this->query("SELECT CURRVAL('$sequence') AS seq");
$has = $this->query("SELECT CURRVAL('$sequence') AS seq");
}
if (is_resource($res)) {
$row = pg_fetch_assoc($res);
pg_free_result($res);
if ($has) {
$row = $this->fetch();
$this->free();
return $row['seq'];
}
@@ -277,6 +277,7 @@ class DibiPostgreDriver extends NObject implements DibiDriverInterface
public function free()
{
pg_free_result($this->resultset);
$this->resultset = NULL;
}