-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ODBC fetch refactoring #19848
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
base: master
Are you sure you want to change the base?
ODBC fetch refactoring #19848
Conversation
ARM failure unrelated. FWIW, if this misses 8.5, I'll probably continue some further refactoring in this PR. |
Now that we can assume fetch_hash exists, there's a lot of redundancy in these functions. Merge their implementations, and smooth over the differences in how they handle returning their result set as an array.
These are also doing extremely similar jobs, but with slightly different behaviours for the return value (in this case, none, as it's tended to be used with odbc_result). Unify this too. The $row value deprecation for 0/-1 is only handled for odbc_fetch_row; it's too late to do so for PHP 8.5. Should probably unify it for PHP 8.6.
Since this is a much more shared fetch function now.
9a15b54
to
770ce9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the deprecation? As that would then be a purely refactory PR.
As for the deprecation you would need RM approval and I don't know how they feel about it being this close to RC1 and might be difficult to convince.
I changed the condition in the inner function to only trigger when it's called with the parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit title "Convert php_odbc_fetch_hash to ZPP" is misleading, as you are not converting the function to ZPP but to fast ZPP as it was already using ZPP to parse and validate arguments.
@php/release-managers-85 Your call if it's OK to get this in for RC1. |
php_odbc_fetch_into
intophp_odbc_fetch_hash
.odbc_fetch_into
is kind of weird. I don't know if it'd be better to deprecate it and have a more "symmetrical" API that works likeodbc_fetch_array
.php_odbc_fetch_hash
to use ZPP.SQLExtendedFetch
calls toSQLFetchScroll
SQLExtendedFetch
withSQLFetchScroll
in ext/odbc #19522.php_odbc_fetch_row
intophp_odbc_fetch_hash
fetch_into
, though with special $row == 0/-1 deprecation (see Make ext/odbc default value handling more consistent #13910)