-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More testing for SQL trickery (#109)
This PR improves the ergonomics for adding queries which all have the same error, and uses that to add a bunch more "skullduggery detected" fixtures. Unfortunately I realize that a case has slipped through, and the fix is non-trivial. Needs further discussion. Also fixed an issue where the "all the components" function was not actually catching JSQLParser exceptions.
- Loading branch information
1 parent
4142daf
commit 0110ed3
Showing
13 changed files
with
105 additions
and
72 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
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
4 changes: 4 additions & 0 deletions
4
test/resources/acceptance/dynamic__select_function.analysis.edn
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,4 @@ | ||
{:error :macaw.error/illegal-expression | ||
:overrides | ||
{:select-only | ||
{:tables #{}}}} |
2 changes: 2 additions & 0 deletions
2
test/resources/acceptance/misc__implicit_semicolons.analysis.edn
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,2 @@ | ||
{:source-columns [] | ||
:tables [{:table "t"}]} |
2 changes: 2 additions & 0 deletions
2
test/resources/acceptance/misc__implicit_semicolons.renames.edn
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,2 @@ | ||
{:tables {{:table "t"} "s"} | ||
:columns {}} |
5 changes: 5 additions & 0 deletions
5
test/resources/acceptance/misc__implicit_semicolons.rewritten.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,5 @@ | ||
SELECT 1 | ||
-- NOTE: don't remove the number of blank lines here, they're significant | ||
|
||
|
||
FROM s |
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,5 @@ | ||
SELECT 1 | ||
-- NOTE: don't remove the number of blank lines here, they're significant | ||
|
||
|
||
FROM t |
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 @@ | ||
-- FIXTURE: generate-series | ||
SELECT t.day::date AS date | ||
FROM generate_series(timestamp '2021-01-01', now(), interval '1 day') AS t(day) | ||
|
||
-- FIXTURE: format | ||
SELECT * FROM format('%I', table_name_variable); | ||
|
||
-- FIXTURE: prepared-stmt | ||
EXECUTE stmt('table_name'); | ||
|
||
-- FIXTURE: variable | ||
-- BROKEN | ||
EXECUTE 'SELECT * FROM ' || table_name; | ||
|
||
-- FIXTURE: call-function | ||
CALL user_function('table_name'); | ||
|
||
-- FIXTURE: select-function | ||
SELECT user_function('table_name'); | ||
|
||
-- FIXTURE: cursor | ||
-- BROKEN | ||
FETCH ALL FROM my_cursor; |
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,2 +1 @@ | ||
{:error :macaw.error/invalid-query | ||
:overrides {:ast-walker-1 :macaw.error/unable-to-parse}} | ||
{:error :macaw.error/invalid-query} |
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,2 +1 @@ | ||
{:error :macaw.error/invalid-query | ||
:overrides {:ast-walker-1 :macaw.error/unable-to-parse}} | ||
{:error :macaw.error/invalid-query} |