php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81535 db2_conn_error() returns an empty value after a connectoin failure
Submitted: 2021-10-18 06:47 UTC Modified: -
From: morozov at tut dot by Assigned:
Status: Open Package: ibm_db2 (PECL)
PHP Version: 8.0.11 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-10-18 06:47 UTC] morozov at tut dot by
Description:
------------
The db2_conn_error() returns an empty value after a connection failure, although according to the documentation[1] it should be non-empty. Usually, an empty SQLSTATE is 00000.

[1] https://php.net/db2_conn_error

Test script:
---------------
$conn = db2_connect('badname', 'baduser', 'badpassword');

if (!$conn) {
    var_dump(db2_conn_error());
}


Expected result:
----------------
string(5) "08001"

Actual result:
--------------
string(5) "     "

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC