Skip to content

ext/pdo: Fail nextRowset() when the column describer fails - #23849

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:promote/pdo-nextrowset-describe
Open

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:promote/pdo-nextrowset-describe

Conversation

@iliaal

@iliaal iliaal commented Sep 22, 2026

Copy link
Copy Markdown
Member

pdo_stmt_do_next_rowset() dropped the return value of pdo_stmt_describe_columns(), so a driver whose describer failed after the rowset advance left columns[] partially initialized while nextRowset() still reported success, and the next fetch read that incomplete state. pdo_stmt_do_execute(), do_fetch() and PDO::prepare() already check it. No test: odbc_stmt_describe() fails when SQLDescribeCol() or SQLColAttribute() does, which needs a server driven into that state, and the bundled sqlite describer only fails for a column index past its own count, which the describe loop never passes it.

pdo_stmt_do_next_rowset() dropped the return value of
pdo_stmt_describe_columns(), so a driver whose describer failed after the
rowset advance left columns[] partially initialized while nextRowset() still
reported success, and the next fetch read that incomplete state. Check the
result, as pdo_stmt_do_execute(), do_fetch() and PDO::prepare() already do.
No test: odbc_stmt_describe() fails when SQLDescribeCol() or
SQLColAttribute() does, which needs a server driven into that state, and the
bundled sqlite describer only fails for a column index past its own count,
which the describe loop never passes it.
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