|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 01:01:31 2024 UTC