[evolution-data-server/openismus-work] EBookBackendSqliteDB: Fixed get_count_cb() to be more flexible



commit 9977ca5149cbe13dc1a0d572f2cd258d971c4341
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Wed Apr 17 19:43:02 2013 +0900

    EBookBackendSqliteDB: Fixed get_count_cb() to be more flexible
    
    The previous version only accepted 'count(*)' semantics, this one
    allows more fancy variante of 'count' statemente, like:
        count(DISTINCT summary.uid)

 .../libedata-book/e-book-backend-sqlitedb.c        |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 6b56c7f..ec315a3 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -756,7 +756,7 @@ get_count_cb (gpointer ref,
        gint i;
 
        for (i = 0; i < n_cols; i++) {
-               if (g_strcmp0 (name[i], "count(*)") == 0) {
+               if (name[i] && strncmp (name[i], "count", 5) == 0) {
                        count = g_ascii_strtoll (cols[i], NULL, 10);
                }
        }


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