diff options
| author | Damien Regad <dregad@mantisbt.org> | 2021-11-07 12:51:14 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2021-11-07 12:51:14 +0100 |
| commit | 62121152e328fdb97dd811f26f196d0cdab6836d (patch) | |
| tree | f6232861ca73b152cc70edcd3791e584e4049746 | |
| parent | 851545c294b85e18eb4fa0050a33b72224a5c2ef (diff) | |
| download | adodb-62121152e328fdb97dd811f26f196d0cdab6836d.tar.gz adodb-62121152e328fdb97dd811f26f196d0cdab6836d.tar.bz2 adodb-62121152e328fdb97dd811f26f196d0cdab6836d.zip | |
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
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 9 |
1 files 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) { |
