After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660246 - EBookBackendSqliteDB: Bad loop iteration
EBookBackendSqliteDB: Bad loop iteration
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.2.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-09-27 13:36 UTC by Christophe Dumez
Modified: 2011-09-29 11:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.15 KB, patch)
2011-09-27 13:36 UTC, Christophe Dumez
committed Details | Review

Description Christophe Dumez 2011-09-27 13:36:44 UTC
Created attachment 197571 [details] [review]
Proposed patch

Please find attached the following patch for master and 3.2:

***
e_book_backend_sqlitedb_remove_contacts: Fix removal of more than one contact
    
The code was not properly iterating over the UID list and as a consequence,    calling e_book_backend_sqlitedb_remove_contacts() with more than one UID would only remove the first UID in the list.
***
Comment 1 Christophe Dumez 2011-09-27 13:41:58 UTC
This is quite annoying because if one calls e_book_client_remove_contacts() with more than one UID, only the first UID gets removed from the SQLite summary but all them get removed from the backend.

Then, the backend and the summary are no longer in sync and you get errors later such as:
libebookbackend-WARNING **: e-book-backend-file.c:423: db->del failed with DB_NOTFOUND: No matching key/data pair found, uid: pas-id-4E81AF66000000A6

when trying to delete a contact with a UID that was returned by e_book_client_get_contacts_uids().