Am I the crazy here or something fancy is going on :)
I have a TZReadOnly query, with the following SQL:
SELECT [...] FROM MyTable WHERE SomeField = :pID ORDER BY ID ASC
When the user changes to a different option, the query is closed, parameter value is updated and is being reopened.
All is connected to a DBGrid.
The strange thing happens when there is sorting enabled, take a look at the screenshots:
Initial state, can be seen it's ordered by ID nicely:
Now, let's manually sort it by LastChanged:
Now select a different option, closing and reopening the dataset:
The gird is not incorrect, DataSet.SortedFields is indeed empty, it should be sorted based on the SQL query (by ID).
So the sorting was somehow preserved internally, but externally it appears to be unsorted...?
Am I going nuts here, or I just messed something up badly? Can someone confirm this, please? :D
TZReadOnlyQuery preserves sorting without preserving sorting...?
TZReadOnlyQuery preserves sorting without preserving sorting...?
You do not have the required permissions to view the files attached to this post.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Re: TZReadOnlyQuery preserves sorting without preserving sorting...?
Please disregard this post. The issue was me, leaving a tiny piece of code somewhere else which manually reset the .SortedFields property.
Zeos is working fine, I just need to sleep more... :(
Zeos is working fine, I just need to sleep more... :(
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47