[jOOQ/jOOQ#12712] Parser mis-interprets KEY columns as MySQL KEY (INDEX) specification if unquoted and of type VARCHAR(n)

This commit is contained in:
Lukas Eder 2021-12-08 14:14:07 +01:00
parent d071fda2ef
commit 4f25c51d03

View File

@ -4279,11 +4279,14 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
int p2 = position();
// [#7348] [#7651] [#9132] Look ahead if the next tokens
// indicate a MySQL index definition
if (parseIf('(') || (parseIdentifierIf() != null
&& parseUsingIndexTypeIf()
&& parseIf('('))) {
// [#7348] [#7651] [#9132] [#12712]
// Look ahead if the next tokens indicate a MySQL index definition
if (parseIf('(') || (
parseDataTypeIf(false) == null
&& parseIdentifierIf() != null
&& parseUsingIndexTypeIf()
&& parseIf('('))
) {
position(p2);
indexes.add(parseIndexSpecification(tableName));