Bug 119850 - Database creation wizard dialog missing mysql connector options
Summary: Database creation wizard dialog missing mysql connector options
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0
Keywords: bibisected, regression
Depends on:
Blocks: 119139 MariaDB 119786
  Show dependency treegraph
 
Reported: 2018-09-13 14:22 UTC by Alex Thurgood
Modified: 2019-07-30 14:22 UTC (History)
7 users (show)

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


Attachments
First dialog in db wizard in LibO 6.2 alpha (59.54 KB, image/png)
2018-09-13 14:24 UTC, Alex Thurgood
Details
Second dialog in db wizard in LibO 6.2.alpha (29.08 KB, image/png)
2018-09-13 14:24 UTC, Alex Thurgood
Details
third dialog in wizard in LibO ≤ 6.1 (35.96 KB, image/png)
2018-09-13 15:09 UTC, Lionel Elie Mamane
Details
Database Connection Properties Dialog (44.66 KB, image/png)
2018-09-26 10:54 UTC, Alex Thurgood
Details
Test file - adjust as required for your own particular mysql connection (3.27 KB, application/vnd.oasis.opendocument.database)
2018-09-26 11:30 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2018-09-13 14:22:27 UTC
Description:
In current master builds:
1) Start the DB creation wizard dialog.
2) Click on connect to existing database and look at the dropdown list. There is an entry called "Mysql Connector" - this is new, previously it was just MySQL and choosing it used to lead to a second dialog screen where the user could select the type of mysql connector.
3) If you now choose MySQL connector, you are led straight to the db/hostname dialog of the native connector, completely bypassing the other previously available screens.

This is a regression. Screenshots enclosed

Steps to Reproduce:
See above

Actual Results:
Only native connector configuration dialog is available.

Expected Results:
The first dialog entry should just show "MySQL" and selecting this should lead to the dialog page allowing the type of connector to be used.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Alex Thurgood 2018-09-13 14:24:28 UTC
Created attachment 144842 [details]
First dialog in db wizard in LibO 6.2 alpha
Comment 2 Alex Thurgood 2018-09-13 14:24:58 UTC
Created attachment 144844 [details]
Second dialog in db wizard in LibO 6.2.alpha
Comment 3 Robert Großkopf 2018-09-13 14:33:14 UTC
Hi Alex,

where did you get a working native connector for MySQL? I have tried the last from here:
https://extensions.libreoffice.org/extensions/mysql-native-connector

