|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80150 Failure to fetch error message
Submitted: 2020-09-25 15:24 UTC Modified: 2020-09-25 15:24 UTC
From: Assigned: cmb (profile)
Status: Closed Package: ODBC related
PHP Version: 7.3.22 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
16 + 22 = ?
Subscribe to this entry?

 [2020-09-25 15:24 UTC]
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

This can nicely be confirmed with the Microsoft Access Driver
(*.mdb, *.accdb), because that driver has rather limited

Test script:
$conn = odbc_connect($dsn, $user, $pass);
var_dump($result = odbc_tables($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
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
string(5) "HY000"


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-25 15:24 UTC]
-Assigned To: +Assigned To: cmb
 [2020-09-25 15:36 UTC]
The following pull request has been associated:

Patch Name: Fix #80150: Failure to fetch error message
On GitHub:
 [2020-09-29 09:06 UTC]
Automatic comment on behalf of
Log: Fix #80150: Failure to fetch error message
 [2020-09-29 09:06 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Oct 04 06:05:54 2022 UTC