From 1b405295012b4d259f318acc21b49301d62ba605 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Mon, 4 Sep 2017 13:14:47 +0000 Subject: [PATCH] dblayeroo: PgSQL crash if the LastInsertID is called on table without autoincrement field. Return 1 in this particular case git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3917 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayeroo.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dblayeroo.php b/dblayeroo.php index b420a29..995b2ca 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -2860,6 +2860,12 @@ class dblayeroo } if ($autoInc !== null) $autoInc = $this->table."_${col}_seq"; + else + { + $this->debugLog ("INSERT: PgSQL INSERT without Autoincrement. ". + "Return 1"); + return 1; + } } $this->debugLog ("INSERT: lastInsertId=", self::$instance[$this->dsn]->lastInsertId ($autoInc));