You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common idiom on IBM i is to use *LOCAL without a username and a password to establish a connection running with the same profile as the process. However, the ADOdb Db2 driver mandates that one must be set.
Environment
ADOdb version: 5.22.7
Driver or Module: Db2
Database type and version: Db2
PHP version: PHP 8.3.7
Platform: IBM i 7.5
I have tested that the problem is reproducible in the latest release / master branch / latest hotfix branch ⚠️ Keep only the applicable option(s), i.e. where you actually tested, and remove the others
It doesn't seem to handle this very well, continuing on even though connect returned false and getting to a point where it uses false instead of the connection resource.
PHP Fatal error: Uncaught TypeError: db2_set_option(): Argument #1 ($resource) must be of type resource, false given in /home/calvin/adodbtest/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php:1591
Stack trace:
#0 /home/calvin/adodbtest/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php(1591): db2_set_option()
#1 /home/calvin/adodbtest/vendor/adodb/adodb-php/adodb-lib.inc.php(1236): ADODB_db2->_query()
#2 /home/calvin/adodbtest/vendor/adodb/adodb-php/adodb.inc.php(1611): _adodb_debug_execute()
#3 /home/calvin/adodbtest/vendor/adodb/adodb-php/adodb.inc.php(1590): ADOConnection->_Execute()
#4 /home/calvin/adodbtest/vendor/adodb/adodb-php/adodb.inc.php(2294): ADOConnection->Execute()
#5 /home/calvin/adodbtest/vendor/adodb/adodb-php/adodb.inc.php(2087): ADOConnection->GetArray()
#6 /home/calvin/adodbtest/index.php(21): ADOConnection->GetAll()
#7 {main}
thrown in /home/calvin/adodbtest/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php on line 1591
Expected behavior
That it would connect fine.
Additional context
It appears it's because of this block in unpackParameters:
if ($useCataloguedConnection
&& (!$argDatabasename
|| !$argUsername
|| !$argPassword))
{
$errorMessage = 'For catalogued connections, provide ';
$errorMessage.= 'database, username and password';
$this->_errorMsg = $errorMessage;
if ($this->debug)
ADOConnection::outp($errorMessage);
returnnull;
}
This was introduced in the rewrite of this driver in 5.21.
The text was updated successfully, but these errors were encountered:
Same comment as #1032...
I'm sorry but I have zero knowledge of Db2, and no access to an instance of it for testing either, so I won't be able to help you much. Maybe @mnewnham will care to reply.
It doesn't seem to handle this very well, continuing on even though connect returned false
The error stack trace you provided is the result of calling getAll() on a failed connection. It is your responsibility to check connect()'s return value and take appropriate action (e.g. exit program) or use exceptions.
It appears it's because of this block in unpackParameters:
(snip)
This was introduced in the rewrite of this driver in 5.21.
Description
A common idiom on IBM i is to use
*LOCAL
without a username and a password to establish a connection running with the same profile as the process. However, the ADOdb Db2 driver mandates that one must be set.Environment
Steps to reproduce
It doesn't seem to handle this very well, continuing on even though
connect
returned false and getting to a point where it usesfalse
instead of the connection resource.Expected behavior
That it would connect fine.
Additional context
It appears it's because of this block in
unpackParameters
:This was introduced in the rewrite of this driver in 5.21.
The text was updated successfully, but these errors were encountered: