|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77591 db2_autocommit() expects boolean, but DB2_AUTOCOMMIT_ON/OFF are of type int
Submitted: 2019-02-09 02:32 UTC Modified: 2021-07-28 15:27 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bugs dot php dot net at majkl578 dot cz Assigned: cmb (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 7.3.2 OS:
Private report: No CVE-ID: None
 [2019-02-09 02:32 UTC] bugs dot php dot net at majkl578 dot cz
Documentation suggests to use db2_autocommit() with either DB2_AUTOCOMMIT_OFF or DB2_AUTOCOMMIT_ON constant. However the function expects 2nd argument of type bool while the constants are of type int.

This produces a TypeError in declare(strict_types=1) mode.

Test script:


$c = db2_connect('xxx', 'xxx', 'xxx');

db2_autocommit($c, DB2_AUTOCOMMIT_OFF);

Expected result:
No error - DB2_AUTOCOMMIT_OFF/DB2_AUTOCOMMIT_ON should be accepted.

Actual result:
TypeError: db2_autocommit() expects parameter 2 to be boolean, integer given


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-19 23:13 UTC]
The following pull request has been associated:

Patch Name: Make SQL_AUTOCOMMIT_ON and SQL_AUTOCOMMIT_OFF boolean types
On GitHub:
 [2019-05-08 09:55 UTC]
   thanks for bringing this issue into our notice. We will consider this issue when we release the next version. For now, is it possible to use boolean values ? true and false
 [2021-07-28 15:27 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-07-28 15:27 UTC]
The pull request has been merged long ago, so this issue should be
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 01:03:39 2021 UTC