Bug 50626 - EDITING: Query on Mac OS X Addressbook doesn't display data for fields other than CHAR datatype
Summary: EDITING: Query on Mac OS X Addressbook doesn't display data for fields other ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: Other macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 126961
Blocks: Database-Queries
  Show dependency treegraph
 
Reported: 2012-06-03 01:13 UTC by Robert Großkopf
Modified: 2023-04-24 17:46 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Shows birthdate (German: Geburtstag) as timestamp in tables and text in queries (168.59 KB, application/pdf)
2012-06-03 08:42 UTC, Robert Großkopf
Details
LLdb output (40.48 KB, text/plain)
2023-04-24 14:47 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2012-06-03 01:13:11 UTC
When I get a connection to the adressbook of Mac OS X I see the right date in the birthday-column. It is formatted in the table as "timestamp". Now I try to make a query in Base. Not birthday is shown. The field is formatted as text. It could not be formatted as date.
Comment 1 Robert Großkopf 2012-06-03 08:42:27 UTC
Created attachment 62456 [details]
Shows birthdate (German: Geburtstag) as timestamp in tables and text in queries
Comment 2 Uwe Altmann 2012-06-11 10:27:15 UTC
The data itself are present in the query - sort by date i.e. works fine. There is just no display of the values.
Formatting of the column is not possible, the only value shown in format-Dialog is "Text" and "@"
Comment 3 Alex Thurgood 2013-09-16 08:29:23 UTC
Hmm, I don't have a birthday field in my OSX address book to be able to compare...



Alex
Comment 4 Alex Thurgood 2013-09-16 08:30:50 UTC
At least, not in the French version of Contacts.app and this consequently does not appear in my LO MacAb ODB connection.

Alex
Comment 5 Alex Thurgood 2013-09-16 08:34:22 UTC
(In reply to comment #4)
> At least, not in the French version of Contacts.app and this consequently
> does not appear in my LO MacAb ODB connection.
> 
> Alex

Contacts.app V7.1(1170)
Comment 6 Alex Thurgood 2013-09-16 08:35:10 UTC
Is this some kind of personalized field that you added, or is it the default ?
Comment 7 Alex Thurgood 2013-09-16 08:44:06 UTC
OK, I could reproduce the problem with any of the Creation or Modification date fields. These are also indicated as timestamp, yet they show up blank in a query.

How to reproduce :
1) Create an ODB file that connects to the Mac addressbook using the db creation wizard.
2) Open the ODB and the GUI query designer wizard.
3) Choose FirstName, Creation and Modification as the fields for display.
4) Validate or run query - only the FirstName field shows any data despite data being available in the Table view mode.

The SQL that is displayed :

SELECT "Address Book"."Prénom" AS "Prénom", "Address Book"."Creation" AS "Creation", "Address Book"."Modification" AS "Modification" FROM "Address Book" "Address Book" 

Note that despite specifically querying on 3 fields, 2 of which are timestamp type, only one timestamp field gets displayed and no data is shown for this field.

Adding Lionel, Julien to CC.


Alex
Comment 8 Alex Thurgood 2013-09-16 08:45:11 UTC
Is this a problem with the Mork driver ?


Alex
Comment 9 Alex Thurgood 2013-09-16 08:46:52 UTC
I tested in LO 4.1.1.2

I can not create a connection to a MacAB with LO-dev 4.2, it systematically causes a crash of the whole app, but will report that separately.

Alex
Comment 10 Alex Thurgood 2013-09-16 08:53:04 UTC
It also won't show a query that uses the ABPersonFlags field.

These are defined as INT in Table design mode and yet do not show up in a query, so the problem seems to be that the Query parser or the returned display fails to handle anything other than CHAR datatype.


Alex
Comment 11 Alex Thurgood 2013-09-16 08:54:45 UTC
Changed title to reflect findings
Comment 13 Lionel Elie Mamane 2013-09-17 03:47:21 UTC
(In reply to comment #12)
> Alex: are you sure it's Mork driver which is used for Mac address book? (not
> Macab driver?)

I expect it is hte MacAB driver :)
Comment 14 Alex Thurgood 2013-09-17 08:09:25 UTC
(In reply to comment #13)

> 
> I expect it is hte MacAB driver :)


Lionel, I expect you're right, sorry :-)

