Bug 160423 - Base table design does not handle zoned time type correctly
Summary: Base table design does not handle zoned time type correctly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-29 21:08 UTC by prrvchr
Modified: 2024-05-03 10:36 UTC (History)
0 users

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 prrvchr 2024-03-29 21:08:06 UTC
Description:
In the table design in Base, the new types that were declared in the PR #155866[1] are not supported correctly when creating a table.

Steps to Reproduce:
1. In Base create a table and with a column of the type: TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIME or TIME WITH TIME ZONE.
2. If you have the development version of LibreOffice you will see this warning:
warn:legacy.osl:133092:133092:dbaccess/source/ui/control/FieldDescControl.cxx:854: Unknown type

Actual Results:
A warning appears when using these new types.

Expected Results:
We shouldn't have warnings


Reproducible: Always


User Profile Reset: No

Additional Info:
[1] https://gerrit.libreoffice.org/c/core/+/155866
Comment 1 Julien Nabet 2024-03-29 21:22:54 UTC
On pc Debian x86-64 with master sources updated today + a brand new odb file with HSQLDB Embedded, new types which include "WITH_TIMEZONE" don't appear on list of Field types available.
Comment 2 prrvchr 2024-03-29 21:39:14 UTC
I think if you are using HsqlDB embedded it is version 1.8 and I think this version does not have a zoned time types.

I submitted PR #165560[1]

[1] https://gerrit.libreoffice.org/c/core/+/165560
Comment 3 prrvchr 2024-03-29 22:01:48 UTC
If you want to be able to declare types such as: TIME, TIMESTAMP, TIME_WITH_TIMEZONE and TIMESTAMP_WITH_TIMEZONE, with the possibility of entering the precision (ie: from 0 to 9) you must:
- Have a database managing its types.
- Have a getTypeInfo() method of DatabaseMetData that should return the correct information.

If the underlying database does not produce a satisfactory ResultSet for getTypeInfo() then there is a possibility to patch the ResultSet with the TypeInfoSettings[1] property in order to obtain the correct ResultSet (ie: you can set min and max value of the precision)

[1] https://www.openoffice.org/api/docs/common/ref/com/sun/star/sdbc/JDBCConnectionProperties.html#TypeInfoSettings
Comment 4 Julien Nabet 2024-03-30 13:32:26 UTC
Ok so it's quite specific since HSQL or Firebird embedded don't have it, Mariadb too.
Thank you for the feedback!
uncc myself since I can't help here.
Comment 5 prrvchr 2024-03-30 18:07:59 UTC
In fact, it's not really specific but has existed since JDBC 4.0 I believe.
It is supported by HsqlDB, H2 and PostgreSQL.

It would be important for Base to be fully compliant with JDBC 4.0.
Comment 6 Commit Notification 2024-05-03 10:36:30 UTC
Pierre committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/334585be92eac832e56944b773436bdbefd58adf

tdf#160423 Base handle zoned time type correctly

It will be available in 24.8.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.