-
Notifications
You must be signed in to change notification settings - Fork 752
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 #4902 from zhang2014/fix/ISSUE-4891
fixes(group): fix group by with negative value
- Loading branch information
Showing
5 changed files
with
53 additions
and
3 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
23 changes: 23 additions & 0 deletions
23
tests/suites/0_stateless/03_dml/03_0020_group_by_negative.result
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 @@ | ||
0 | ||
-1 | ||
-127 | ||
-128 | ||
256 | ||
127 | ||
0 | ||
-1 | ||
-32768 | ||
65535 | ||
32766 | ||
0 | ||
-1 | ||
-32768 | ||
-32769 | ||
65535 | ||
0 | ||
0 | ||
-1 | ||
-32768 | ||
-32769 | ||
65535 | ||
0 |
27 changes: 27 additions & 0 deletions
27
tests/suites/0_stateless/03_dml/03_0020_group_by_negative.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,27 @@ | ||
SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c HAVING c = 0; | ||
SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c HAVING c = -1; | ||
SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c HAVING c = -127; | ||
SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c HAVING c = -128; | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c); | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int8 AS c FROM numbers(256) GROUP BY c HAVING c > 0); | ||
|
||
SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c HAVING c = 0; | ||
SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c HAVING c = -1; | ||
SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c HAVING c = -32768; | ||
SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c HAVING c = -32769; | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c); | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int16 AS c FROM numbers(65535) GROUP BY c HAVING c > 0); | ||
|
||
SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c HAVING c = 0; | ||
SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c HAVING c = -1; | ||
SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c HAVING c = -32768; | ||
SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c HAVING c = -32769; | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c); | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int32 AS c FROM numbers(65535) GROUP BY c HAVING c > 0); | ||
|
||
SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c HAVING c = 0; | ||
SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c HAVING c = -1; | ||
SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c HAVING c = -32768; | ||
SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c HAVING c = -32769; | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c); | ||
SELECT COUNT() FROM (SELECT (0 - number) :: Int64 AS c FROM numbers(65535) GROUP BY c HAVING c > 0); |
1 change: 1 addition & 0 deletions
1
tests/suites/0_stateless/11_data_type/11_0000_data_type_numeric.result
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-1 255 | ||
-1 | ||
127 255 | ||
-128 0 |
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