You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.out.println("size is:" + stmtList.size());
for (int i = 0; i < stmtList.size(); i++) {
Statement stmt = stmtList.get(i);
TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
List<String> tableList = tablesNamesFinder.getTableList(stmt);
System.out.println("Tables : " + tableList);
}
exception:
Exception in thread "main" net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:154)
at com.netease.backend.rds.websql.test.rds.TestDruid.main(TestDruid.java:34)
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "max_rows" <S_IDENTIFIER>
at line 1, column 17.
Was expecting one of:
"ADD"
"DROP"
"MODIFY"
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:18597)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:18447)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterExpression(CCJSqlParser.java:11652)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterTable(CCJSqlParser.java:11665)
at net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:157)
at net.sf.jsqlparser.parser.CCJSqlParser.Statements(CCJSqlParser.java:430)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:152)
... 1 more
Caused by:
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "max_rows" <S_IDENTIFIER>
at line 1, column 17.
Was expecting one of:
"ADD"
"DROP"
"MODIFY"
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:18597)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:18447)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterExpression(CCJSqlParser.java:11652)
at net.sf.jsqlparser.parser.CCJSqlParser.AlterTable(CCJSqlParser.java:11665)
at net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:157)
at net.sf.jsqlparser.parser.CCJSqlParser.Statements(CCJSqlParser.java:430)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:152)
The text was updated successfully, but these errors were encountered:
like this:
alter table abc max_rows = 1000;
jsqlparser code:
String result = SQLUtils.format(sql, dbType);
System.out.println(result);
Statements stmts = CCJSqlParserUtil.parseStatements("alter table abc max_rows = 1000;");
List stmtList = stmts.getStatements();
exception:
Exception in thread "main" net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatements(CCJSqlParserUtil.java:154)
at com.netease.backend.rds.websql.test.rds.TestDruid.main(TestDruid.java:34)
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "max_rows" <S_IDENTIFIER>
at line 1, column 17.
Was expecting one of:
Caused by:
net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "max_rows" <S_IDENTIFIER>
at line 1, column 17.
Was expecting one of:
The text was updated successfully, but these errors were encountered: