- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.4k
 
Closed
Description
Describe the bug
paser where table_name = select database() has exception
To Reproduce Example
       public static void main(String[] args) throws JSQLParserException {
        String sql = " select table_name, table_comment, create_time, update_time from information_schema.tables " +
                " where table_schema = (select database()) ";
        Statement statement = CCJSqlParserUtil.parse(sql);
        System.out.println(statement.toString());
    }
Exception out
Exception in thread "main" net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "=" "="
    at line 1, column 112.
Was expecting one of:
    "&"
    "::"
    ";"
    "<<"
    ">>"
    "COLLATE"
    "CONNECT"
    "EMIT"
    "GROUP"
    "HAVING"
    "START"
    "["
    "^"
    "|"
    <EOF>
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)
	at com.seerbigdata.tourism.common.config.MybatisPlusConfig.main(MybatisPlusConfig.java:158)
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "=" "="
    at line 1, column 112.
Was expecting one of:
    "&"
    "::"
    ";"
    "<<"
    ">>"
    "COLLATE"
    "CONNECT"
    "EMIT"
    "GROUP"
    "HAVING"
    "START"
    "["
    "^"
    "|"
    <EOF>
	at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:31468)
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:31301)
	at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:163)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:188)
	... 3 more
System
- MySQL-v8.0.27
 - java version "1.8.0_31"
 - JSqlParser 4.4
 
Metadata
Metadata
Assignees
Labels
No labels