-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix #69592: pdo_dblib now skips datasets without columns while fetching data #1758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Some sql-statements can return empty resultsets, now pdo_dblib skips empty datasets like ext/mssql.
I like this change, but there's probably code in the wild that relies on this (admittedly broken) behavior. It would make for smoother PHP upgrades if this was an opt-in behavior, via a driver attribute or whatever. |
@adambaratz, several versions ago "code in the wild" cannot be relies on "that", because call of nextResult causes segfault (see PR #1386). This behaviour copied from ext/mssql(dblib). |
I haven't dug into the code enough to understand why, but the segfaults weren't a consistent issue. My company has a fair bit of code that expects empty rowsets. Would it be hard to add a boolean attribute to control this? It could be deprecated after a few minor revisions, but it would make it possible to transition out of this behavior instead of causing code to break when you upgrade PHP. |
@adambaratz can you show testcase with code that expects empty rowset(s) ? P.S. - a "empty rowset" i mean dataset without columns, not rows... |
The gist would be to change your example like this:
|
@adambaratz ok, i will try to add this functional optional by default, last question (programmer's main problem) - name for this pdo-attribute ? |
It seems like the convention for driver-specific attrs is PDO::[DRIVER]ATTR[name]. I think PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS would be fine. |
… for skip rowsets without columns
Is there a 7.0 compatible patch for this issue? Thanks. |
Since this targets a security fix only branch, and since the author seems to have abandoned working on it (or responding to questions/comments), I'm closing this PR. Please take this action as (more) encouragement to open a PR against a supported branch. |
Some sql-statements can return empty resultsets, now pdo_dblib skips empty datasets like ext/mssql.