From fb69e51741f8ddf2b04523cc04673f9fa707b1ea Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 11 Feb 2002 12:46:18 +0000 Subject: [PATCH] Fix bugs #515461 and #515460, limit and nextid issues. git-svn-id: file:///svn/phpbb/trunk@2084 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/db/postgres7.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phpBB/db/postgres7.php b/phpBB/db/postgres7.php index a9ae5926e5..84b26c66b9 100644 --- a/phpBB/db/postgres7.php +++ b/phpBB/db/postgres7.php @@ -123,7 +123,7 @@ class sql_db { $this->num_queries++; - $query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2, \\1", $query); + $query = preg_replace("/LIMIT ([0-9]+),([ 0-9]+)/", "LIMIT \\2 OFFSET \\1", $query); if( $transaction == BEGIN_TRANSACTION ) { @@ -342,8 +342,7 @@ class sql_db { if( preg_match("/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is", $this->last_query_text[$query_id], $tablename) ) { - $query = "SELECT last_value - FROM " . $tablename[1] . "_id_seq"; + $query = "SELECT currval('" . $tablename[1] . "_id_seq') AS last_value"; $temp_q_id = @pg_exec($this->db_connect_id, $query); if( !$temp_q_id ) {