Doesn't work on my system (OpenSUSE 15.0), so I can't test any bugs of this connector ...
Comment 4 Alex Thurgood 2018-09-13 14:42:20 UTC
(In reply to robert from comment #3)
> Hi Alex,
> 
> where did you get a working native connector for MySQL? I have tried the
> last from here:
> https://extensions.libreoffice.org/extensions/mysql-native-connector
> 


Hi Robert, it is now built-in by default in master, a lot of changes were pushed recently to integrate it directly so that it became one of the bundled extensions.
Comment 5 Julien Nabet 2018-09-13 15:00:25 UTC
On Win7 with LO 6.1.0.3, I got "Mysql" then ODBC or JDBC connection.

Tamas: thought you might be interested in this one. Perhaps was it on purpose?
Comment 6 Lionel Elie Mamane 2018-09-13 15:08:35 UTC
The former third dialog of the wizard was also much nicer, holding the user's hand to setup the connection. We should definitely be using that!
Comment 7 Lionel Elie Mamane 2018-09-13 15:09:39 UTC
Created attachment 144846 [details]
third dialog in wizard in LibO ≤ 6.1
Comment 8 Alex Thurgood 2018-09-13 16:19:01 UTC
(In reply to Julien Nabet from comment #5)
> On Win7 with LO 6.1.0.3, I got "Mysql" then ODBC or JDBC connection.
> 

Hi Julien,
Yes, these were the defaults when no additional native connector extension was installed. If the native connector extension was also installed, you got a radio button option for that too, so a total of 3 entries.
Comment 10 Xisco Faulí 2018-09-17 11:49:56 UTC
(In reply to Julien Nabet from comment #9)
> Regression from
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=26b40fcfc67480e75bd9959b0c5cb9db10fdf6a1 ?

The dialog is fine in the commit previous to that one. Then, for some commit the MySQL entry is gone and reintroduced in https://cgit.freedesktop.org/libreoffice/core/commit/?id=a67acf8e6127e33dc9ba5f75e097aa27ad5fe952 where the problem is already reproducible...
Comment 11 Julien Nabet 2018-09-17 12:13:57 UTC
(In reply to Xisco Faulí from comment #10)
> (In reply to Julien Nabet from comment #9)
>...
> The dialog is fine in the commit previous to that one. Then, for some commit
> the MySQL entry is gone and reintroduced in
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=a67acf8e6127e33dc9ba5f75e097aa27ad5fe952 where the problem is already
> reproducible...

Yep, I suppose Tamas removed the old drivers then implemented the last one but without registering it first so no Mysql entry. Then the second quoted commit registered the last driver he implemented and so Mysql entry reappeared (but in its new form).
Of course, I may be wrong.
Comment 12 Commit Notification 2018-09-22 16:44:54 UTC
Tamas Bunth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=37dba4f25f00ffc1a1a631772eadd50e998966c1

tdf#119850 show missing mysql connector options

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 13 Alex Thurgood 2018-09-26 09:05:50 UTC
@Tamas : it would appear that your changes have had a major side effect in which the existing jdbc driver class string is not only no longer read from existing ODB files (the advanced connection properties dialog shows an empty box), but additionally, any newly re-entered class string is ignored, even when the file is saved before closing...
Comment 14 Alex Thurgood 2018-09-26 09:08:47 UTC
(In reply to Alex Thurgood from comment #13)
> @Tamas : it would appear that your changes have had a major side effect in
> which the existing jdbc driver class string is not only no longer read from
> existing ODB files (the advanced connection properties dialog shows an empty
> box), but additionally, any newly re-entered class string is ignored, even
> when the file is saved before closing...

The end result being that not only do existing ODB files display an error message when attempting to load any of the tables, queries, reports, etc, but additionally, the user is now forced to re-enter the jdbc class string each time...
Comment 15 Alex Thurgood 2018-09-26 09:10:56 UTC
Tested against :

Version: 6.2.0.0.alpha0+
Build ID: 030181b37d2b7edd7cab20ceb7736e575186f99b
CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: threaded
Comment 16 Tamas Bunth 2018-09-26 09:50:30 UTC
Hi Alex,

(In reply to Alex Thurgood from comment #13)
> @Tamas : it would appear that your changes have had a major side effect in
> which the existing jdbc driver class string is not only no longer read from
> existing ODB files (the advanced connection properties dialog shows an empty
> box), but additionally, any newly re-entered class string is ignored, even
> when the file is saved before closing...

Thank you for testing. Could you please explain in detail, how I can reproduce that? Could you also attach an ODB file of that kind?

What is a class string?
Comment 17 Lionel Elie Mamane 2018-09-26 10:24:21 UTC
(In reply to Tamas Bunth from comment #16)

> What is a class string?

The name of a Java class. In this general context, this Java class is supposed to expose the JDBC interfaces, and be a driver to a DBMS. In this particular context, a driver to MySQL.

When one uses the wizard to create a new odb, and chooses "MySQL", the next question is (was?) "what driver?", with a choice between ODBC, JDBC and native (if installed...).

For ODBC you give a DSN source name. It better be a MySQL source, but that's not technically checked/guaranteed. The connection, on the LibreOffice/SDBC side is then an ODBC one, but some settings are automatically hardcoded to the right ones for MySQL.

For JDBC you give a "class name" and parameters. The class name tells LibreOffice which driver to load (what Java class). Again, it better be a MySQL driver, but that's not technically checked/guaranteed. The connection, on the LibreOffice/SDBC side is then a JDBC one, but some settings are automatically hardcoded to the right ones for MySQL.

Native, I think you understand :) That's the one that you remade, excising out the MySQL C++ connector.
Comment 18 Alex Thurgood 2018-09-26 10:53:42 UTC
(In reply to Tamas Bunth from comment #16)

Hi Tamas,

> Thank you for testing. Could you please explain in detail, how I can
> reproduce that? Could you also attach an ODB file of that kind?
> 
> What is a class string?

Lionel has explained that part. For the mysql jdbc connector this string is :

com.mysql.jdbc.Driver


For MariaDB, the class string is :

org.mariadb.jdbc.Driver

This string is supposed to be saved, and retrieved and displayed in the enclosed screenshot dialog.
Comment 19 Alex Thurgood 2018-09-26 10:54:56 UTC
Created attachment 145175 [details]
Database Connection Properties Dialog
Comment 20 Alex Thurgood 2018-09-26 10:57:27 UTC
@Tamas :

I can attach an ODB file, but you would need to alter the connection configuration to suit your own mysql connection, userID/pwd and test db.
Comment 21 Alex Thurgood 2018-09-26 11:12:11 UTC
@Tamas : the problem doesn't happen with newly created ODB files on master that use the mysql JDBC connector via the wizard, but it does with ODB files created when you choose the JDBC option in the first step of the wizard.

This also affects previously created JDBC connected filesmade with older versions of LO.
Comment 22 Alex Thurgood 2018-09-26 11:24:26 UTC
For example, I see this in the content.xml of the corresponding ODB file:

<db:data-source-settings><db:data-source-setting db:data-source-setting-is-list="false" db:data-source-setting-name="JavaDriverClass" db:data-source-setting-type="string"><db:data-source-setting-value>com.mysql.jdbc.Driver</db:data-source-setting-value></db:data-source-setting><db:data-source-setting db:data-source-setting-is-list="false" db:data-source-setting-name="Type" db:data-source-setting-type="string"><db:data-source-setting-value>simple</db:data-source-setting-value></db:data-source-setting></db:data-source-settings></db:application-connection-settings></db:data-source><db:table-representations><db:table-representation db:name="test.AC"/></db:table-representations></office:database></office:body></office:document-content>


however, the Java class string isn't picked up or displayed in the dialog when the file is re-opened and an attempt is made to read any of the tables, queries, etc.
Comment 23 Alex Thurgood 2018-09-26 11:30:06 UTC
Created attachment 145178 [details]
Test file - adjust as required for your own particular mysql connection
Comment 24 Alex Thurgood 2018-09-26 11:34:19 UTC
@Tamas :

You need to create a database called "test" on your mysql server, and then a table "AC" as follows:


CREATE TABLE `AC` (
  `bid` int(10) NOT NULL AUTO_INCREMENT,
  `Ac` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Cur` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
  `dt` datetime DEFAULT NULL,
  PRIMARY KEY (`bid`),
  KEY `cur` (`Cur`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

and then add some data to it

or else modify the content.xml of the ODB file to point to an already existing db and table.
Comment 25 Julien Nabet 2019-03-17 10:18:15 UTC
On pc Debian x86-64 with master sources updated today, with MariaDB 10.3.13, I don't reproduce this.

Here what I did:
- followed comment 24 to create table named "AC" in a database call "test"
- retrieved https://bugs.documentfoundation.org/attachment.cgi?id=145178 file
- opened the file and changed database properties to replace xx.xx... by localhost + replace user "Alex" by "julien" and filled password
- opened AC table
- add some data

Did I miss something?
Comment 26 Alex Thurgood 2019-03-18 08:11:42 UTC
Hi Julien,

Yes, possibly.

According to my findings in comment 21 :

"the problem doesn't happen with newly created ODB files on master that use the mysql JDBC connector via the wizard, but it does with ODB files created when you choose the JDBC option in the first step of the wizard. This also affects previously created JDBC connected filesmade with older versions of LO."
Comment 27 Julien Nabet 2019-03-18 08:17:35 UTC
(In reply to Alex Thurgood from comment #26)
> ...
> "the problem doesn't happen with newly created ODB files on master that use
> the mysql JDBC connector via the wizard, but it does with ODB files created
> when you choose the JDBC option in the first step of the wizard. This also
> affects previously created JDBC connected filesmade with older versions of
> LO."

Yes there are 2 parts:
1) new odb with JDBC as first choice
=> I didn't test this indeed, I'll give it a try

2) old odb
=> I used the you had attached and had no problem (once I changed server/user/password)
Comment 28 Alex Thurgood 2019-07-30 14:02:55 UTC
I still can't connect to mysql server instances using the "JDBC" connection option in the DB creation wizard (master 6.4 macOS)

No matter which strings I attempt to enter as the connection parameters, the connection fails.

Note that I'm not talking about the MySQL option in the wizard 1st step, but the JDBC option.
Comment 29 Alex Thurgood 2019-07-30 14:22:10 UTC
OK, the problem is that the new JDBC dialog prefixes jdbc: outside of the URL entry box, whereas previously, this was included automatically in that box (but unmodifiable).

As a result :

(1) the current help is incorrect as it suggests that the whole string to be entered should contain both "jdbc:" and "mysql://" 

(2) people who configured their mysql jdbc connections the old way are in for a surprise...

Perhaps we should close this again as RESOLVED and open a new report for the string issue.