Menu

#123 [PHP]Return value is true when passing two parameters to cubrid_set_autocommit method and the second parameter is not correct

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

Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
OS: Linux 64
Description:
Passing two parameters to cubrid_set_autocommit method and the second parameter value is not correct, the return value is true.
Maybe the return value is false.

Description in [cubrid_set_autocommit |http://www.php.net/manual/en/function.cubrid-set-autocommit.php]
Return Values
TRUE, when process is successful.
FALSE, when process is unsuccessful.

When passing one parameter to cubrid_set_autocommit method, return value is false.

Repro steps:
1. execute: php autocommit_test.phpt
statements in autocommit_test.phpt
{noformat}
$conn = cubrid_connect(localhost, 33113, demodb,dba,);
$set1=cubrid_set_autocommit($conn,CUBRID_AUTOCOMMIT_TRUEEE);
if(FALSE == $set1){
printf([001]Expect false, [%d] [%s]\n, cubrid_errno($conn), cubrid_error($conn));
}elseif(TRUE == $set1){
printf([001]return true value, [%d] [%s]\n, cubrid_errno($conn), cubrid_error($conn));
}else{
printf([001]no true and no false, [%s] [%s]\n, gettype($set1) , $set1);
}

$set3=cubrid_set_autocommit($conn);
if(FALSE == $set3){
printf([003]Expect false, [%d] [%s]\n, cubrid_errno($conn), cubrid_error($conn));
}elseif(TRUE == $set3){
printf([003]return true value, [%d] [%s]\n, cubrid_errno($conn), cubrid_error($conn));
}else{
printf([003]no true and no false, [%s] [%s]\n, gettype($set3) , $set3);
}

cubrid_close($conn);
{noformat}

Actual result:
{noformat}
PHP Notice: Use of undefined constant CUBRID_AUTOCOMMIT_TRUEEE - assumed 'CUBRID_AUTOCOMMIT_TRUEEE' in /home/php/phpTestcases/_06_commit/autocommit_test.phpt on line 5
[001]return true value, [0] []
PHP Warning: cubrid_set_autocommit() expects exactly 2 parameters, 1 given in /home/php/phpTestcases/_06_commit/autocommit_test.phpt on line 23
[003]Expect false, [0] []
{noformat}

Expect result:
Maybe the return value is false when the second parameter value is not correct.

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.