Bug 461419

Summary: Kate plugin-sql: Export/Copy of output table fails to retain order
Product: [Applications] kate Reporter: Vassilis Virvilis <vasvir>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: 22.04.3   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Vassilis Virvilis 2022-11-04 13:28:23 UTC
Consider the following simple SQL that generates two rows.

SELECT 1 row, 11 col1, 12 col2, 13 col3 UNION ALL SELECT 2, 21,22, 23;

The output is:

row    col1   col2   col3
--------------------------------
1        11       12       13
2        21       22       23

but when I export or copy I get:

col1   row   col3   col2
--------------------------------
21      2        23      22
11      1       13       12

It has mixed both rows and columns.


My system:
Operating System: Debian GNU/Linux
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 6.0.0-2-amd64 (64-bit)
Graphics Platform: X11
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 31.3 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 4000
Manufacturer: Gigabyte Technology Co., Ltd.
Comment 1 Bug Janitor Service 2024-10-20 19:47:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1627
Comment 2 Christoph Cullmann 2024-10-20 20:23:47 UTC
Git commit aa9207e6242100dcf8d99c74a803cecd1aa668d0 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 20/10/2024 at 20:14.
Pushed by cullmann into branch 'master'.

Fix sql copy/export is randomly ordered

Use a vector instead of a QSet which will have random ordering

M  +16   -16   addons/katesql/dataoutputwidget.cpp

https://invent.kde.org/utilities/kate/-/commit/aa9207e6242100dcf8d99c74a803cecd1aa668d0
Comment 3 Waqar Ahmed 2024-10-21 18:08:37 UTC
Git commit 5adfcc095fa54f0269ac2c2aacd676569858e3db by Waqar Ahmed.
Committed on 21/10/2024 at 18:08.
Pushed by waqar into branch 'release/24.08'.

Fix sql copy/export is randomly ordered

Use a vector instead of a QSet which will have random ordering
(cherry picked from commit aa9207e6242100dcf8d99c74a803cecd1aa668d0)

M  +16   -16   addons/katesql/dataoutputwidget.cpp

https://invent.kde.org/utilities/kate/-/commit/5adfcc095fa54f0269ac2c2aacd676569858e3db