Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6374 from dimarub2000/fix_toFloat_monotonicity
toFloat() monotonicity fixed
- Loading branch information
Showing
3 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
dbms/tests/queries/0_stateless/00979_toFloat_monotonicity.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
7777 | ||
7777 | ||
7777 | ||
7777 | ||
7777.000 | ||
7777.000 |
23 changes: 23 additions & 0 deletions
23
dbms/tests/queries/0_stateless/00979_toFloat_monotonicity.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
DROP TABLE IF EXISTS test1; | ||
DROP TABLE IF EXISTS test2; | ||
DROP TABLE IF EXISTS test3; | ||
|
||
CREATE TABLE test1 (n UInt64) ENGINE = MergeTree ORDER BY n SETTINGS index_granularity = 1; | ||
CREATE TABLE test2 (s String) ENGINE = MergeTree ORDER BY s SETTINGS index_granularity = 1; | ||
CREATE TABLE test3 (d Decimal(4, 3)) ENGINE = MergeTree ORDER BY d SETTINGS index_granularity = 1; | ||
|
||
INSERT INTO test1 SELECT * FROM numbers(10000); | ||
SELECT n FROM test1 WHERE toFloat64(n) = 7777.0 SETTINGS max_rows_to_read = 2; | ||
SELECT n FROM test1 WHERE toFloat32(n) = 7777.0 SETTINGS max_rows_to_read = 2; | ||
|
||
INSERT INTO test2 SELECT toString(number) FROM numbers(10000); | ||
SELECT s FROM test2 WHERE toFloat64(s) = 7777.0; | ||
SELECT s FROM test2 WHERE toFloat32(s) = 7777.0; | ||
|
||
INSERT INTO test3 SELECT toDecimal64(number, 3) FROM numbers(10000); | ||
SELECT d FROM test3 WHERE toFloat64(d) = 7777.0 SETTINGS max_rows_to_read = 2; | ||
SELECT d FROM test3 WHERE toFloat32(d) = 7777.0 SETTINGS max_rows_to_read = 2; | ||
|
||
DROP TABLE test1; | ||
DROP TABLE test2; | ||
DROP TABLE test3; |