aglo / MySQLParser

A Parser for MySQL's SQL.
3 stars 6 forks source link

Postgres ~ operator throws exception with <version>0.8.5-SNAPSHOT</version> #12

Open bob-jensen opened 11 years ago

bob-jensen commented 11 years ago

Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at line 1, column 71. Encountered: "~" (126), after : "" at net.sf.jsqlparser.parser.CCJSqlParserTokenManager.getNextToken(CCJSqlParserTokenManager.java:1722)

Example:

public static void main(String[] args) { String sql = "SELECT ts, win_type FROM mysls_default.sensage_win_evt " + "WHERE win_type ~ '[Se].*' limit 250"; CCJSqlParserManager pm = new CCJSqlParserManager(); try { net.sf.jsqlparser.statement.Statement statement = pm.parse(new StringReader(sql)); } catch (JSQLParserException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. }

}