Bug 145065 - Libreoffice MySQL native connector problem
Summary: Libreoffice MySQL native connector problem
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.2.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 11:30 UTC by olivier_musson
Modified: 2021-12-08 15:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test 1.odb number 1 test working as it should (12.82 KB, application/vnd.oasis.opendocument.database)
2021-10-18 14:22 UTC, olivier_musson
Details
Test 2.odb number 2 test not working (12.08 KB, application/vnd.oasis.opendocument.database)
2021-10-18 14:30 UTC, olivier_musson
Details
MySQL dump file with create schema (315.92 KB, application/sql)
2021-10-18 14:35 UTC, olivier_musson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description olivier_musson 2021-10-11 11:30:06 UTC
Description:
Using native mysql/mariadb connector within LO is not working on a 3rd linked field subform.
Creating a new form with 2 tables (1 mainform + 1 subform) having linked fields is working but adding a third one (1 mainform + 2 subform) is not working.
The third form (subform) is a compute field of a total paid rent.

Steps to Reproduce:
1.create a new form with 1 subform and link 1 master field
2.create a new subform linked with a mainform master field doing a compute of payment
3.

Actual Results:
The compute field showing the total amount paid is showing nothing or showing the compute amount of the first record of the table and not changing based on the linked field.

Expected Results:
Showing computation of the total payments for a renter.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
In LO 7.1.5.2 (Linux version) the problem is the same and to solve it I am using AOO 1.2.0 extension for MySQL/MariaDB connections.
Comment 1 Robert Großkopf 2021-10-14 06:32:37 UTC
Couldn't confirm the buggy behavior with OpenSUSE 15.2, LO 7.2.2.2 connected to a MariaDB.

Created three tables.
Second and third table are connected to the first table. Primary key of the first Table is part of both tbales.
Created a form.
Set table1 to mainform, table2 and table3 both to separate subforms.
Could input data in mainform and both subforms. Data will be saved.

One hint for your "solution" with AOO-connector. Tested this a while ago so could be the problem is solved, but times and timestamp will be interpreted differently in LO and AOO. If you are using timestamps and time fields be careful!
Comment 2 Alex Thurgood 2021-10-14 07:56:56 UTC
@Olivier : 

You shouldn't be using the AOO connector any more, as current 7.1 and 7.2 production releases have integrated the mariadb connector directly into the LO release. However, whether or not this requires a separate package install through your package manager is dependent on the Linux distribution.

Please indicate which version of LO you are using (distrib provided default, PPA, Snap, Flatpak, or TDF download) and which Linux distribution/version.

Unfortunately, some of the release channels that use PPA, Snap, etc, contain their own bugs, or bugs that have been fixed in the LO TDF release and not yet filtered down to the distrib provided or alternative channel releases of LO.
Comment 3 Alex Thurgood 2021-10-14 07:59:38 UTC
Ideally, we would also need a sample ODB file and a small mysql dump file against which to test, otherwise we are potentially just guessing which exact setup you have created.
Comment 4 olivier_musson 2021-10-15 08:31:22 UTC
@Alex :
I can confirm that it works correctly if I create a new form and a new LO DB for test purpose with the Linux version 7.2.2.2 downloadedv from the LO website.

I created a test1.odb file which I will send later which is working perfectly fine.

I created a test2.odb file which is also a test but targetting my exisitng mariadb  DB and it's not working. The SQL request is working fine but executed within the form it's not showing up the result in the currency field.

So, I am trying to prepare a small mysql export as you requested and the forms to send you for testing it. I need time as I am actually very busy.
Comment 5 QA Administrators 2021-10-16 03:53:21 UTC Comment hidden (obsolete)
Comment 6 Alex Thurgood 2021-10-18 08:52:50 UTC
@Olivier : thanks for the feedback!

Given Robert's comments using OpenSuse and LO7222 - no repro, and your own comment with regard to the version of LO7222 downloaded from the LO project website - also no repro, it sounds like the issue you are having might be with the distro provided version.


Could you let us know:
- which distro/version you are using?
and 
- which package type/version of LO7152 is connecting to your mariadb instance?
Comment 7 olivier_musson 2021-10-18 14:22:47 UTC
Created attachment 175814 [details]
Test 1.odb number 1 test working as it should
Comment 8 olivier_musson 2021-10-18 14:30:09 UTC
@Alex
I am using OpenSuse Leap 15.3 and MariaDB 10.5.12 for Linux (x86_64).

With LO 7.5.1.2 I am using the AOO extension 1.2 as it's the only way to have it working as it should.

I added a Test 1.odb which is a test case showing that there is no bug and it's workin fine with a brand new DB and form.

I added a Test 2.odb file which is also a brand new form but targetting the MySQL dump tables I attached too. You need to import the table in your own MySQL or MariaDB server and then use the form which show that the last filed showing the total amount is not showing up or moving when you are changing the record.

Please don't hesitate if you need more inof it's just that I am very busy actually  and then I will answer when I can.
Comment 9 olivier_musson 2021-10-18 14:30:46 UTC
Created attachment 175815 [details]
Test 2.odb number 2 test not working
Comment 10 olivier_musson 2021-10-18 14:35:37 UTC
Created attachment 175816 [details]
MySQL dump file with create schema
Comment 11 QA Administrators 2021-10-19 03:42:47 UTC Comment hidden (obsolete)
Comment 12 olivier_musson 2021-12-04 18:01:30 UTC
Hi,

Any news about this problem ?
Is it a bug or a specific problem to me ?

Thanks.
Olivier
Comment 13 Robert Großkopf 2021-12-05 14:24:18 UTC
Have taken the dump file and read it in MariaDB.
Have also taken Test_2.odb and connected it with my local MariaDB. (Connection localhost, with username and password).
Opened the form of Test_2.odb.
Could see all content.
Switched from one row to the next row.
Also could see all content. Field from "SubFormTotal" will refresh when changed row of "MainForm".

I couldn't see any buggy behavior here with OpenSUSE 15.2 and direct connection with MySQL-Connector of LO, which is part of LO 7.2.3.2
Comment 14 olivier_musson 2021-12-07 22:29:16 UTC
Hi Robert,

Thanks for your answer and time.
Then I must have a problem somewhere in my configuration in L.O or in MariaDB as for me test 1.odb is working fine but not test 2.odb.
I tried on 3 different PC, all with OpenSuse 15.3 and none are working. The problem is the same on each PC/laptop.

Then I will search on my side as it's in my config somewhere.

Thanks all for your help anyway.
Olivier.
Comment 15 olivier_musson 2021-12-08 09:43:13 UTC
Hi,

For information I found my problem.

In the past, using AOO SQL driver I was doing SQL queries like this:
select * from table ... and it was working fine.

Now using the LO native SQL driver I need to prefix the query with the schema
select * from schema.table

Even if I am connected to the right MySQL schema and accessing only tables from this schema in LO.

So it's just a difference with the AOO Driver I was using before.
Comment 16 Robert Großkopf 2021-12-08 15:07:25 UTC
(In reply to olivier_musson from comment #15)
> Hi,
> 
> 
> Now using the LO native SQL driver I need to prefix the query with the schema
> select * from schema.table

It is not the schema, its the name of the database. Note: You could connect to different MariaDB-databases with the same *.odb-file, if you are permitted to used this databases. Queries could be created, which connect the databases.

If i read it right we could close this one as "WORKSFORME". Feel free to reopen, if you don't think so.
Comment 17 olivier_musson 2021-12-08 15:34:35 UTC
Robert,

Yes it's the database name, but it's also called schema in mysql-workbench this is why I mixed it.

I am already connected to multiple databases but the one where I faced the problem wasn't a multi-db one. This is why I didn't prefixed some of the queries with the DB name it wasn't useful.
Now it is, otherwise what happen to me will happen.

Thank you for your help and you can close it.