Menu

#127 [PHP]Connect will success when passing a error passwd to cubrid_pconnect() method

open
nobody
None
5
2012-03-15
2012-03-15
Jira Trac
No

Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
OS: Linux 64
Description:
First:
Connection succeeds using [cubrid_pconnect|http://www.php.net/manual/en/function.cubrid-pconnect.php] method and passing five correct value to this method.
Second:
Passing a error passwd to cubrid_pconnect method, connection will success too.

Repro steps:
1. execute: php pconnectest1.phpt
statements in pconnectest1.phpt
{noformat}
$host = localhost;
$port = 33113;
$db = demodb;
$user = dba;
$passwd = ;
if (!($pconn1 = cubrid_pconnect($host, $port, $db, $user, $passwd))) {
printf([001] Can not connect to the server using host=%s, port=%s, user=%s, passwd=***\n, $host, $port, $user);
}else{
printf([001]pconn values: %s \n,$pconn1);
}

$pconn4 = cubrid_pconnect($host, $port, $db,dba,dioado);
if (FALSE == $pconn4) {
printf([004]Expect: return value false, [%d] [%s]\n, cubrid_error_code(), cubrid_error_msg());
}elseif(TRUE == $pconn4){
printf([004]No Expect: return value true, [%d] [%s]\n, cubrid_error_code(), cubrid_error_msg());
printf([004]pconn: %s\n,$pconn4);
}else{
printf([004]no true and no fal
{noformat}

Actual result:
{noformat}
[001]pconn values: Resource id #4
[004]No Expect: return value true, [0] []
[004]pconn: Resource id #5
{noformat}

Expect result:
Maybe connection will fail when passing a error passwd to cubrid_pconnect() method.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.