Many tag names are single characters, so we can use the fast string
construction. In cases where a NULL name is used we can also use the
empty string.
This avoids some allocations and some work.
The call_user_function() API redoes the zend_is_callable() check, which has been just done.
We can check validity and retrieve the FCC to call it directly rather than having a useless double check
In the past, when libmysqlclient could be used, it accepted ipv6 addresses
as hostname without enclosing it first in brackets. However, in mysqlnd
this never worked. In the past this caused a discrepancy between the two
implementations.
Nowadays, mysqli only works with mysqlnd so we don't even have to cater
to libmysqlclient. However, a plain ipv6 address should still work as a
hostname. Also for people migrating to newer PHP versions it's nice if
this keeps working.
The solution is to check if we're dealing with an ipv6 address not yet
enclosed in brackets. In that case we add the brackets automatically.
Closes GH-19750.
Avoid returning early in this function, as other checks might still be needed to
verify whether the given function can procude an error.
Fixes oss-fuzz #447521098
Closes GH-19972
On successive usage, the password is copied as much but the older
address is never freed. Thus, we are hinting a password reset to address
it.
close GH-19936
* Merge odbc_fetch_into into odbc_fetch_hash
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.
* Convert php_odbc_fetch_hash to ZPP
* Use SQLFetchScroll instead of SQLExtendedFetch
Fixes GH-19522
* Convert result type constants to an enum
* Implement odbc_fetch_row in terms of php_odbc_fetch_hash
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.
* Rename php_odbc_fetch_hash to remove _hash
Since this is a much more shared fetch function now.