Bug 150647 - Autofilter result is wrong when filtering (empty) records
Summary: Autofilter result is wrong when filtering (empty) records
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.0 beta1+
Hardware: x86-64 (AMD64) Linux (All)
: high major
Assignee: Luboš Luňák
URL:
Whiteboard: target:7.5.0 target:7.4.3 target:7.3....
Keywords: bibisected, bisected, regression
Depends on:
Blocks: AutoFilter
  Show dependency treegraph
 
Reported: 2022-08-28 17:05 UTC by Kevin Suo
Modified: 2022-10-05 07:52 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
test.ods (44.04 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-08-28 17:05 UTC, Kevin Suo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2022-08-28 17:05:02 UTC
Created attachment 182055 [details]
test.ods

Steps to Reproduce:

1. Open the attached test ods file.
Observe that there are 7581 records.
(Note that the non empty items in column E are prefixed with several spaces.)

2. Click on the autofilter dropdown in column E named "Cashflow Item", make the item named "(Empty)" unchecked (i.e. all other non-empty items are checked), then click OK.
--> Good, there are 47 non-empty records.

3. Click on the autofilter dropdown in column E again, make the item named "(Empty") checked (i.e., all other non-empty items are not checked).

Current Result:
None records are shown in step 3.

Expected:
There are 7581 - 47 = 7534 records are empty in column E, thus 7534 records should show up in step 3.

It works OK if you filter in column B.

Version: 7.3.6.1 / LibreOffice Community
Build ID: 92b673af3a5e8f7cf4716be88dfaca424612f244
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Calc: threaded
Comment 1 Kevin Suo 2022-08-28 17:19:47 UTC
Bibisected to the following range which covers 3 commits:
7d730cd58..938c89983

in which the following seems related:

commit 938c899831bd5b165b2b7db3945867a1ce155483
Author: Xisco Fauli <xiscofauli@libreoffice.org>
Date:   Wed Aug 17 12:59:51 2022 +0200

    tdf#150452: Revert "tdf#130795 use concurrent hashmap in SharedStringPool"

Adding cc to Xisco Fauli: any idea? I don't think we should do a "revert revert".
Comment 2 Stéphane Guillou (stragu) 2022-08-29 16:46:57 UTC
Reproduced with:

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 24087697d5cf78aac346d4dcea0596373e15a95c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 3 Xisco Faulí 2022-09-07 14:22:47 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2022-09-07 14:36:03 UTC
Also reproduced in

Version: 7.3.7.0.0+ / LibreOffice Community
Build ID: d0312786571221c2dd4f63fa69f6f0489d7d39ec
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 5 Xisco Faulí 2022-09-07 18:53:37 UTC Comment hidden (obsolete)
Comment 6 Xisco Faulí 2022-09-08 08:46:19 UTC
an update on this, I'm bisecting it manually building LibreOffice on every step reverting 938c899831bd5b165b2b7db3945867a1ce155483 and the commit introduced the issue is in this range: https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=899e8f813c559384ba11eb1d4ceafaf29b5e73a9..3d09becf194bf1702a389ee59a7d6df899a570dd. 6 steps to go...
Comment 7 Xisco Faulí 2022-09-08 08:56:44 UTC
Regression introduced by 

author	Luboš Luňák <l.lunak@collabora.com>	2021-11-23 21:15:23 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2021-11-23 22:41:28 +0100
commit 990d32dad6bdf5d92a14d8bc02ae2853facd9097 (patch)
tree b049c19cf6664ba7960c8ed522031a577353d8b6
parent 758ff97066652fbdd960121d42e659d3ab90e7d4 (diff)
allow matching of empty cells as svl::SharedString (tdf#133804)
This may speed up some lookups.

when 938c899831bd5b165b2b7db3945867a1ce155483 is not in place

@Luboš, I'm wondering whether we should just revert that patch now ?
Comment 8 Kevin Suo 2022-09-08 12:40:28 UTC
Adjusting the version field to 7.3 accordingly as this also affects 7.3 branch.
Comment 9 Commit Notification 2022-09-23 09:52:34 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

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

make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)

It will be available in 7.5.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 10 Commit Notification 2022-09-26 10:36:38 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/15d1660ef04492bfffe4fd30d7c1942499d44f0c

make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)

It will be available in 7.4.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.
Comment 11 Commit Notification 2022-09-26 10:37:50 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/66ebf61975a5d8d860eda5e661c5a82a9ca763b7

make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)

It will be available in 7.3.7.

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 Xisco Faulí 2022-09-27 10:44:40 UTC
Verified in

Version: 7.4.3.0.0+ / LibreOffice Community
Build ID: 403ff3d3ccba1498568e82e4840a12e53a188406
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

I guess we can close it as VERIFIED FIXED
Comment 13 Xisco Faulí 2022-09-27 10:45:27 UTC
Thanks Lubos for fixing this issue!!
Comment 14 Commit Notification 2022-10-05 07:52:54 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-2":

https://git.libreoffice.org/core/commit/97715aacd8aa32bbd0fd4e0a3fa0bdb8e7fbeaa5

make sure SharedString::EMPTY_STRING is interned in pools (tdf#150647)

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