Bug 167495 - Base opens ResultSets and does not close them
Summary: Base opens ResultSets and does not close them
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: prrvchr
URL:
Whiteboard: target:26.2.0 target:25.8.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-13 20:09 UTC by prrvchr
Modified: 2025-08-12 15:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description prrvchr 2025-07-13 20:09:53 UTC
Description:
I'm tracking down resultsets that aren't closing properly.

I found one that is often called: getVersionColumns() from the XDatabaseMetadata interface and is never closed.

This led me to line 81 of the resultcolumn.cxx file:
- https://github.com/LibreOffice/core/blob/master/dbaccess/source/core/api/resultcolumn.cxx#L81

Shouldn't the resultset be closed?


Steps to Reproduce:
Unfortunately there is currently no easy way to reproduce.

Actual Results:
ResultSets are opened by Base but are not closed.

Expected Results:
All ResultSets opened by Base must be closed.


Reproducible: Always


User Profile Reset: No

Additional Info:
No
Comment 1 Noel Grandin 2025-07-14 06:05:11 UTC
Maybe Julien is interested in this one?
Comment 2 prrvchr 2025-07-15 10:40:51 UTC
Well, since any open ResultSet must be closed, I proposed PR#187901

https://gerrit.libreoffice.org/c/core/+/187901
Comment 3 prrvchr 2025-07-15 10:47:41 UTC
And I confirm that now using Base with jdbcDriverOOo I have as many ResultSets open as closed....
Comment 4 Commit Notification 2025-07-15 11:39:00 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8fcd59e87065a44918714e5a26d99d303516b247

tdf#167495 Base need to close ResultSet after using it.

It will be available in 26.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 5 Commit Notification 2025-07-15 14:12:24 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

tdf#167495 Base need to close ResultSet after using it.

It will be available in 25.8.0.2.

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 6 prrvchr 2025-07-15 18:27:18 UTC
@ Xisco Faulí: Thanks for the backport
Comment 7 Julien Nabet 2025-07-26 19:08:58 UTC
(In reply to Noel Grandin from comment #1)
> Maybe Julien is interested in this one?

Just come back from vacation. Thank you prrvchr! (don't hesitate to put Lionel Elie Mamane in cc when it concerns Base). Even if he has less availability these days, he's still the referenced expert (see https://wiki.documentfoundation.org/FindTheExpert) and always has good advice.
Comment 8 prrvchr 2025-08-10 20:13:50 UTC
Ok I just found another one that never gets closed. I'll suggest a fix.
Comment 9 prrvchr 2025-08-10 20:26:22 UTC
Here's the fix. It's pretty simple. Thanks for pushing.

https://gerrit.libreoffice.org/c/core/+/189328
Comment 10 prrvchr 2025-08-11 01:45:45 UTC
And one more:

https://gerrit.libreoffice.org/c/core/+/189330
Comment 11 Commit Notification 2025-08-11 05:54:37 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6ec0d5f6960cb5e2104e206a3890ad3adf864467

tdf#167495 Base need to close ResultSet after using it.

It will be available in 26.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 12 Commit Notification 2025-08-11 05:54:40 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1c2e63ec15df7f314aee83d9b9be455eb8ac4ed0

tdf#167495 Base need to close ResultSet after using it.

It will be available in 26.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 13 prrvchr 2025-08-11 12:16:11 UTC
Always one more...

https://gerrit.libreoffice.org/c/core/+/189332

Maybe it's possible to backport to 25.8.x?
That would make it easier for me to finish tracking down the open ResultSet.
Comment 14 Commit Notification 2025-08-11 13:09:21 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3324db4d035c455acca5de2b75e6ad56c354ae75

tdf#167495 Base need to close ResultSet after using it.

It will be available in 26.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 15 prrvchr 2025-08-12 09:55:30 UTC
Well, another one, I hope it's the last...

https://gerrit.libreoffice.org/c/core/+/189414
Comment 16 Julien Nabet 2025-08-12 10:00:59 UTC
Lionel: put you in cc since it might interest you.
Pierre found and fixed several cases.
Comment 17 Commit Notification 2025-08-12 15:16:20 UTC
prrvchr committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8b2b75106147d0c2499283059286914ac037aa2d

tdf#167495 Base need to close ResultSet after using it.

It will be available in 26.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.