Bug 157465 - SQL query produces no output in database with external HSQLDB driver (Windows-only)
Summary: SQL query produces no output in database with external HSQLDB driver (Windows...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:24.2.0 target:7.6.3
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2023-09-27 01:46 UTC by Jason Paul Kazarian
Modified: 2023-10-13 09:04 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice Base tables. Unzip to C:\WatchBase. (3.89 MB, application/octet-stream)
2023-09-27 01:58 UTC, Jason Paul Kazarian
Details
database file with hsqlembedded (417.49 KB, application/vnd.sun.xml.base)
2023-10-11 19:32 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Paul Kazarian 2023-09-27 01:46:50 UTC
Description:
If I run the following SQL command:

select "ID" from "Watches" where "Type_FK" = 39;

In SQL Workbench J connected to my Libra Office database files, I get an 11 row result set. If I use Tools -> SQL in LibreOffice Base itself, I get no output.

I did not notice the problem until upgrading to 7.6.0.0 Alpha0+. However I uninstalled that version and reinstalled 7.5.6.2 to no avail.

Is there a Base clean-up tool that I should use? Since I get different result sets in two different client tools using the HSQLDB, I'm assuming Base has the bug.



Steps to Reproduce:
1. Launch Base
2. In Tools-> SQL, check the show output box
3. Run a query linking a foreign key to a primary key

Actual Results:
None

Expected Results:
11 rows


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Attaching Zip file of Base application.
Comment 1 Jason Paul Kazarian 2023-09-27 01:58:46 UTC
Created attachment 189841 [details]
LibreOffice Base tables. Unzip to C:\WatchBase.

This is the database that works with SQL Workshop J yet not Tools -> SQL in LibreOffice base.
Comment 2 Robert Großkopf 2023-09-27 10:51:52 UTC
You are using an external connection to a HSQLDB. Tried to extract and open WatchBase.odb, but it can't work, because external driver is missing here.

Please copy the table into an internal database so everybody could try it without any problem.
Comment 3 Jason Paul Kazarian 2023-09-28 06:26:24 UTC
The attachment works. One *must* download the file to C:\. Then right click on WatchBase.zip and select Extract all... which creates the folder C:\WatchBase.

In that folder there is a Driver subdirectory. Double click on WatchBase.odb and it loads.

By the way, I do *NOT* experience this bug with 7.4.7.2. So this is a bug with 7.5.6.2.
Comment 4 Robert Großkopf 2023-09-28 06:57:02 UTC
Can't get it working under Linux. Won't install a separate JDBC-driver for HSQLDB. So I can't help here.
Comment 5 Alex Thurgood 2023-09-28 14:45:46 UTC
Connection to the database does not work on macOS.

I get the following error message when opening the ODB in the unzipped folder.

Code d'erreur: 1000

La classe de pilote "org.hsqldb.jdbcDriver" n'a pas pu être chargée.Le chemin de classe du pilote supplémentaire est "file:///C:/WatchBase/driver/hsqldb.jar".


Tried changing the file path to point to the location of the unzipped folder on my macOS system, but still get :

La classe de pilote "org.hsqldb.jdbcDriver" n'a pas pu être chargée.Le chemin de classe du pilote supplémentaire est "file:///C:/WatchBase/driver/hsqldb.jar".


This appears to be a Windows only bug requiring the use of a separately configured hsqldb.jar
Comment 6 Buovjaga 2023-10-11 10:55:54 UTC
Bibisected with Windows 7.5 repo to 6d0470ee00cbf9f9d293c92f92a759cdacbebef0
tdf#153317: direct SQL: try to detect Bit field in Mysql/MariaDB
Comment 7 Julien Nabet 2023-10-11 13:02:51 UTC
(In reply to Jason Paul Kazarian from comment #3)
> The attachment works. One *must* download the file to C:\. Then right click
> on WatchBase.zip and select Extract all... which creates the folder
> C:\WatchBase.
> 
> In that folder there is a Driver subdirectory. Double click on WatchBase.odb
> and it loads.
> ...
On LO 7.5.6.2 from Debian x86-64, the file loads but when clicking on "Tables", I got:
The connection to the data source "WatchBase" could not be established.
SQL Status: S1000
Error code: -29

File input/output error //C:/WatchBase/WatchBase Tables\wbase.properties java.io.FileNotFoundException: /C:/WatchBase/WatchBase Tables\wbase.properties.new (No such file or directory) at ./connectivity/source/drivers/jdbc/Object.cxx:173


Could you create an embedded HSQL DB and put the content in it so it'll be easier to reproduce this?
Comment 8 Julien Nabet 2023-10-11 19:32:06 UTC
Created attachment 190160 [details]
database file with hsqlembedded

On Windows 10 with master sources updated some days ago, I could reproduce this.

I copied the tables, queries, forms, reports in a brand new odb file with hsql embedded.
Comment 9 Julien Nabet 2023-10-11 20:28:49 UTC
It seems hsql calls JDBC part and when calling getBytes method it throws an exception, I don't know why.
So here's an ugly hack here:
https://gerrit.libreoffice.org/c/core/+/157849
Comment 10 Commit Notification 2023-10-13 06:36:13 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ad5659d10f20ff39f455e5f19f32b4f9f3078245

tdf#157465: getBytes may trigger an exception with hsql

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Julien Nabet 2023-10-13 07:13:34 UTC
Patch for 7.6 branch waiting for review here:
https://gerrit.libreoffice.org/c/core/+/157877
Comment 12 Commit Notification 2023-10-13 09:04:30 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/9ae4fe4e9ec27ef632fb73004db90ec86b1cb6b6

tdf#157465: getBytes may trigger an exception with hsql

It will be available in 7.6.3.

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

Affected users are encouraged to test the fix and report feedback.