Bug #80150 [NEW]: Failure to fetch error message

From: Date: Fri, 25 Sep 2020 15:24:44 +0000
Subject: Bug #80150 [NEW]: Failure to fetch error message
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229216@lists.php.net to get a copy of this message
From: cmb Operating system: * PHP version: 7.3.22 Package: ODBC related Bug Type: Bug Bug description:Failure to fetch error message Description: ------------ In case of failure, several ODBC functions, e.g. odbc_tables() and odbc_columns(), fail to fetch the error message. The problem is that odbc_sql_error() is called with SQL_NULL_HSTMT, although the respective statement caused the error, and has appropriate error information. This can nicely be confirmed with the Microsoft Access Driver (*.mdb, *.accdb), because that driver has rather limited capabilities. Test script: --------------- <?php $conn = odbc_connect($dsn, $user, $pass); var_dump($result = odbc_tables($conn, '', '', '', '')); var_dump(odbc_error($conn)); ?> Expected result: ---------------- Warning: odbc_tables(): SQL error: [Microsoft][ODBC-Treiber fr Microsoft Access]Optionales Feature wurde nicht implementiert. , SQL state S1C00 in SQLTables in %s on line %d bool(false) string(5) "S1C00" Actual result: -------------- Warning: odbc_tables(): SQL error: Failed to fetch error message, SQL state HY000 in SQLTables in %s on line %d bool(false) string(5) "HY000" -- Edit bug report at https://bugs.php.net/bug.php?id=80150&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80150&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80150&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80150&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80150&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80150&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80150&r=support Expected behavior: https://bugs.php.net/fix.php?id=80150&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80150&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80150&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80150&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80150&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80150&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80150&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80150&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80150&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80150&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80150&r=mysqlcfg

« previous php.bugs (#229216) next »