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

Bug #16524 Query.add() returns 'NULL' i.o inserted id for MDB2+autoincrement
Submitted: 2009-08-15 03:37 UTC
From: marvin_x Assigned:
Status: Open Package: MDB_QueryTool (version 1.2.2)
PHP Version: 5.3.0 OS: Windows XP SP3
Roadmaps: (Not assigned)    
Subscription  


 [2009-08-15 03:37 UTC] marvin_x (Geertjan van Vliet)
Description: ------------ Query->add() does not return the last inserted id, if we use MDB2 AND if we have an autoincrement supporting database / table. Instead add() returns 'NULL' (even with succesful insertion) The add() function is supposed to figure out an id and return that id. For MDB this works, since the id is figured out before the query. For MDB2 this is different. The MDB2_Extended.beforeID() function is called, which , if auto-increment is supported, returns $id == 'NULL' to be put into the query, which works fine on execution. After the execution nothing happens, and the id remains 'NULL' . A suggested fix is included in the files. It calls MDB2's AfterId function.

Comments

 [2009-08-15 03:49 UTC] marvin_x (Geertjan van Vliet)
-Summary: Query->add() does not return id with MDB2 +Summary: Query.add() returns 'NULL' i.o inserted id for MDB2+autoincrement