Bug #80150 [Asn->Csd]: Failure to fetch error message
| From: | cmb@php.net | Date: | Tue, 29 Sep 2020 09:06:38 +0000 |
| Subject: | Bug #80150 [Asn->Csd]: Failure to fetch error message | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229258@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80150&edit=1
ID: 80150
Updated by: cmb@php.net
Reported by: cmb@php.net
Summary: Failure to fetch error message
-Status: Assigned
+Status: Closed
Type: Bug
Package: ODBC related
Operating System: *
PHP Version: 7.3.22
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=df5efa2fcdbcc9f6dea792caa149897060b350f7
Log: Fix #80150: Failure to fetch error message
Previous Comments:
------------------------------------------------------------------------
[2020-09-25 15:36:21] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #80150: Failure to fetch error message
On GitHub: https://github.com/php/php-src/pull/6217
Patch: https://github.com/php/php-src/pull/6217.patch
------------------------------------------------------------------------
[2020-09-25 15:24:44] cmb@php.net
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 this bug report at https://bugs.php.net/bug.php?id=80150&edit=1