-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds portions of the logic to parse `stmt_case`. Does not yet support ELSE, sql statements in THEN body, or END CASE (it uses an ENDCASE hack). Release note: None
- Loading branch information
1 parent
7b245cb
commit 3b22ee1
Showing
3 changed files
with
175 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
parse | ||
DECLARE | ||
BEGIN | ||
CASE | ||
hello | ||
WHEN | ||
world | ||
THEN | ||
ENDCASE; | ||
END | ||
---- | ||
DECLARE | ||
BEGIN | ||
CASE hello | ||
WHEN world | ||
THEN | ||
ENDCASE | ||
END | ||
|
||
parse | ||
DECLARE | ||
BEGIN | ||
CASE | ||
order_cnt | ||
WHEN | ||
1, 2, 3 | ||
THEN | ||
ENDCASE; | ||
END | ||
---- | ||
DECLARE | ||
BEGIN | ||
CASE order_cnt | ||
WHEN 1 , 2 , 3 | ||
THEN | ||
ENDCASE | ||
END | ||
|
||
parse | ||
DECLARE | ||
BEGIN | ||
CASE | ||
order_cnt | ||
WHEN | ||
1, 2, 3 | ||
THEN | ||
WHEN | ||
5 | ||
THEN | ||
ENDCASE; | ||
END | ||
---- | ||
DECLARE | ||
BEGIN | ||
CASE order_cnt | ||
WHEN 1 , 2 , 3 | ||
THEN | ||
WHEN 5 | ||
THEN | ||
ENDCASE | ||
END | ||
|
||
parse | ||
DECLARE | ||
BEGIN | ||
CASE | ||
WHEN | ||
true | ||
THEN | ||
ENDCASE; | ||
END | ||
---- | ||
DECLARE | ||
BEGIN | ||
CASE | ||
WHEN true | ||
THEN | ||
ENDCASE | ||
END | ||
|
||
parse | ||
DECLARE | ||
order_cnt integer := 10; | ||
BEGIN | ||
CASE | ||
WHEN | ||
order_cnt BETWEEN 0 AND 100 | ||
THEN | ||
WHEN | ||
order_cnt > 100 | ||
THEN | ||
ENDCASE; | ||
END | ||
---- | ||
DECLARE | ||
BEGIN | ||
CASE | ||
WHEN order_cnt between 0 and 100 | ||
THEN | ||
WHEN order_cnt > 100 | ||
THEN | ||
ENDCASE | ||
END |
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