Failing SQL Feature:
GROUPS cannot be used as an identifier (column, table, or alias) anymore.
The GROUPS keyword was introduced for PostgreSQL GROUPS window frames in d92f407 (#2460) and was placed into the reserved keyword token section of the grammar. However, GROUPS is a non-reserved keyword in PostgreSQL (see the key words table: GROUPS is marked "non-reserved"), so it remains a perfectly legal identifier.
As a result, SQL which parsed fine before #2460 now fails on current master.
SQL Example:
SELECT groups FROM mytable;
SELECT * FROM groups;
SELECT a AS groups FROM mytable;
SELECT a groups FROM mytable;
CREATE TABLE t (groups INT);
Each statement throws a JSQLParserException (e.g. Encountered unexpected token: "groups").
Verified on master 406a4d4.
The grammar already has the right mechanism for such keywords: tokens declared inside the NonReservedWord() production are automatically accepted as identifiers via the MIN_NON_RESERVED_WORD / MAX_NON_RESERVED_WORD range guards (used by RelObjectName() and isAliasAhead()), and KeywordsTest covers every one of them parameterized as identifiers. GROUPS just needs to move from the reserved token section into NonReservedWord().
Software Information:
- JSqlParser version: 5.4-SNAPSHOT (master 406a4d4)
- Database: PostgreSQL (affects any user with a column, table, or alias named
groups)
Failing SQL Feature:
GROUPScannot be used as an identifier (column, table, or alias) anymore.The
GROUPSkeyword was introduced for PostgreSQLGROUPSwindow frames in d92f407 (#2460) and was placed into the reserved keyword token section of the grammar. However,GROUPSis a non-reserved keyword in PostgreSQL (see the key words table:GROUPSis marked "non-reserved"), so it remains a perfectly legal identifier.As a result, SQL which parsed fine before #2460 now fails on current master.
SQL Example:
Each statement throws a
JSQLParserException(e.g.Encountered unexpected token: "groups").Verified on master 406a4d4.
The grammar already has the right mechanism for such keywords: tokens declared inside the
NonReservedWord()production are automatically accepted as identifiers via theMIN_NON_RESERVED_WORD/MAX_NON_RESERVED_WORDrange guards (used byRelObjectName()andisAliasAhead()), andKeywordsTestcovers every one of them parameterized as identifiers.GROUPSjust needs to move from the reserved token section intoNonReservedWord().Software Information:
groups)