-
Couldn't load subscription status.
- Fork 8k
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
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. |
Sorry, didn't see this in time and 8.5 has branched, so I guess it is now moot |
|
No problem, I think I might merge into master then if it looks good. It's possible to backport into the RCs if you want it in there anyways. |
|
If this is just refactoring we shouldn't backport |
|
It does replace the use of a deprecated ODBC function, but that's probably not enough for a backport. |
|
Merging into 8.6/master since this missed 8.5. |
php_odbc_fetch_intointophp_odbc_fetch_hash.odbc_fetch_intois 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_hashto use ZPP.SQLExtendedFetchcalls toSQLFetchScrollSQLExtendedFetchwithSQLFetchScrollin ext/odbc #19522.php_odbc_fetch_rowintophp_odbc_fetch_hashfetch_into, though with special $row == 0/-1 deprecation (see Make ext/odbc default value handling more consistent #13910)