[php-src] PR #13910: Make ext/odbc default value handling more consistent
| From: | kocsismate | Date: | Sun, 07 Apr 2024 20:22:35 +0000 |
| Subject: | [php-src] PR #13910: Make ext/odbc default value handling more consistent | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25665@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13910
Author: kocsismate
These changes are carved off from https://github.com/php/php-src/pull/12040/files.
I noticed that there are some inconsistencies between
odbc_fetch_object()/odbc_fetch_array(), odbc_fetch_into(), as
well as odbc_fetch_row(), specifically in how they handle the $row
parameter.
Now, I tried to align their behaviour the following way:
- I made null the default value. Previously, the default values were one of the
following: -1, 0, or null...
- I made the 0 value behave the same way as the default. Previously,
odbc_fetch_row() returned a false return value indicating there is no more
rows when 0 was passed, but the rest of the functions returned the next available row
instead. This change causes a slight BC break for odbc_fetch_row() though...
- When HAVE_SQL_EXTENDED_FETCH is not defined, the $row parameter is
always ignored. Previously, some of the functions didn't accept it at all. I think this
behavior was not ideal, it would be better to emit a warning or even better, a specific
ValueError if the feature is not supported, but the parameter has any value but the
default one (null). I can add this error if we can agree on it.