Skip to content

ext/pdo_pgsql: Fix PDO::CURSOR_SCROLL statements failing under lazy fetching - #23471

Open
KentarouTakeda wants to merge 1 commit into
php:PHP-8.5from
KentarouTakeda:fix-pdo-pgsql-cursor-lazy-fetch
Open

ext/pdo_pgsql: Fix PDO::CURSOR_SCROLL statements failing under lazy fetching#23471
KentarouTakeda wants to merge 1 commit into
php:PHP-8.5from
KentarouTakeda:fix-pdo-pgsql-cursor-lazy-fetch

Conversation

@KentarouTakeda

Copy link
Copy Markdown
Contributor

A statement prepared with PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL and lazy fetching (PDO::ATTR_PREFETCH => 0) fails at execute() with SQLSTATE[HY000]: General error: 7 and no message. Either option alone works.

A cursor does not stream its result, but S->is_unbuffered stays set, so execute() calls PQgetResult() with nothing in flight. The fix clears the flag when the statement has a cursor.

The test is David Carlier's, from #23210.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant