Bug 130589 - Sorting table content goes wrong, text is moved between cells
Summary: Sorting table content goes wrong, text is moved between cells
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.7.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Tables
  Show dependency treegraph
 
Reported: 2020-02-11 14:13 UTC by Fritz Schmidt
Modified: 2022-08-11 16:39 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
This is the file that shows the problem. It is in this state before sorting. (deleted)
2020-02-15 13:01 UTC, Fritz Schmidt
Details
Same file as previously, all versions are removed, so it's much smaller now. (deleted)
2020-02-17 12:20 UTC, Fritz Schmidt
Details
Please see my previous comment, testing is much easier now (204.85 KB, application/vnd.oasis.opendocument.text)
2022-05-25 16:27 UTC, Fritz Schmidt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fritz Schmidt 2020-02-11 14:13:35 UTC
Description:
I'm having a Writer document that mainly consists of a very big table. The table has 3 columns and 21895 lines. It increases each week by about 30 lines, as I add new entries. Each week I select the whole table and do a sorting (extras / Sort). At some point in time (as the table exceeded about 21000 lines) I noticed that sorting went wrong for about 40 lines:
- several lines get lost
- for other lines the cells are moved, so that e.g. text that was in column 2 was moved to column 1 or 3
I reduced the number of lines of the file by about 1000 lines: Then the sorting was correct again.

The occurrence of the problem was reproducible. 

Steps to Reproduce:
1. File is ok, number of lines is about 21000. Sorting is ok
2. Increase number of lines of the file to about 21900 lines
3. Do sorting and check outcome manually by walking through the file: About 40 lines are wrong

Actual Results:
Sorting is wrong for about 40 lines. Text that was in column 2 has moved to columns 1 or 3.

Expected Results:
Sorting is ok, no text gets moved to other columns.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
If helpful, I could provide the file that showed the problem
Comment 1 raal 2020-02-11 14:47:22 UTC
Hello,

Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug. 
I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document.
(Please note that the attachment will be public, remove any sensitive information before attaching it.)
How can I eliminate confidential data from a sample document?
https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F
Thank you
Comment 2 Fritz Schmidt 2020-02-15 13:01:35 UTC
Created attachment 157892 [details]
This is the file that shows the problem. It is in this state before sorting.

I did sorting this file. Sorting was per column 2, upwards.
Comment 3 Dieter 2020-02-16 11:57:24 UTC
I tried to reproduce it, but writer freezed, when I tried to open your document. It also seems, that you use an old version of LO. If this is the case, please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/
Comment 4 Oliver Brinzing 2020-02-16 14:57:40 UTC
(In reply to Dieter from comment #3)
> I tried to reproduce it, but writer freezed, when I tried to open your
> document.

confirming, tried to open with LO 6.0.7.3 but freezes.
Btw: The document contains 7 file "version" (-> "File/Version...")
Comment 5 Dieter 2020-02-16 20:13:14 UTC
After more than five minutes the document was open, but you really can't work with this document (LO always becomes unresponsive). Document has a size of more than 12 MB (but only around 95 pages). Does it contain images? If this is the case, could you please remove them, so we can work with it?
Comment 6 Fritz Schmidt 2020-02-16 21:41:15 UTC
No, sorry, the file has no images I could remove. It consists of a single table containing about 21900 lines and three columns. 
I edit this table once per week. I know, some patience is necessary. Also sorting takes several minutes (measured the time now for loading on my computer: 6 minutes 40 seconds).
May be, when it's loaded, it might take some additional time until you can work with it, but then it's no problem. Of course, as I wrote above, sorting takes relatively long time, also saving it takes, I guess, 10 to 20 seconds (and saving reveals a memory leak).
Comment 7 Dieter 2020-02-17 07:09:27 UTC
Perhaps, anybody else can help. I'm not an expert, but I think, there is something wrong with your document. 12MB ist too much I think, although the table is really huge.
Comment 8 Fritz Schmidt 2020-02-17 12:19:21 UTC
Thanks to Oliver who recognized that the file has 7 "versions", I was not aware of this.
I removed all versions and will upload now the new file that has 1.6 MB only now.

I was sorting the new file as usual, the outcome shows the same problems.
Comment 9 Fritz Schmidt 2020-02-17 12:20:45 UTC
Created attachment 157942 [details]
Same file as previously, all versions are removed, so it's much smaller now.
Comment 10 Buovjaga 2020-05-09 19:11:11 UTC
(In reply to Fritz Schmidt from comment #0)
> - for other lines the cells are moved, so that e.g. text that was in column
> 2 was moved to column 1 or 3

(In reply to Fritz Schmidt from comment #2)
> Sorting was per column 2, upwards.

Reproduced with attachment 157942 [details]. Considered regression testing, but the file takes seemingly forever to open with 4.4 so I won't bother.

Arch Linux 64-bit
Version: 7.0.0.0.alpha1+
Build ID: c73418d8d1258ea0a8c77c07672fd182e2b28b26
CPU threads: 8; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 9 May 2020
Comment 11 QA Administrators 2022-05-10 03:28:59 UTC Comment hidden (obsolete)
Comment 12 Fritz Schmidt 2022-05-25 16:23:59 UTC
I retested this using LibreOffice 7.2.7.2: The problem is still present.

I generated a new file that is much smaller and so eases testing. Loading the new file is relatively quickly, however sorting still takes some time.

I did some more testing and found out that the problem happens when the line count of the table in the file exceeds 21845 lines. 

I will provide this new file named Table-21846Lines.odt. When selecting the complete table and sorting it, the problem happens:
- line 1 is wrong:            1 - 1     - 10
- this line is wrong too: 21846 - 21846 -  1
- and this one too:       21846 - 10    - 10

The numbers in the three columns have different colors, so the error can be seen more easily now.

If the last line of the table is removed, so that the table has 21845 lines, the sorting result is ok.

I would like to ask somebody who has the rights to do this to remove my originally file provided and to substitute it by this new one. (Reason: New one is much easier for testing, old one is somewhat private ...). Thanks.
Comment 13 Fritz Schmidt 2022-05-25 16:27:10 UTC
Created attachment 180377 [details]
Please see my previous comment, testing is much easier now

Please see my previous comment, testing is much easier now. 

Please substitute original files by the new one.
Comment 14 Buovjaga 2022-08-11 16:39:34 UTC
The content of attachment 157942 [details] has been deleted for the following reason:

Uploader request
Comment 15 Buovjaga 2022-08-11 16:39:41 UTC
The content of attachment 157892 [details] has been deleted for the following reason:

Uploader request