From efebd5ea2e6b0cf4e272614075c8346c0ef16cba Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Nov 2014 13:34:17 +0200 Subject: Update SQLite --- odb/sqlite/statement.cxx | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'odb/sqlite/statement.cxx') diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx index d56f45f..09188cb 100644 --- a/odb/sqlite/statement.cxx +++ b/odb/sqlite/statement.cxx @@ -605,11 +605,13 @@ namespace odb insert_statement (connection_type& conn, const string& text, bool process, - binding& param) + binding& param, + binding* returning) : statement (conn, text, statement_insert, (process ? ¶m : 0), false), - param_ (param) + param_ (param), + returning_ (returning) { } @@ -617,11 +619,13 @@ namespace odb insert_statement (connection_type& conn, const char* text, bool process, - binding& param) + binding& param, + binding* returning) : statement (conn, text, statement_insert, (process ? ¶m : 0), false), - param_ (param) + param_ (param), + returning_ (returning) { } @@ -679,14 +683,17 @@ namespace odb translate_error (e, conn_); } - return true; - } + if (returning_ != 0) + { + bind& b (returning_->bind[0]); - unsigned long long insert_statement:: - id () - { - return static_cast ( - sqlite3_last_insert_rowid (conn_.handle ())); + *b.is_null = false; + *static_cast (b.buffer) = + static_cast ( + sqlite3_last_insert_rowid (conn_.handle ())); + } + + return true; } // update_statement -- cgit v1.1