Bug 82336 - CRASH - executing mysql left outer join query on multiple tables using native connector extension
Summary: CRASH - executing mysql left outer join query on multiple tables using native...
Status: RESOLVED DUPLICATE of bug 70496
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: x86-64 (AMD64) macOS (All)
: highest blocker
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 82847
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-08 08:14 UTC by Alex Thurgood
Modified: 2014-09-05 07:45 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
crash trace on multitable left outer join query (67.11 KB, text/plain)
2014-08-08 08:18 UTC, Alex Thurgood
Details
Process sampling via Mac sampling utility (111.80 KB, text/plain)
2014-08-08 08:25 UTC, Alex Thurgood
Details
create table statements (3.31 KB, text/plain)
2014-08-08 12:43 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2014-08-08 08:14:55 UTC
Attempting to execute a multi-table LEFT OUTER JOIN query to a mysql instance via the native mysql connector causes LO to crash immediately.

If the Query mode button on the main database window is clicked first, and then the query itself double-clicked to start it (request for login, then execution of query), LO goes into beachball mode, procesor occupation goes up to 70% and stays there until the application is forcibly killed. The query never gets displayed.

The same query runs from a terminal against a local mysql instance in 0.08s and returns 636 results.

The query is as follows :

SELECT * from ipgalore as t1 LEFT OUTER JOIN (priority as t2,owner_list as t3,inventor_list as t4) ON (t2.fmpro_id = t1.fmpro_id AND t3.fmpro_id = t1.fmpro_id AND t4.fmpro_id = t1.fmpro_id)

The same query runs almost instantly with LO 4233.
Comment 1 Alex Thurgood 2014-08-08 08:18:14 UTC
Created attachment 104268 [details]
crash trace on multitable left outer join query
Comment 2 Alex Thurgood 2014-08-08 08:24:44 UTC
Also works fine on :
Version: 4.1.6.2
Build ID: 40ff705089295be5be0aae9b15123f687c05b0a

with the corresponding Oracle native 1.0.1 connector
Comment 3 Alex Thurgood 2014-08-08 08:25:40 UTC
Created attachment 104269 [details]
Process sampling via Mac sampling utility
Comment 4 Alex Thurgood 2014-08-08 08:27:13 UTC
Comment on attachment 104269 [details]
Process sampling via Mac sampling utility

This sampling was made when LibreOffice did not crash, but hung - this situation occurs when the query is executed directly after opening the ODB file, i.e. it combines the parsing of the login credentials with subsequent execution of the query
Comment 5 Alex Thurgood 2014-08-08 08:32:14 UTC
Crash doesn't occur with the JDBC driver - changing title to reflect that it is limited to mysql native connector
Comment 6 Alex Thurgood 2014-08-08 08:33:50 UTC
Changed component to Extensions
Comment 7 Alex Thurgood 2014-08-08 08:38:29 UTC
Tested on :
Version: 4.4.0.0.alpha0+
Build ID: a0b89100be8ccc2b60d08d7e3819cd247a6042b0

with JDBC connector, query executes fine.
Comment 8 Lionel Elie Mamane 2014-08-08 09:50:59 UTC
The crash is in mysql client library code...

It looks similar to bug 65630.

Which MySQL connector are you using *exactly*, built from which commit in the git LibreOffice repo? The main thing I'm trying to find out is whether it uses libmysql from mysql.com or the LGPL C native client library from MariaDB.

