From 62121152e328fdb97dd811f26f196d0cdab6836d Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sun, 7 Nov 2021 12:51:14 +0100 Subject: Use pg_query() instead of pg_execute() We are not executing prepared statements with parameters here, so using pg_execute() (which expects a 3rd parameter) is not necessary. In fact, these used to be pg_exec() calls, which were incorrectly replaced by pg_execute() instead of pg_query() in commit 2223c2a1fe8ecf5b2fc07f503a280d080596dd94. Fixes #768 --- drivers/adodb-postgres64.inc.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index c819729a..746072c3 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -796,8 +796,7 @@ class ADODB_postgres64 extends ADOConnection{ if ($execp) $exsql = "EXECUTE $plan ($execp)"; else $exsql = "EXECUTE $plan"; - - $rez = @pg_execute($this->_connectionID,$exsql); + $rez = @pg_query($this->_connectionID, $exsql); if (!$rez) { # Perhaps plan does not exist? Prepare/compile plan. $params = ''; @@ -821,14 +820,14 @@ class ADODB_postgres64 extends ADOConnection{ } $s = "PREPARE $plan ($params) AS ".substr($sql,0,strlen($sql)-2); //adodb_pr($s); - $rez = pg_execute($this->_connectionID,$s); + $rez = pg_query($this->_connectionID, $s); //echo $this->ErrorMsg(); } if ($rez) - $rez = pg_execute($this->_connectionID,$exsql); + $rez = pg_query($this->_connectionID, $exsql); } else { //adodb_backtrace(); - $rez = pg_query($this->_connectionID,$sql); + $rez = pg_query($this->_connectionID, $sql); } // check if no data returned, then no need to create real recordset if ($rez && pg_num_fields($rez) <= 0) { -- cgit v1.3