Bug 17052 - Exception generating AddressBook query
Summary: Exception generating AddressBook query
Status: RESOLVED FIXED
Alias: None
Product: Mobile API (Preview)
Classification: Xamarin
Component: Xamarin.Android ()
Version: Preview 0.6.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Eric Maupin
URL:
Depends on:
Blocks:
 
Reported: 2014-01-04 06:30 UTC by softlion
Modified: 2014-01-20 14:06 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description softlion 2014-01-04 06:30:37 UTC
Code:

            var ab = new AddressBook(Activity)  { PreferContactAggregation = true };
            var acontact = ab.FirstOrDefault(c => c.DisplayName == "Some Name");

Result on Android 4.3 simulator (it worked one time though):

01-03 13:13:26.190 I/MonoDroid( 8149): android.database.sqlite.SQLiteException: near "AND": syntax error (code 1): , while compiling: SELECT times_contacted, contacts_status_updates.status AS contact_status, phonetic_name, phonetic_name_style, is_user_profile, lookup, phonebook_label_alt, contacts_status_updates.status_icon AS contact_status_icon, last_time_contacted, contact_last_updated_timestamp, _id, display_name_source, photo_uri, photo_thumb_uri, agg_presence.chat_capability AS contact_chat_capability, photo_id, send_to_voicemail, custom_ringtone, name_raw_contact_id, photo_file_id, has_phone_number, contacts_status_updates.status_label AS contact_status_label, phonebook_bucket, display_name, phonebook_bucket_alt, sort_key_alt, phonebook_label, in_visible_group, starred, display_name_alt, sort_key, agg_presence.mode AS contact_presence, contacts_status_updates.status_res_package AS contact_status_res_package, contacts_status_updates.status_ts AS contact_status_ts FROM view_contacts LEFT OUTER JOIN agg_presence ON (_id = agg_presence.presence_contact_id) LEFT OUTER JOIN status_updates contacts_status_updates ON (status_update_id=contacts_status_updates.status_update_data_id) WHERE ((1)) AND ((( AND display_name = ?))) ORDER BY lookup LIMIT 1