-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'JSQLParser:master' into master
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/compound_statements01.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,32 @@ | ||
--- | ||
-- #%L | ||
-- JSQLParser library | ||
-- %% | ||
-- Copyright (C) 2004 - 2022 JSQLParser | ||
-- %% | ||
-- Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
-- #L% | ||
--- | ||
DECLARE | ||
PK_NAME VARCHAR(200); | ||
|
||
BEGIN | ||
EXECUTE IMMEDIATE ('CREATE SEQUENCE "untitled_table3_seq"'); | ||
|
||
SELECT | ||
cols.column_name INTO PK_NAME | ||
FROM | ||
all_constraints cons, | ||
all_cons_columns cols | ||
WHERE | ||
cons.constraint_type = 'P' | ||
AND cons.constraint_name = cols.constraint_name | ||
AND cons.owner = cols.owner | ||
AND cols.table_name = 'untitled_table3'; | ||
|
||
execute immediate ( | ||
'create or replace trigger "untitled_table3_autoinc_trg" BEFORE INSERT on "untitled_table3" for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select "untitled_table3_seq".nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from "untitled_table3" where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;' | ||
); | ||
END | ||
|
||
--@FAILURE: Encountered unexpected token: "PK_NAME" <S_IDENTIFIER> recorded first on May 27, 2022, 10:27:41 PM | ||
This comment has been minimized.
Sorry, something went wrong. |
30 changes: 30 additions & 0 deletions
30
src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/compound_statements02.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,30 @@ | ||
--- | ||
-- #%L | ||
-- JSQLParser library | ||
-- %% | ||
-- Copyright (C) 2004 - 2022 JSQLParser | ||
-- %% | ||
-- Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
-- #L% | ||
--- | ||
DECLARE | ||
n_emp_id EMPLOYEES.EMPLOYEE_ID%TYPE := &emp_id1; | ||
BEGIN | ||
DECLARE | ||
n_emp_id employees.employee_id%TYPE := &emp_id2; | ||
v_name employees.first_name%TYPE; | ||
BEGIN | ||
SELECT first_name, CASE foo WHEN 'a' THEN 1 ELSE 2 END CASE as other | ||
INTO v_name | ||
FROM employees | ||
WHERE employee_id = n_emp_id; | ||
|
||
DBMS_OUTPUT.PUT_LINE('First name of employee ' || n_emp_id || | ||
' is ' || v_name); | ||
EXCEPTION | ||
WHEN no_data_found THEN | ||
DBMS_OUTPUT.PUT_LINE('Employee ' || n_emp_id || ' not found'); | ||
END; | ||
END | ||
|
||
--@FAILURE: Encountered unexpected token: "n_emp_id" <S_IDENTIFIER> recorded first on May 27, 2022, 10:29:48 PM |
17 changes: 17 additions & 0 deletions
17
src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/compound_statements03.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,17 @@ | ||
--- | ||
-- #%L | ||
-- JSQLParser library | ||
-- %% | ||
-- Copyright (C) 2004 - 2022 JSQLParser | ||
-- %% | ||
-- Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
-- #L% | ||
--- | ||
BEGIN | ||
SELECT | ||
cols.column_name INTO :variable | ||
FROM | ||
example_table; | ||
END | ||
|
||
--@FAILURE: Encountered unexpected token: "BEGIN" "BEGIN" recorded first on May 27, 2022, 10:29:48 PM |
1 comment
on commit 85aa098
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange. However correct the parser to parse this and and passing test cases. Collect all in a proper PR.
Please why exactly are we adding Failing Test Cases?
I would like to prefer added tests of features only, which failed before, have been corrected since and will pass now.