New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Changing the display format of a column destroys its sort order #3603
Comments
My understanding is that once you apply a CREATE TABLE t1 (price REAL);
INSERT INTO t1 (price) VALUES (102.1),(21.2),(1.3),(2.4);
SELECT printf('%.2f', "price") as price
FROM t1
ORDER BY price
;
-- |price |
-- |------|
-- |1.30 |
-- |102.10|
-- |2.40 |
-- |21.20 | One solution to this problem is to write your own view, and order by the original column: SELECT printf('%.2f', "price") as price
FROM t1
ORDER BY t1.price
;
-- |price |
-- |------|
-- |1.30 |
-- |2.40 |
-- |21.20 |
-- |102.10| |
But the type in the database is still REAL. And a view format should not change a type to TEXT. Clicking on the header of the column should still use REAL to sort the column cells. It makes not really sense that just adding a precision of 2 to a REAL value destroy sorting of the values. |
What did you do?
I changed the display format of a column containing REAL values to printf('%.2f', "Price"). Clicking the column header to sort the table by the REAL values provides mixed ordering of values.
What did you expect to see?
I expected that changing the display format has no impact to the sort order of the column.
What did you see instead?
The sort order is unordered regarding to REAL values.
DB4S Version
3.13.0-rc1
What OS are you seeing the problem on?
Windows
OS version
No response
Relevant log output
No response
Prevention against duplicate issues
The text was updated successfully, but these errors were encountered: