Bug 123930 - BASE Entering dates in table control retains wrong date - mariadb backend and mysldb JDBC connector
Summary: BASE Entering dates in table control retains wrong date - mariadb backend and...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2019-03-07 21:15 UTC by Alex Kempshall
Modified: 2019-03-11 10:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A tar file containg base application and mysqldump (10.40 KB, application/x-compressed-tar)
2019-03-08 12:19 UTC, Alex Kempshall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Kempshall 2019-03-07 21:15:50 UTC
I have an application that contains a form called Main_Form.

The Main_Form contains a sub form called Customer_Details.

The sub form Customer_Details contains a sub form called Payment_Details.

The Payment_Details form has a single Table Control which has two columns called Date and Value.


Using the Table Control when entering a date and value into a row then move onto the next row I get unexpected results in the row I've just left as described below. The unexpected results relate to the Date Column


If I enter 01/01/19 in the date field and 10 into the value column and then move onto the next row I see 01/01/19 and 10 in the row that I have just left. This is what I expect.

If I enter 01/02/19 in the date field and 10 into the value column and then move onto the next row I see 01/02/19 and 10 in the row that I have just left. This is what I expect.

If I enter 01/03/19 in the date field and 10 into the value column and then move onto the next row I see 01/03/19 and 10 in the row that I have just left. This is what I expect.

If I enter 01/04/19 in the date field and 10 into the value column and then move onto the next row I see 31/03/19 and 10 in the row that I have just left. This is not what I expect, the date I end up with is not the one that I entered.

If I enter 01/05/19 in the date field and 10 into the value column and then move onto the next row I see 30/04/19 and 10 in the row that I have just left. This is not what I expect.

and so on 

If I enter 01/11/19 in the date field and 10 into the value column and then move onto the next row I see 01/11/19 and 10 in the row that I have just left. This is what I expect.

If I enter 01/12/19 in the date field and 10 into the value column and then move onto the next row I see 01/12/19 and 10 in the row that I have just left. This is what I expect.
Comment 1 Alex Thurgood 2019-03-08 11:44:21 UTC
@Alex : can you let us know :

- the kind of database engine, and how you are accessing the database ;
- your version of LO (distrib, TDF, etc)
- your system locale, and any language packs you might be using within LO.

It would be helpful if you could provide a sample ODB file with which we could try and reproduce the phenomena you are experiencing.

There have been previous reports of date alteration in the past, so perhaps the behaviour you are experiencing has already been reported (I seem to recall a "date off by one" bug report somewhere).
Comment 2 Alex Thurgood 2019-03-08 11:50:33 UTC
See for example bug 96190, of which this report is possibly a duplicate.
Comment 3 Alex Kempshall 2019-03-08 12:15:04 UTC
The backend is mariadb 10.0.38
Using java connector mysql-connector-java-8.0.12
I'm seeing the problem on 6.1.4.2, 6.2.0 and 6.2.1
my locale is en_GB

Using bibisect I've gone back to 

Version: 6.0.0.0.alpha1+
Build ID: 6eeac3539ea4cac32d126c5e24141f262eb5a4d9
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-GB (en_GB); Calc: group threaded

and still seeing the problem which I find strange as I've only first encountered the problem in the last week.

I've got a test application and database that I will attach.
Comment 4 Alex Kempshall 2019-03-08 12:19:59 UTC
Created attachment 149823 [details]
A tar file containg base application and mysqldump
Comment 5 Alex Thurgood 2019-03-08 12:21:52 UTC
@Alex : the mysql jdbc connector is buggy in version 8.x, cf. bug 119139
Comment 6 Alex Thurgood 2019-03-08 12:24:10 UTC
@Alex :

- have you added any timezone parameters to your JDBC connection string ?
- have you tried the mariadb jdbc connector instead of the mysql one ?
Comment 7 Alex Kempshall 2019-03-08 12:48:13 UTC
As I said earlier "I find strange as I've only first encountered the problem in the last week."

On 27 Jan 2019 I upgraded my mysql-connector from 5.1.39 to 8.0.12 so in the right time frame to cause problems.

