[glom/mysql2: 6/13] MySQL: Fix count_rows_returned_by().



commit 1bdc6381dc42bc5690ff7d9d84ff70def5eba473
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Jan 5 14:34:51 2013 +0100

    MySQL: Fix count_rows_returned_by().

 glom/libglom/db_utils.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index c9b68a7..6684fe8 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -1954,6 +1954,10 @@ int count_rows_returned_by(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& sql
     {
       result = value.get_int(); //With the SQLite backend.
     }
+    else if(value.get_value_type() == G_TYPE_LONG) //With the MySQL backend.
+    {
+      result = (int)value.get_long(); //With the SQLite backend.
+    }
     else
     {
       std::cerr << G_STRFUNC << ": The COUNT query returned an unexpected value type: " << g_type_name(value.get_value_type()) << std::endl;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]