To reproduce, I'll "obviously" need a database dump and the .odb file.
Comment 9 Lionel Elie Mamane 2014-08-08 09:53:58 UTC
This looks similar to bug 70496 which was caused by https://mariadb.atlassian.net/browse/CONC-60 , so the *first* thing to check is if you are using a MySQL-LibreOffice native connector that is "recent enough".
Comment 10 Alex Thurgood 2014-08-08 12:24:48 UTC
(In reply to comment #8)
> The crash is in mysql client library code...
> 
> It looks similar to bug 65630.
> 
> Which MySQL connector are you using *exactly*, built from which commit in
> the git LibreOffice repo? The main thing I'm trying to find out is whether
> it uses libmysql from mysql.com or the LGPL C native client library from
> MariaDB.
> 
> To reproduce, I'll "obviously" need a database dump and the .odb file.

The dump won't happen, it is one of my pro dbs, and unfortunately must remain confidential.

At best, I can provide the table descriptions.

As to the commit that bases the build of the connector, I have no idea, but am pretty certain that the library is from Mysql and not MariaDB - can one tell from the extension components ?
Comment 11 Lionel Elie Mamane 2014-08-08 12:40:08 UTC
(In reply to comment #10)
> (In reply to comment #8)

>> Which MySQL connector are you using *exactly*, built from which commit in
>> the git LibreOffice repo? The main thing I'm trying to find out is whether
>> it uses libmysql from mysql.com or the LGPL C native client library from
>> MariaDB.

> As to the commit that bases the build of the connector, I have no idea, but
> am pretty certain that the library is from Mysql and not MariaDB - can one
> tell from the extension components ?

Where did you get the connector from? Downloaded from somewhere? Built yourself?

> > To reproduce, I'll "obviously" need a database dump and the .odb file.

> The dump won't happen, it is one of my pro dbs, and unfortunately must
> remain confidential.

> At best, I can provide the table descriptions.

Yes, that's often enough. If you can populate the tables with fake (whimsical) data that still reproduces the problem, that's nicer.
Comment 12 Alex Thurgood 2014-08-08 12:43:57 UTC
Created attachment 104275 [details]
create table statements
Comment 13 Alex Thurgood 2014-08-08 12:51:16 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #8)
> 
> >> Which MySQL connector are you using *exactly*, built from which commit in
> >> the git LibreOffice repo? The main thing I'm trying to find out is whether
> >> it uses libmysql from mysql.com or the LGPL C native client library from
> >> MariaDB.
> 
> > As to the commit that bases the build of the connector, I have no idea, but
> > am pretty certain that the library is from Mysql and not MariaDB - can one
> > tell from the extension components ?
> 
> Where did you get the connector from? Downloaded from somewhere? Built
> yourself?

Yes, own build, but from 4.2 branch at time, in theory against mysql's C connector code source mysql-connector-c-6.1.2-osx10.7-x86_64
Comment 14 Lionel Elie Mamane 2014-08-08 13:03:24 UTC
(In reply to comment #13)
> (In reply to comment #11)
>> (In reply to comment #10)

>> Where did you get the connector from? Downloaded from somewhere? Built
>> yourself?

> Yes, own build, but from 4.2 branch at time, in theory against mysql's C
> connector code source mysql-connector-c-6.1.2-osx10.7-x86_64

If you built it yourself from branch "libreoffice-4-2" AND NOT from branch "master" when master was 4.2, then yes, you should theoretically have MySQL connector and not the LGPL MariaDB client library. I suppose you don't have any build log from that anymore?

To be absolutely sure, it may be worth to build the MySQL connector again, and then show me:

1) the build log
2) the "config_host.mk" from the build
Comment 15 Alex Thurgood 2014-08-08 13:35:16 UTC
FWIW, the extension can be found here :

http://sourceforge.net/projects/lomysqlconnectorextension/files/4.2/OSX64/mysql-connector-ooo.oxt/download

dated October 21st, 2013

This connector shows the same behaviour on LO 4.3 on OSX

After that date, it became impossible for me to build a functional extension on OSX, so I have no later working extensions. I was building from master at the time.
Comment 16 Alex Thurgood 2014-08-08 13:48:16 UTC
Just tested on OSX with :


Version: 4.2.4.2
Build ID: 63150712c6d317d27ce2db16eb94c2f3d7b699f8

and the query executes without crash, so the changes in LO code occurred between LO 4242 and LO 4252
Comment 17 Lionel Elie Mamane 2014-08-08 13:56:42 UTC
(In reply to comment #15)
> FWIW, the extension can be found here :
 
> http://sourceforge.net/projects/lomysqlconnectorextension/files/4.2/OSX64/
> mysql-connector-ooo.oxt/download
 
> dated October 21st, 2013

The connector switched from the MariaDB LGPL library to the MySQL GPL library on 19 October 23:03:14 (or later). The files within the .oxt are dated 2013-10-19 06:53:44. As such, they probably are based on the MariaDB LGPL library and this bug is probably a dupe of bug 70496.

> This connector shows the same behaviour on LO 4.3 on OSX

Yes, the *connector* is the important part, not that much the LibreOffice it is used with.
Comment 18 Alex Thurgood 2014-08-08 14:14:01 UTC
(In reply to comment #17)


> The connector switched from the MariaDB LGPL library to the MySQL GPL
> library on 19 October 23:03:14 (or later). The files within the .oxt are
> dated 2013-10-19 06:53:44. As such, they probably are based on the MariaDB
> LGPL library and this bug is probably a dupe of bug 70496.
> 
> > This connector shows the same behaviour on LO 4.3 on OSX
> 
> Yes, the *connector* is the important part, not that much the LibreOffice it
> is used with.

In that case I'm stuffed :-p
Comment 19 Lionel Elie Mamane 2014-09-05 07:44:50 UTC
Norbert Thiebaud kindly fixed building the MySQL connector on MacOS X, so you can try 

On master, I switched the MySQL connector back to the LGPL mariadb client C library, but to version 2 of it, which has bug 70496 fixed. This bug smells so much like a dupe of bug 70496 I'm going to mark it as such. If you can reproduce with a newer connector (either using the MySQL GPL library or the 

The following should now build & work on MacOS X, without any "system" installation of mariadb or mysql (neither C, nor C++) libraries:

 --enable-ext-mariadb-connector --without-system-mariadb --without-system-mysql-cppconn

*** This bug has been marked as a duplicate of bug 70496 ***
Comment 20 Lionel Elie Mamane 2014-09-05 07:45:33 UTC
Oups, correction:

 If you can reproduce with a newer connector (either using the MySQL GPL library or the MariaDB LGPL C connector version 2), then reopen.