Ticket #24 (closed Bug: fixed)

Opened 17 months ago

Last modified 17 months ago

trans_status() bug or typo

Reported by: Tido Owned by:
Priority: minor Milestone: 1.0
Component: Version:
Keywords: database, db driver Cc:

Description

As noted in the user_guide: http://codeigniter.com/user_guide/database/transactions.html under Managing Errors it says that you check for === FALSE for transaction errors. However it is the opposite of that. You have to check for === TRUE for transaction failure. In DB_driver.php Line 465 notes that it should return TRUE as well. But on line 491 it returns FALSE for failure. I personally think it should be FALSE as it says in the user_guide. It makes more sense to test for FALSE if theres an error (vs TRUE for an error?). But i do not know the original intent of this, so tuff for me to say which is correct since the user_guide and code/comments contradict each other.

http://codeigniter.com/bug_tracker/bug/1781/

Change History

Changed 17 months ago by Tido

  • status changed from new to closed
  • resolution set to fixed

The docs and what the code does is contradictory. I'm reversing the output of trans_status() to reflect what is said in the docs.

Note: See TracTickets for help on using tickets.