Bug 122516 - Mysql/MariaDB - native connector timestamp values displayed as floating numbers in Table data entry mode
Summary: Mysql/MariaDB - native connector timestamp values displayed as floating numbe...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All Linux (All)
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0 target:6.2.0
Keywords: bibisectRequest, regression
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2019-01-06 14:45 UTC by Alex Thurgood
Modified: 2019-01-22 09:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2019-01-06 14:45:21 UTC
Description:
1) Create the following mysql/mariadb table from the mysql command line :

create table employee (ID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, fname varchar(30), lname varchar(50), ts timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);

Add some data to the table :

INSERT into employee vALUES (NULL,'Peter','Haven',NULL);
INSERT into employee vALUES (NULL,'Anne','Jones',NULL);
INSERT into employee vALUES (NULL,'Lars','Hedegaard',NULL);


2) Create an ODB file that connects to the database containing the table. Double-click on the table entry 'employee' in the list of tables.

3) Notice how the timestamp fields are displayed as a DECIMAL value and is incorrect as it clearly represents a rounded value.

4) The display format can be changed for the current session to display the timestamp values, but this is not saved on shutdown and reload of the ODB file.

5) Point (4) is at best a temporary and transitory workaround, as the grid view should display the timestamp value rather than some converted decimal value.

Steps to Reproduce:
See above

Actual Results:
Incorrect (and inprecise) conversion of timestamp values to decimal value in table data entry mode (grid view).

Expected Results:
The timestamp values should be displayed as they actually exist in the DB.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Julien Nabet 2019-01-17 08:10:49 UTC
On pc Debian x86-64 with master sources updated yesterday, I gave it a try and indeed reproduced this.

I noticed this on console:
warn:legacy.osl:7537:7537:connectivity/source/drivers/mysqlc/mysqlc_general.cxx:224: Unknown type name from string, failing back to varchar.
warn:dbaccess.core:7537:7537:dbaccess/source/core/api/RowSetCache.cxx:140: ORowSetCache: N3com3sun4star3uno9ExceptionE msg: OPreparedResultSet::beforeFirst: feature not implemented.
Comment 2 Julien Nabet 2019-01-17 08:15:37 UTC
Tamas/Lionel: I submitted this patch on gerrit:
https://gerrit.libreoffice.org/66495
Comment 3 Commit Notification 2019-01-17 19:50:27 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/5d1a654a14696e181b49f18ea4d685d78fb1a516%5E%21

tdf#122516: fix timestamp in MariaDb/mysql

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Julien Nabet 2019-01-17 19:50:48 UTC
Cherry-pick for 6.2 on gerrit review: https://gerrit.libreoffice.org/#/c/66497/
Comment 5 Commit Notification 2019-01-22 04:45:06 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/78335b8848ed95c978b9c23639ec7711fec1c1b8%5E%21

tdf#122516: fix timestamp in MariaDb/mysql

It will be available in 6.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2019-01-22 08:54:07 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-6-2-0":

https://git.libreoffice.org/core/+/6d38c3088532959e1d7ffd4e4714b5ad39b02685%5E%21

tdf#122516: fix timestamp in MariaDb/mysql

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.