Closed arvidfm closed 5 months ago
Thanks for reporting this one! I've updated our parser to support using the CONSTRAINT
keyword without supplying a constraint name when adding a foreign key constraint. I'll get that change propagated through our dependencies and then it'll be staged to go out with our next release.
This fix made it out in Dolt 1.40.0. Let us know if you find anything else!
The MySQL grammar for foreign keys is as follows:
but Dolt treats the first part as
[CONSTRAINT symbol] FOREIGN KEY
instead of[CONSTRAINT [symbol]] FOREIGN KEY
, resulting in a syntax error if you include theCONSTRAINT
keyword but not a name.Trivial to work around by simply leaving out the
CONSTRAINT
keyword, but figured it's worth reporting still as it's technically a MySQL incompatibility that we've encountered in practice.MWE: