From 55ab9a6844185e48904be6c1e995881a7fe55e8c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 19 Sep 2011 11:11:35 +0200 Subject: Add assertion for mismatch of result set column count in MySQL and SQLite This is useful for detecting native views that happened to have stray data members. Also update comment in PostgreSQL. --- odb/pgsql/statement.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/odb/pgsql/statement.cxx b/odb/pgsql/statement.cxx index c839e92..671bf61 100644 --- a/odb/pgsql/statement.cxx +++ b/odb/pgsql/statement.cxx @@ -180,6 +180,11 @@ namespace odb bool r (true); int int_row (static_cast (row)); + // 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 (PQnfields (result)) == count); for (int i (0); i < static_cast (count); ++i) -- cgit v1.1