Author: mysqlpp
Date: Mon Aug 18 03:03:06 2008
New Revision: 2352
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2352&view=rev
Log:
Noted the limitation on using DBDriver::insert_id() with stored
procedure calls.
Modified:
trunk/lib/dbdriver.h
trunk/lib/query.h
Modified: trunk/lib/dbdriver.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/dbdriver.h?rev=2352&r1=2351&r2=2352&view=diff
==============================================================================
--- trunk/lib/dbdriver.h (original)
+++ trunk/lib/dbdriver.h Mon Aug 18 03:03:06 2008
@@ -263,7 +263,11 @@
///
/// \retval 0 if the previous query did not generate an ID. Use
/// the SQL function LAST_INSERT_ID() if you need the last ID
- /// generated by any query, not just the previous one.
+ /// generated by any query, not just the previous one. This
+ /// applies to stored procedure calls because this function returns
+ /// the ID generated by the last query, which was a CALL statement,
+ /// and CALL doesn't generate IDs. You need to use LAST_INSERT_ID()
+ /// to get the ID in this case.
ulonglong insert_id() { return mysql_insert_id(&mysql_); }
/// \brief Kill a MySQL server thread
Modified: trunk/lib/query.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=2352&r1=2351&r2=2352&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Mon Aug 18 03:03:06 2008
@@ -220,7 +220,11 @@
///
/// \retval 0 if the previous query did not generate an ID. Use
/// the SQL function LAST_INSERT_ID() if you need the last ID
- /// generated by any query, not just the previous one.
+ /// generated by any query, not just the previous one. This
+ /// applies to stored procedure calls because this function returns
+ /// the ID generated by the last query, which was a CALL statement,
+ /// and CALL doesn't generate IDs. You need to use LAST_INSERT_ID()
+ /// to get the ID in this case.
ulonglong insert_id();
/// \brief Assign another query's state to this object
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits