Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/corpus/watcom/protected-text-control-words.expected.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE PROCEDURE dbo.protected_text_control_words()
BEGIN
-- if then else endif should stay lower-case in a comment
SELECT CASE
WHEN MESSAGE = 'if then else endif'
THEN 'select from where'
ELSE "else"
END AS RESULT
FROM dbo.audit_log
WHERE note = 'begin end if'
AND [order by] IS NOT NULL;
/* order by where select should stay lower-case in block comment */
END;
8 changes: 8 additions & 0 deletions test/corpus/watcom/protected-text-control-words.input.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
create procedure dbo.protected_text_control_words()
begin
-- if then else endif should stay lower-case in a comment
select case when message = 'if then else endif' then 'select from where' else "else" end as result
from dbo.audit_log
where note = 'begin end if' and [order by] is not null;
/* order by where select should stay lower-case in block comment */
end;
8 changes: 8 additions & 0 deletions test/corpus/watcom/protected-text-query-keywords.expected.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE PROCEDURE dbo.protected_text_query_keywords()
BEGIN
SELECT "from", [where], 'select from where order by' AS literal_value, description
FROM dbo.keyword_notes
WHERE "from" = 'order by'
AND [where] LIKE '%select%' -- group by should stay lower-case in comment
ORDER BY "from", [where];
END;
7 changes: 7 additions & 0 deletions test/corpus/watcom/protected-text-query-keywords.input.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
create procedure dbo.protected_text_query_keywords()
begin
select "from", [where], 'select from where order by' as literal_value, description
from dbo.keyword_notes
where "from" = 'order by' and [where] like '%select%' -- group by should stay lower-case in comment
order by "from", [where];
end;
Loading