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
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:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [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 15:01:30 2024 UTC