Bug 324224

Summary: Sorting error in table views
Product: [Applications] KEXI Reporter: robert leleu <robert.jean.leleu>
Component: TablesAssignee: Jarosław Staniek <staniek>
Status: CLOSED FIXED    
Severity: major    
Priority: NOR    
Version: 2.7.2   
Target Milestone: 2.7   
Platform: Mint (Ubuntu based)   
OS: All   
Latest Commit: Version Fixed In: 2.7.3
Attachments: here is the attachment I wanted to add to the initial bug report Robert Leleu

Description robert leleu 2013-08-29 15:12:12 UTC
Sorting on a field whose some instance values have been deleted always sort according to the deleted value.

I could join a png of the error, but don't know how to join attach a file to the bug report.


Reproducible: Always
Comment 1 Jarosław Staniek 2013-08-29 20:53:02 UTC
You can attach a file using the "Add an attachment" link below, then by clicking a "Browse" button.
Comment 2 Jarosław Staniek 2013-08-30 09:29:55 UTC
Confrmed, thanks for the report. It seems that the sorting needs fixing when NULL values are present. This happens also after reopening the table and or even entire database.

Example scenario:
- Initial values in a column of Text type (sqlite database): 
1
2
3
- Second row removed:
1
[NULL]
3
- (**) Descending sorting clicked: WRONG, NULL should be at the bottom:
[NULL]
3
1
- Ascending sorting clicked: OK:
[NULL]
1
3
- Descending sorting clicked: WRONG:
3
[NULL]
1
- Ascending sorting clicked: WRONG:
1
[NULL]
3
- Descending sorting clicked: the same as (**) above
Comment 3 robert leleu 2013-08-30 12:50:09 UTC
Created attachment 82035 [details]
here is the attachment I wanted to add to the initial bug report Robert Leleu
Comment 4 Jarosław Staniek 2013-09-04 21:49:50 UTC
Git commit f96a91b4c67c7149fde0258a2a7c42a125d748a1 by Jaroslaw Staniek.
Committed on 04/09/2013 at 21:40.
Pushed by staniek into branch 'calligra/2.7'.

Fix sorting error in table views

The sorting was broken when NULL values are compared with text for text columns
FIXED-IN:2.7.3

M  +7    -5    libs/db/tableviewdata.cpp

http://commits.kde.org/calligra/f96a91b4c67c7149fde0258a2a7c42a125d748a1
Comment 5 Jarosław Staniek 2013-09-04 21:50:07 UTC
Git commit 5ab29327b76991575c73649ee65b040af6e2816c by Jaroslaw Staniek.
Committed on 04/09/2013 at 21:40.
Pushed by staniek into branch 'master'.

Fix sorting error in table views

The sorting was broken when NULL values are compared with text for text columns
FIXED-IN:2.7.3

M  +7    -5    libs/db/tableviewdata.cpp

http://commits.kde.org/calligra/5ab29327b76991575c73649ee65b040af6e2816c