-
Notifications
You must be signed in to change notification settings - Fork 624
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 #3012 from masatake/sql-plsql-predefined-inquiry-d…
…irectives SQL: introduce a heuristic to distinguish PL/SQL inquiry directives and PostgreSQL dollar quoted strings
- Loading branch information
Showing
9 changed files
with
177 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sort=no |
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 @@ | ||
UW_Flag input.sql /^ALTER SESSION SET PLSQL_CCFlags = 'UW_Flag:1, Some_Flag:2, PLSQL_CCFlags:42';$/;" C | ||
Some_Flag input.sql /^ALTER SESSION SET PLSQL_CCFlags = 'UW_Flag:1, Some_Flag:2, PLSQL_CCFlags:42';$/;" C |
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 @@ | ||
This test case is taken from https://github.com/universal-ctags/ctags/issues/3006, | ||
an issue reported by @bagl. |
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,3 @@ | ||
--sort=no | ||
--extras=+q | ||
--kinds-SQL=+d |
14 changes: 14 additions & 0 deletions
14
Units/parser-sql.r/sql-plsql-inquiry-directive.d/expected.tags
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,14 @@ | ||
demo_pkg input.sql /^create or replace package body demo_pkg is$/;" P | ||
demo_pkg.test_var input.sql /^test_var varchar2(64) := $$PLSQL_UNIT;$/;" v package:demo_pkg | ||
test_var input.sql /^test_var varchar2(64) := $$PLSQL_UNIT;$/;" v package:demo_pkg | ||
demo_pkg.test_func input.sql /^function test_func return varchar2$/;" f package:demo_pkg | ||
test_func input.sql /^function test_func return varchar2$/;" f package:demo_pkg | ||
demo_pkg1 input-1.sql /^create or replace package body demo_pkg1 is$/;" P | ||
demo_pkg1.test_var1 input-1.sql /^test_var1 varchar2(64) := $$PLSQL_UNIT_OWNER;$/;" v package:demo_pkg1 | ||
test_var1 input-1.sql /^test_var1 varchar2(64) := $$PLSQL_UNIT_OWNER;$/;" v package:demo_pkg1 | ||
demo_pkg1.test_func1 input-1.sql /^function test_func1 return varchar2$/;" f package:demo_pkg1 | ||
test_func1 input-1.sql /^function test_func1 return varchar2$/;" f package:demo_pkg1 | ||
Some_Flag input-2.sql /^PLSQL_CCFlags = 'Some_Flag:1, PLSQL_CCFlags:99'$/;" C | ||
foo input-2.sql /^CREATE TABLE foo($/;" t | ||
foo.col input-2.sql /^ col text$/;" E table:foo | ||
col input-2.sql /^ col text$/;" E table:foo |
14 changes: 14 additions & 0 deletions
14
Units/parser-sql.r/sql-plsql-inquiry-directive.d/input-1.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,14 @@ | ||
-- Derrived from from https://github.com/universal-ctags/ctags/issues/3006 | ||
-- submitted by bagl | ||
create or replace package body demo_pkg1 is | ||
|
||
test_var1 varchar2(64) := $$PLSQL_UNIT_OWNER; | ||
|
||
function test_func1 return varchar2 | ||
as | ||
begin | ||
return test_var1; | ||
end; | ||
|
||
end demo_pkg1; | ||
|
11 changes: 11 additions & 0 deletions
11
Units/parser-sql.r/sql-plsql-inquiry-directive.d/input-2.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,11 @@ | ||
ALTER SESSION SET | ||
PLSQL_CCFlags = 'Some_Flag:1, PLSQL_CCFlags:99' | ||
/ | ||
BEGIN | ||
DBMS_OUTPUT.PUT_LINE($$Some_Flag); | ||
END; | ||
/ | ||
|
||
CREATE TABLE foo( | ||
col text | ||
); |
19 changes: 19 additions & 0 deletions
19
Units/parser-sql.r/sql-plsql-inquiry-directive.d/input.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,19 @@ | ||
-- Taken from https://github.com/universal-ctags/ctags/issues/3006 | ||
-- submitted by bagl | ||
// Fails to create tags after PLSQL inquiry directive is used | ||
// https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/plsql-language-fundamentals.html#GUID-E918087C-D5A8-4CEE-841B-5333DE6D4C15 | ||
// | ||
// 'parseDollarQuote' causing troubles? | ||
// | ||
create or replace package body demo_pkg is | ||
|
||
test_var varchar2(64) := $$PLSQL_UNIT; | ||
|
||
function test_func return varchar2 | ||
as | ||
begin | ||
return test_var; | ||
end; | ||
|
||
end demo_pkg; | ||
|
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