Skip to content

Commit

Permalink
fix: correct the previously unsuccessful decimal_ops sort result fix (#…
Browse files Browse the repository at this point in the history
…2869)

Signed-off-by: Zhenchi <[email protected]>
  • Loading branch information
zhongzc authored Dec 4, 2023
1 parent a9db80a commit 96e12e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INSERT INTO decimals VALUES ('0.1',1000), ('0.2',2000);

Affected Rows: 2

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM decimals;

+------+---------------------+
Expand Down Expand Up @@ -37,7 +37,7 @@ SELECT * FROM decimals WHERE d = '0.1'::DECIMAL(3,2);
+------+---------------------+

-- greater than equals
-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM decimals WHERE d >= '0.1'::DECIMAL(3,2);

+------+---------------------+
Expand Down Expand Up @@ -409,7 +409,7 @@ INSERT INTO tmp_table VALUES (1, 1000), (2, 2000), (3, 3000);

Affected Rows: 3

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM tmp_table;

+---+---------------------+
Expand All @@ -420,7 +420,7 @@ SELECT * FROM tmp_table;
| 3 | 1970-01-01T00:00:03 |
+---+---------------------+

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM tmp_table JOIN decimals ON decimals.ts = tmp_table.ts;

+---+---------------------+------+---------------------+
Expand Down
8 changes: 4 additions & 4 deletions tests/cases/standalone/common/types/decimal/decimal_ops.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE decimals(d DECIMAL(3, 2), ts timestamp time index);

INSERT INTO decimals VALUES ('0.1',1000), ('0.2',2000);

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM decimals;

-- ORDER BY
Expand All @@ -17,7 +17,7 @@ SELECT * FROM decimals WHERE d = '0.1'::DECIMAL(3,2);

-- greater than equals

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM decimals WHERE d >= '0.1'::DECIMAL(3,2);

-- what about if we use different decimal scales?
Expand Down Expand Up @@ -196,10 +196,10 @@ CREATE TABLE tmp_table(i INTEGER, ts timestamp time index);

INSERT INTO tmp_table VALUES (1, 1000), (2, 2000), (3, 3000);

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM tmp_table;

-- SQLNESS SORT 3 1
-- SQLNESS SORT_RESULT 3 1
SELECT * FROM tmp_table JOIN decimals ON decimals.ts = tmp_table.ts;

DROP TABLE decimals;
Expand Down

0 comments on commit 96e12e9

Please sign in to comment.