Bug 86457 - Error when creating a form for MySQL-DB on remotehost: can not be represented as java.sql.Timestamp
Summary: Error when creating a form for MySQL-DB on remotehost: can not be represented...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.2.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 08:51 UTC by Sjoerd
Modified: 2014-12-15 13:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Screenshot of error message (32.56 KB, image/png)
2014-11-19 08:53 UTC, Sjoerd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sjoerd 2014-11-19 08:51:48 UTC
In LibreOffice Base, I get an error when using a form with a subform based on a relation with a specific table.

The database is an existing MySQL database on a remote host. I connect to it using the JDBC driver.

I created the form like this:

* Use Wizard to Create Form...
* In 1. Field selection, select on table and all fields.
* In 2. Set up a subform, add subform based on existing relation.
* In 3, add all fields.
* In 5, click next.
* In 6, check all checkboxes.
* In 7, click next.
* In 8, click finish.

The error message is:
The data content could not be loaded.

SQL Status: S1009

Value '214twente-online.nltwent43038���
Comment 1 Sjoerd 2014-11-19 08:53:52 UTC
Created attachment 109717 [details]
Screenshot of error message
Comment 2 Sjoerd 2014-11-19 08:59:12 UTC
I have tried this with two versions, both give the error message:
Version: 4.3.4.1
Build ID: bc356b2f991740509f321d70e4512a6a54c5f24

Version: 4.2.7.2
Build ID: 420m0(Build:2)
Comment 3 Joel Madero 2014-11-20 15:32:45 UTC
Please attach the actual form as screenshots aren't very useful in these scenarios. Marking as NEEDINFO. Once you attach, mark as UNCONFIRMED. Thanks
Comment 4 Robert Großkopf 2014-11-22 17:10:04 UTC
There is a lot of inromation in the screenshot about code, which shouldn't arrive a timestamp-field at all. Most of the code is text, not a timestamp. Something seems to be a PHP-warning.

Are you able to read the timestamp-field in a normal mainform, not a subform?
Comment 5 Sjoerd 2014-11-24 14:34:17 UTC
> Are you able to read the timestamp-field in a normal mainform, not a subform?

No. Just creating a single form of the "domein" table using the wizard results in this error.
Comment 6 Robert Großkopf 2014-11-24 15:47:31 UTC
(In reply to Sjoerd from comment #5)
> > Are you able to read the timestamp-field in a normal mainform, not a subform?
> 
> No. Just creating a single form of the "domein" table using the wizard
> results in this error.

So I will change the title. Has nothing to do wuth subform. Also ther must be a hint it appears with JDBC/MySQL.

Have tested it with a MariaDB and JDBC, OpenSUSE 12.3 64bit rpm Linux. Created a form by the wizard for a table with a timestamp-field. Could open the form and see the timestamps without any error with LO 4.2.7.2. Also no problems with LO 4.3.4.1.

Could you read the right value in the table, not in a form? The value, which is presented in the error message, shows a content, which isn't a timestamp but a hint where the server could be found and whot the server sends instead of a timestamp.
Comment 7 Sjoerd 2014-11-24 15:55:42 UTC
When I open the "domein" table, I get another error message:

Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Although it prevents me from using the table, this error message is clear and understandable.

Maybe with forms the wrong message is put in the exception?
Comment 8 Robert Großkopf 2014-11-24 16:32:29 UTC
(In reply to Sjoerd from comment #7)
> When I open the "domein" table, I get another error message:
> 
> Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
> 
> Although it prevents me from using the table, this error message is clear
> and understandable.
> 
> Maybe with forms the wrong message is put in the exception?

The error-message is nearly the same. There is content, which couldn't be shown as a timestamp, but seems to be defined as it. The error-message of the form shows also the content, the error-message of the table doesn't show it. The content of the field seem to be:
'214twente-online.nl ... byte'
This would be the same content you get, when you switch to Tools → SQL send a query like "SELECT * FROM Table".
The content you get from your server isn't a timestamp. You would get the same error when using the direct connection, which is available here:
http://extensions.libreoffice.org/extension-center/mysql-native-connector

How do you connect to the server? There is something about PHP-Warning.
Comment 9 Sjoerd 2014-11-25 08:45:01 UTC
The texts you see in the error message are values from the database. There is one column in the database containing PHP options.
Comment 10 Alex Thurgood 2014-12-15 13:29:45 UTC
(In reply to Sjoerd from comment #7)
> When I open the "domein" table, I get another error message:
> 
> Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
> 



Add a new parameter to your connection string on the same line as your database name :

?zeroDateTimeBehavior=convertToNull


management of null datetime strings changed in mysql jdbc connector to throw an exception. This is not our bug, and there is a workaround.