I've not added any timezone parameters to my JDBC connection string. At least I've not done so intentionally.

I've not tried the mariadb jdbc connector. I shall try that this afternoon.
Comment 8 Alex Kempshall 2019-03-08 13:36:33 UTC
 Your comment was:

    I've got a problem trying to get the mariadb connector to work.

    This is what I've done

    downloaded mariadb-java-client-2.4.0.jar
    copied it to /usr/share/mysql-connector-java
    In LO went to Tools -> Options -> Advanced
    pushed the button <Class Path>
    Removed the archive mysql-connector-java-8.0.12.jar
    Added the archive mariadb-java-client-2.4.0.jar
    OK's this 
    Restarted LO


    When I open the form get the error message box with

    The connection to the data source "myGrid" could not be established.
    The driver class 'com.mysql.jdbc.Driver' could not be loaded.

    I'm probably doing something really dumb or missed out one or more steps.
Comment 9 Alex Kempshall 2019-03-08 13:43:08 UTC
I decided to take the least path of resistance and reinstalled mysql-connector-java 5.1.39. 

Might be to early to say, but the problem may have gone away.
Comment 10 Robert Großkopf 2019-03-08 15:41:51 UTC
Have tested with the attachment. If I set 01/04/19 in the date field (and 10 in value) I will get 01/04/19 there, not 31/03/19

My connection to the mariadb I get with https://downloads.mariadb.com/Connectors/java/ connector 2.2.3
My system: OpenSUSE 15, 64bit rpm Linux, LO 6.1.5.2
Comment 11 Robert Großkopf 2019-03-08 16:01:57 UTC
(In reply to Alex Kempshall from comment #8)
> 
>     The connection to the data source "myGrid" could not be established.
>     The driver class 'com.mysql.jdbc.Driver' could not be loaded.

You have to set org.mariadb.jdbc.Driver instead.
Comment 12 Alex Kempshall 2019-03-08 16:22:19 UTC
(In reply to Robert Großkopf from comment #11)
> (In reply to Alex Kempshall from comment #8)
> > 
> >     The connection to the data source "myGrid" could not be established.
> >     The driver class 'com.mysql.jdbc.Driver' could not be loaded.
> 
> You have to set org.mariadb.jdbc.Driver instead.

Yes worked that out. Everything seems to be a bit buggy at the moment. 

So I've gone back mysql-connector from 5.1.39  which was working, withou the date problem,  an hour or so ago. Now I'm getting another problem that seems to have gone solid with either this message

The data content could not be loaded.
Parameter index out of range (1 > number of parameters, which is 0).

or this message

The connection to the data source "myGrid" could not be established.
The connection to the external data source could not be established. No SDBC driver was found for the URL '~sdbc:mysql:jdbc:myGrid'.

I've encountered the "Parameter index out of range" problem before. Which I've fixed with the ParemeterSubstitution fix.

I'm going round in circles at the moment, so will step back for a little while and just chill out.
Comment 13 Alex Kempshall 2019-03-11 10:40:13 UTC
Friday, after my comments https://bugs.documentfoundation.org/show_bug.cgi?id=123930#c12 I took a short break.


After a short break redid the upgrade, to mariadb-java-client-2.4.0.jar,  in a different clone of virtualbox using org.mariadb.jdbc.Driver. Tested. Everything worked as expected.

Copied the application myGrid to the clone that was giving the problems as reported in https://bugs.documentfoundation.org/show_bug.cgi?id=123930#c12 those problems went away as well. Must have corrupted something in the application in that environment.

Rolled out the change to one of our production boxes. Everything worked as expected.

Rolled out the change to our other production box. Everything worked as expected.

No problems reported so far.

So problem was with the mysql connector. Had a quick look at their bug database and the closest was https://bugs.mysql.com/bug.php?id=85570 which was in 6.0.5, 6.0.6 and corrected some time ago. Oracle might argue that I mixed and matched mariadb with mysql so strange things might happen.


So I'm closing this as Resolved - Not our bug.