Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER TABLE ADD FOREIGN KEY fails on Table Schema #1156

Closed
manticore-projects opened this issue Apr 13, 2021 · 1 comment
Closed

ALTER TABLE ADD FOREIGN KEY fails on Table Schema #1156

manticore-projects opened this issue Apr 13, 2021 · 1 comment

Comments

@manticore-projects
Copy link
Contributor

Valid at least in H2 and Oracle:

-- ALTER TABLE ADD FOREIGN KEY
ALTER TABLE cfe.ledger_acc_entry_manual
ADD FOREIGN KEY (id_manual_posting_batch) REFERENCES cfe.manual_posting_batch(id_manual_posting_batch);
net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "." "."
    at line 2, column 57.

Was expecting one of:

    "("
    ","
    ";"
    <EOF>

	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:188)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:176)

I will try to fix it in the JavaCC Parser and send a PR.

manticore-projects added a commit to manticore-projects/JSqlParser that referenced this issue Apr 13, 2021
@manticore-projects
Copy link
Contributor Author

Fixed in PR #1153.

wumpz pushed a commit that referenced this issue Apr 16, 2021
* Implement Oracle Hints for INSERT, UPDATE, MERGE, DELETE

* Correct CreateIndex TailOptions
Add a Test Case for CreateIndex TailOptions

* Add WHERE expression to MergeInsert
Add test case for MergeInsert WHERE expression

* Fix Issue #1156: ALTER TABLE ADD FOREIGN KEY with schema reference
Add a specific test case
@wumpz wumpz closed this as completed Apr 16, 2021
wumpz pushed a commit that referenced this issue Apr 20, 2021
* Implement Oracle Hints for INSERT, UPDATE, MERGE, DELETE

* Correct CreateIndex TailOptions
Add a Test Case for CreateIndex TailOptions

* Add WHERE expression to MergeInsert
Add test case for MergeInsert WHERE expression

* Fix Issue #1156: ALTER TABLE ADD FOREIGN KEY with schema reference
Add a specific test case

* Fix Issue #1157: Oracle does not accept COLUMN keyword in ALTER TABLE ADD/MODIFY
Correct the test cases accepting a non existing COLUMN keyword
Add a specific test cases

* Fix Issue #1164 UNIQUE after PRIMARY KEY
Add test case for UNIQUE after PRIMARY KEY

* Switch of warnings for un-fixble method namings

* Switch of warnings for un-fixble method namings

* Activate PMD and define our own ruleset

* Execute PMD before building/testing in order to fail early

* Fix 63 PMD warnings

* Activate rule "PMD.CyclomaticComplexity" in order to simulate the Codazy checks
Apply @SuppressWarnings({"PMD.CyclomaticComplexity"}) where this rule throws an unavoidable warning (especially for toString() and deparse())

* Activate rule , "PMD.ExcessiveMethodLength" in order to simulate the Codazy checks
Apply @SuppressWarnings({"PMD.ExcessiveMethodLength"}) where this rule throws an unavoidable warning (especially for toString() and deparse())
Refactor an ENUM name

* Refactor an ENUM name and reflect this also in the JavaCC Parser definition file
wumpz pushed a commit that referenced this issue Apr 21, 2021
* javadoc-fixes

* fix check-style error : assignment to parameter not allowed

* import for javadoc reference

* javadoc - add description to parameter "fqn" (fix warning)

* remove doclint=none, but exclude package with exclude package with
generated sources (javacc/jjtree) from javadoc

* Implement Oracle Hints for INSERT, UPDATE, MERGE, DELETE

* Correct CreateIndex TailOptions
Add a Test Case for CreateIndex TailOptions

* Add WHERE expression to MergeInsert
Add test case for MergeInsert WHERE expression

* Fix Issue #1156: ALTER TABLE ADD FOREIGN KEY with schema reference
Add a specific test case

* Fix Issue #1157: Oracle does not accept COLUMN keyword in ALTER TABLE ADD/MODIFY
Correct the test cases accepting a non existing COLUMN keyword
Add a specific test cases

* Fix Issue #1164 UNIQUE after PRIMARY KEY
Add test case for UNIQUE after PRIMARY KEY

* Switch of warnings for un-fixble method namings

* Switch of warnings for un-fixble method namings

* Activate PMD and define our own ruleset

* Execute PMD before building/testing in order to fail early

* Fix 63 PMD warnings

* Activate rule "PMD.CyclomaticComplexity" in order to simulate the Codazy checks
Apply @SuppressWarnings({"PMD.CyclomaticComplexity"}) where this rule throws an unavoidable warning (especially for toString() and deparse())

* Activate rule , "PMD.ExcessiveMethodLength" in order to simulate the Codazy checks
Apply @SuppressWarnings({"PMD.ExcessiveMethodLength"}) where this rule throws an unavoidable warning (especially for toString() and deparse())
Refactor an ENUM name

* Refactor an ENUM name and reflect this also in the JavaCC Parser definition file

Co-authored-by: gitmotte <www@synbee.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants