-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing: Directive to expose types (#183)
Use the `/* types */` directive to include each value type in the output. This is useful to verify that literals or expressions are being represented as the expected type.
- Loading branch information
1 parent
784da6b
commit 50beee4
Showing
28 changed files
with
515 additions
and
240 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
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,38 +1,51 @@ | ||
/* types */ | ||
VALUES 1 + 2; | ||
-- COL1: 3 | ||
-- COL1: 3 (INTEGER) | ||
|
||
/* types */ | ||
VALUES 1 - 2; | ||
-- COL1: -1 | ||
-- COL1: -1 (INTEGER) | ||
|
||
/* types */ | ||
VALUES 2 * 3; | ||
-- COL1: 6 | ||
-- COL1: 6 (INTEGER) | ||
|
||
/* types */ | ||
VALUES 6 / 2; | ||
-- COL1: 3 | ||
-- COL1: 3 (INTEGER) | ||
|
||
/* types */ | ||
VALUES 1.2 + 2.4; | ||
-- COL1: 3.6 | ||
-- COL1: 3.6 (DOUBLE PRECISION) | ||
|
||
/* types */ | ||
VALUES 1.7 - 0.5; | ||
-- COL1: 1.2 | ||
-- COL1: 1.2 (DOUBLE PRECISION) | ||
|
||
/* types */ | ||
VALUES 2.2 * 3.3; | ||
-- COL1: 7.26 | ||
-- COL1: 7.26 (DOUBLE PRECISION) | ||
|
||
/* types */ | ||
VALUES 6.0 / 2.5; | ||
-- COL1: 2.4 | ||
-- COL1: 2.4 (DOUBLE PRECISION) | ||
|
||
/* types */ | ||
VALUES 0.0 / 2.5; | ||
-- COL1: 0 | ||
-- COL1: 0 (DOUBLE PRECISION) | ||
|
||
/* types */ | ||
VALUES 2.5 / 0.0; | ||
-- error 22012: division by zero | ||
|
||
/* types */ | ||
VALUES -123; | ||
-- COL1: -123 | ||
-- COL1: -123 (NUMERIC) | ||
|
||
/* types */ | ||
VALUES +1.23; | ||
-- COL1: 1.23 | ||
-- COL1: 1.23 (NUMERIC) | ||
|
||
/* types */ | ||
VALUES 1.5 + 2.4 * 7.0; | ||
-- COL1: 18.3 | ||
-- COL1: 18.3 (DOUBLE PRECISION) |
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
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
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
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
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,5 +1,6 @@ | ||
/* types */ | ||
VALUES 'foo' || 'bar'; | ||
-- COL1: foobar | ||
-- COL1: foobar (CHARACTER VARYING(6)) | ||
|
||
VALUES 123 || 'bar'; | ||
-- error 42883: operator does not exist: NUMERIC || CHARACTER |
Oops, something went wrong.