Skip to content

Conversation

NattyNarwhal
Copy link
Member

@NattyNarwhal NattyNarwhal commented Sep 15, 2025

  • Merge php_odbc_fetch_into into php_odbc_fetch_hash.
    • The implementation was nearly identical, so refactor into a common implementation with some differences in how the result set array is returned.
    • 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 like odbc_fetch_array.
  • Converts php_odbc_fetch_hash to use ZPP.
    • Opportunistic since I was there anyways.
  • Convert SQLExtendedFetch calls to SQLFetchScroll
  • Convert result type constants to an enum
  • Merge php_odbc_fetch_row into php_odbc_fetch_hash

@NattyNarwhal NattyNarwhal marked this pull request as ready for review September 15, 2025 20:17
@NattyNarwhal
Copy link
Member Author

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.
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.

Replace SQLExtendedFetch with SQLFetchScroll in ext/odbc
1 participant