diff options
| author | Robert Treat | 2019-07-20 21:04:44 +0000 |
|---|---|---|
| committer | Robert Treat | 2019-07-20 21:04:44 +0000 |
| commit | 208eff3c2840886e9a0d8e76a1f31a9e5646449f (patch) | |
| tree | b60aac010b78607eec12b7e60c290602c9eaa0db /classes/database | |
| parent | 96e7bfa8de1080f1719ab5fe25402f0d82b74821 (diff) | |
Fix bug with partial SQL execution failure.
Fix based on patches from @nirgal and @LuckySB
Reported at:
https://sourceforge.net/p/phppgadmin/bugs/448/
https://bugs.debian.org/762378
https://github.com/phppgadmin/phppgadmin/pull/27
https://github.com/phppgadmin/phppgadmin/pull/30
Diffstat (limited to 'classes/database')
| -rw-r--r-- | classes/database/Postgres.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 466db5d1..ca649ec7 100644 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -7538,12 +7538,15 @@ class Postgres extends ADODB_base { */ if (strlen($query_buf) > 0) $query_buf .= "\n"; - /* append the line to the query buffer */ - $query_buf .= $subline; + $query_buf .= $subline; + } $query_buf .= ';'; + /* is there anything in the query_buf? */ + if (trim($query_buf)) + { // Execute the query. PHP cannot execute - // empty queries, unlike libpq + // empty queries, unlike libpq $res = @pg_query($conn, $query_buf); // Call the callback function for display |
