Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #17650 lastInsertId can not handle bigint, forces cast to integer
Submitted: 2010-08-03 03:40 UTC
From: alexpw Assigned: quipo
Status: Closed Package: MDB2_Driver_mysql (version 1.5.0b2)
PHP Version: 5.2.9 OS: OSX
Roadmaps: (Not assigned)    

 [2010-08-03 03:40 UTC] alexpw (Alex Walker)
Description: ------------ If the auto_increment of your table is a bigint, MDB2's lastInsertId() will return PHP_INT_MAX, as soon as the the primary key surpasses the capacity of an integer. The following will fix it. function lastInsertID($table = null, $field = null) { // not using mysql_insert_id() due to - return $this->queryOne('SELECT LAST_INSERT_ID()', 'integer'); + return $this->queryOne('SELECT LAST_INSERT_ID()'); } // }}}


 [2010-08-29 15:22 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.