Alex
Comment 15 Alex Thurgood 2015-01-03 17:41:27 UTC Comment hidden (no-value)
Comment 16 QA Administrators 2016-01-17 20:05:38 UTC Comment hidden (obsolete)
Comment 17 Alex Thurgood 2016-01-19 13:30:23 UTC
The Query wizard returns an error : Query too complex
The query designer UI returns a SYNTAX error using a date literal or a query too complex error when using > '31/12/2014' for example

Version: 5.0.3.2
Build ID: e5f16313668ac592c1bfb310f4390624e3dbfb75
Locale : fr-FR (fr.UTF-8)

OSX 10.11.2
Comment 18 QA Administrators 2017-03-06 14:45:33 UTC Comment hidden (obsolete)
Comment 19 eisa01 2018-03-29 20:50:57 UTC
Still present

Version: 6.1.0.0.alpha0+
Build ID: a488c7ad2763b944713997911c1ddb0315d8c93f
CPU threads: 2; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-03-26_00:38:29
Locale: en-US (en_US.UTF-8); Calc: group
Comment 20 QA Administrators 2019-03-30 06:13:07 UTC Comment hidden (obsolete)
Comment 21 Alex Thurgood 2019-04-01 07:12:26 UTC
Still present in

Version: 6.2.2.2
Build ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
Threads CPU : 8; OS : Mac OS X 10.14.3; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded


Make a query on just the Modification date field (this is defined as timestamp).

An empty grid control is displayed with neither field entry (column header), nor any data.
Comment 22 Julien Nabet 2019-04-01 08:14:05 UTC
Alex: just for curiosity, if you're launching LO from console, are there any useful information?

Also taking a look at https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx?r=48314f25#763, what official source do we have to confirm precision, max scale, etc for TIMESTAMP but also for other types?
Indeed, we know that timestamp is kABDateProperty (see https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/macab/macabutilities.hxx?r=00657aef#123) and this last one is NSDate (see https://developer.apple.com/documentation/addressbook/address_book_objective-c_constants/property_types) but we'd need to know internals of NSDATE.
Comment 23 QA Administrators 2021-04-15 03:43:34 UTC Comment hidden (obsolete)
Comment 24 Alex Thurgood 2021-04-21 08:29:03 UTC
I'm still blocked from testing this due to bug 126961
Comment 25 QA Administrators 2023-04-22 03:27:26 UTC Comment hidden (obsolete)
Comment 26 Robert Großkopf 2023-04-22 05:33:24 UTC
Couldn't say anything about this bug. Have only written the bug description for another person. No Mac available here…
Comment 27 Alex Thurgood 2023-04-24 14:21:34 UTC
Bug still present in 

Version: 7.5.1.2 (AARCH64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 8; OS: Mac OS X 13.3.1; UI render: Skia/Raster; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 28 Alex Thurgood 2023-04-24 14:47:10 UTC
Created attachment 186887 [details]
LLdb output

FWIW, here is the LLDB output when loading the ODB file that connects to the Contacts.app data source, and what is displayed in the termina when attempting to execute a query containing non-Char field types.
Comment 29 Alex Thurgood 2023-04-24 14:52:52 UTC
(In reply to Alex Thurgood from comment #28)
> Created attachment 186887 [details]
> LLdb output
> 
> FWIW, here is the LLDB output when loading the ODB file that connects to the
> Contacts.app data source, and what is displayed in the termina when
> attempting to execute a query containing non-Char field types.

There seems to be a whole lot of wrong things going on here :

warn:legacy.osl:11240:267069:dbaccess/source/core/api/SingleSelectQueryComposer.cxx:874: OSingleSelectQueryComposer::getColumns: inconsistent column counts, this might result in wrong columns!

and

warn:comphelper:11240:267069:comphelper/source/misc/types.cxx:48: conversion from Any to sal_Int32 failed


probably do not help the situation.
Comment 30 Julien Nabet 2023-04-24 17:46:29 UTC
Patrick: on https://developer.apple.com/documentation/addressbook, there's:
"Do not use the AddressBook framework in macOS 10.11 and later. Use the APIs defined in the Contacts framework instead."

I suppose it means there's no need to investigate here, the macab driver ( connectivity/source/drivers/macab) should be rewritten from scratch to use "Contacts framework"?