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

SQLParserDelegate不能解析DDL语句中的FOREIGN KEY #83

Open
long187 opened this issue Oct 26, 2017 · 0 comments
Open

SQLParserDelegate不能解析DDL语句中的FOREIGN KEY #83

long187 opened this issue Oct 26, 2017 · 0 comments

Comments

@long187
Copy link

long187 commented Oct 26, 2017

CREATE TABLE IF NOT EXISTS `test_table_normal`(  
scoreID INTEGER NOT NULL PRIMARY KEY,  
stuID     INTEGER NOT NULL,  
KEMUID     INTEGER NOT NULL,  
score     FLOAT,  
FOREIGN KEY SCORE_ID_FK (stuID) REFERENCES students (stuid),  
CONSTRAINT CHK_SCORE_ZIP CHECK (SCORE > 0)  
);  
ALTER TABLE test_table_normal
ADD FOREIGN KEY (stuID)
REFERENCES Persons(stuID);

报错:

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; Error occurs around this fragment: {FLOAT,  
FOREIGN KEY SCORE}. Error cause: unsupportted column definition
	at com.alibaba.cobar.parser.recognizer.SQLParserDelegate.parse(SQLParserDelegate.java:155)
	at com.alibaba.cobar.parser.recognizer.SQLParserDelegate.parse(SQLParserDelegate.java:160)
	at com.alibaba.cobar.parser.recognizer.SQLParserDelegate.parse(SQLParserDelegate.java:164)
	at com.alibaba.cobar.parser.recognizer.SQLParserDelegateTest.testCreateAndDropTable(SQLParserDelegateTest.java:157)
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

1 participant