[glom] MySQL: Fix count_rows_returned_by().



commit 4f6e4b61da6ff066ea941b4350cde408780479e5
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 7a3dae7..d3abb2b 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -1957,6 +1957,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]