diff options
Diffstat (limited to 'odb/sqlite')
-rw-r--r-- | odb/sqlite/statement.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx index 6417b3a..9071f68 100644 --- a/odb/sqlite/statement.cxx +++ b/odb/sqlite/statement.cxx @@ -114,6 +114,13 @@ namespace odb bool statement:: bind_result (const bind* p, size_t n, bool truncated) { + // Make sure that the number of columns in the result returned by + // the database matches the number that we expect. A common cause + // of this assertion is a native view with a number of data members + // not matching the number of columns in the SELECT-list. + // + assert (static_cast<size_t> (sqlite3_data_count (stmt_)) == n); + bool r (true); for (size_t i (0); i < n; ++i) |