Description:
Call CCJSqlParserUtil#parse function, if a colum name is keywords like 'offset' in DDL that will be throw ParseException: Encountered unexpected token: "offset" "OFFSET"
Error test(jdk21):
public void parseDDLFromSQLite() throws JSQLParserException
{
final String ddl = """
CREATE TABLE chatmsg(
Id INTEGER PRIMARY KEY AUTOINCREMENT,
MsgType INTEGER,
offset TEXT
)
""";
var createTable = (CreateTable) CCJSqlParserUtil.parse(ddl);
}
Change "offset" to "offset_1" or other name run success:
public void parseDDLFromSQLite() throws JSQLParserException
{
final String ddl = """
CREATE TABLE chatmsg(
Id INTEGER PRIMARY KEY AUTOINCREMENT,
MsgType INTEGER,
offset_1 TEXT
)
""";
var createTable = (CreateTable) CCJSqlParserUtil.parse(ddl);
}
Description:
Call CCJSqlParserUtil#parse function, if a colum name is keywords like 'offset' in DDL that will be throw
ParseException: Encountered unexpected token: "offset" "OFFSET"Error test(jdk21):
Change "offset" to "offset_1" or other name run success: