#31710 [Opn->Asn]: return value of rollback() is inverted

From: Date: Wed, 26 Jan 2005 22:59:02 +0000
Subject: #31710 [Opn->Asn]: return value of rollback() is inverted
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72895@lists.php.net to get a copy of this message
ID: 31710 Updated by: tony2001@php.net Reported By: cyrilleml at kbuilder dot net -Status: Open +Status: Assigned Bug Type: MySQLi related Operating System: winXP Pro PHP Version: 5.0.3 -Assigned To: +Assigned To: georg New Comment: Assigning to Georg. According to MySQL docs, mysql_autocommit(), mysql_commit() & mysql_rollback() return 0 on success and non-zero value on error and using RETURN_BOOL(result_value) here is obviously wrong. Previous Comments: ------------------------------------------------------------------------ [2005-01-26 23:17:57] cyrilleml at kbuilder dot net Description: ------------ Hello, Functions rollback() works fine expected that the return value is inverted. if rollback() failed, return value is TRUE, if rollback() success, return value is FALSE. The problem is that the Documentation say the opposite. So for my code work fine, I've to write: if( $dbh1->rollback() ){ printf( "DBH1 Failed to rollback : %s \n", $dbh1->error); } bye cyrille Reproduce code: --------------- if( $dbh1->rollback() ){ printf( "DBH1 Failed to rollback : %s \n", $dbh1->error); } Expected result: ---------------- if( ! $dbh1->rollback() ){ printf( "DBH1 Failed to rollback : %s \n", $dbh1->error); } or if( $dbh1->rollback() == FALSE ){ printf( "DBH1 Failed to rollback : %s \n", $dbh1->error); } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31710&edit=1

« previous php.bugs (#72895) next »