[php-src] PR #23601: odbc: check SQLColAttribute return codes in the field info functions
| From: | iliaal | Date: | Sun, 06 Sep 2026 15:07:51 +0000 |
| Subject: | [php-src] PR #23601: odbc: check SQLColAttribute return codes in the field info functions | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38351@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23601
Author: iliaal
odbc_column_lengths() and odbc_field_type() ignored the
SQLColAttribute return code and returned their output buffer regardless, so a driver
that fails the call left odbc_field_len(), odbc_field_scale() and
odbc_field_type() reporting uninitialized stack. They now check the code and warn with
the driver's own SQLGetDiagRec diagnostic.
odbc_bindcols() gets the one-line zero-init of name for the same reason;
it has no way to report an error, since it runs during result setup and returns void. No test:
reaching the branch needs a driver that fails SQLColAttribute on a valid column index,
and there is no existing php-src harness for injecting that.