[glom/mysql: 13/21] MySQL: Fix count_rows_returned_by().



commit 94c6499e38bc33b647950036decd993f2ef11aa8
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]