-
Notifications
You must be signed in to change notification settings - Fork 489
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
Support ON UPDATE ddl statements #280
Comments
Looking at
I believe this bug may stem from the fact we seem to rely on a DELETE option always being present before an UPDATE option is seen, which is not always the case in SQL. |
I seemingly quick but probably naive way to fix this would be:
|
Thank you for reporting this issue! For some added context, Having said that, I think supporting
Are you interested in contributing this as a pull request? |
Sure. I can put up a PR. |
@EmmaLouise2018 Thank you. If you encounter any problem when you resolving this, let us know in here. |
This is actually my first time working with Yacc. Following my train of thought from above, I included the additional rule in the diff. Running I've opened up this PR and would appreciate any help/input you may have #286 |
here is another PR, that does not have grammar conflicts |
PR #331 has been merged. |
Bug Report
Looking at the ddl tests in the
testDDLSuite
, I was under the impression fromTestDDLOnUpdateRestore
that parsing sql statements with "ON UPDATE" were supported, however, in attempting to parse the following statement I encountered an error.Code snippet:
I expected this statement to be able to be parsed without an issue.
I encountered the error
"error":"line 1 column 77 near \"UPDATE CASCADE);\"
Looking closer at the current tests in
TestDDLOnUpdateRestore
All
ON UPDATE
test cases are inserted after anON DELETE CASCADE
clause. When I removed, theON DELETE
and instead usedRunNodeRestoreTest(c, testCases, "CREATE TABLE child ( id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) %s )", extractNodeFunc)
The tests for
TestDDLOnUpdateRestore
start to failAre DDL statements like
create table test(id int key, FOREIGN KEY (id) REFERENCES test2(id) ON UPDATE CASCADE);
not supported?My go.mod file looks like this:
The text was updated successfully, but these errors were encountered: