[Bug] Storage Databaseutis parse sql with keyword error
mr3 opened this issue · 0 comments
mr3 commented
Search before asking
- I have searched the existing issues before asking.
AREX Test Service
Schedule Service (arextest/arex-replay-schedule)
Current Behavior
The sql contains extended
keyword, which causes the parsing to fail with the following exception
2024-05-21 09:56:59.887 [main] waR com.arextest.storage.utils.Databaseutis - parse sql error, sql: SELECT address,extended,union_user_id FROM access_token WHERE ( user id = ? ) LIMIT ? net.sf.jsqlparser.jsoLParserException: net.sf.jsqlparser.parser.parseException: Encountered unexpected token: "" " "
at line 1, column 292.
Expected Behavior
Databaseutis parse sql success
Steps To Reproduce
@Test
public void parseSQLWithKeyWord() {
String sql = "SELECT address,extended,union_user_id FROM access_token WHERE ( user_id = ? ) LIMIT ?";
TableSchema tableSchema = DatabaseUtils.parse(sql);
assertEquals("access_token", StringUtils.join(tableSchema.getTableNames(), ","));
}
Anything else
No response
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!