From cb97fd309790330bced04091fac46ea1466283c9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 29 Jun 2018 18:34:53 +0200 Subject: Fixed bug #76548 pg_fetch_result did not fetch the next row --- ext/pgsql/pgsql.c | 1 + ext/pgsql/tests/bug76548.phpt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ext/pgsql/tests/bug76548.phpt (limited to 'ext/pgsql') diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 904b9aa3bf..6da01d448b 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2669,6 +2669,7 @@ PHP_FUNCTION(pg_fetch_result) if (pgsql_row >= PQntuples(pgsql_result)) { RETURN_FALSE; } + pg_result->row++; } else { if (row < 0 || row >= PQntuples(pgsql_result)) { php_error_docref(NULL, E_WARNING, "Unable to jump to row " ZEND_LONG_FMT " on PostgreSQL result index " ZEND_LONG_FMT, diff --git a/ext/pgsql/tests/bug76548.phpt b/ext/pgsql/tests/bug76548.phpt new file mode 100644 index 0000000000..3a0b8922e1 --- /dev/null +++ b/ext/pgsql/tests/bug76548.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #76548 pg_fetch_result did not fetch the next row +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECTF-- +string(1) "1" +string(1) "2" +string(1) "3" +==DONE== -- cgit v1.2.1