[evolution-data-server/openismus-work-master: 52/76] EBookBackendSqliteDB: Fix order by statement for cursor movement.



commit 137b2411a991dabfd96b5f609e3f65076fa1b71a
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Tue Jun 18 16:49:44 2013 +0900

    EBookBackendSqliteDB: Fix order by statement for cursor movement.
    
    The order by statement must also order the contact UID, since the
    UID is used as a tiebreaker between contacts which might be otherwise
    identical, the search results must also be ordered by UID.

 .../libedata-book/e-book-backend-sqlitedb.c        |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index aeea6a0..7da02d0 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -5287,6 +5287,11 @@ ebsdb_cursor_order_by_fragment (EBookBackendSqliteDB *ebsdb,
                                        (sort_types[i] == E_BOOK_SORT_ASCENDING ? "ASC"  : "DESC"));
        }
 
+       /* Also order the UID, since it's our tie breaker, we must also order the UID field */
+       if (n_sort_fields > 0)
+               g_string_append (string, ", ");
+       g_string_append_printf (string, "summary.uid %s", reverse ? "DESC" : "ASC");
+
        return g_string_free (string, FALSE);
 }
 


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