sevens66 opened a new issue #6365:
URL: https://github.com/apache/shardingsphere/issues/6365


   this  Sql can  works well  in version 4.0.0 RC2 or4.0.0 RC3
   but in 4.1.0 or 4.1.1 will throw NullPointerException
   
   
   Sql:
   `SELECT
        menu.menu_Id AS id,
        menu.menu_Title AS text,
        menu.parent_Id AS parentId,
        menu.menu_icon AS iconCls,
        menu.menu_Url AS menuUrl,
        menu.menu_name AS menuName,
        menu.params AS DATA,
        menu.target
   FROM
        wrh_sys_menu menu
   WHERE
        EXISTS (
                SELECT
                        1
                FROM
                        wrh_sys_menu m
                LEFT JOIN wrh_sys_menu m1 ON m1.menu_id = m.PARENT_ID
                LEFT JOIN wrh_sys_menu m2 ON m2.menu_id = m1.parent_id
                WHERE
                        m.menu_id IN 
(278,279,280,282,283,285,287,289,291,292,308,309,310,311,320,322,324,326,327,328,329,295,335,278,337,338,339,340,341,342,343,329,329,282,283,285,340,341,342,343,287,289,326,291,324,295,320,327,310,311,322,309,352,354,308,308,354,360,361,360,361,335,335,335,358,362,363,364,365,366,367,367,366,352,372,372,374,374,289,375,375,376,376,377,377,378,378,379,379,287,382,382,383,383,384,384,358,394,394,395,395,396,396,401,401,402,402,403,403
                        )
                AND (
                        menu.menu_id = m.menu_id
                        OR menu.menu_id = m1.menu_id
                        OR menu.menu_id = m2.menu_id
                )
        )
   ORDER BY
        seq`
   
   ### Which version of ShardingSphere did you use?
   4.1.1  or  4.1.0
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   Error:
   `Caused by: java.lang.NullPointerException: null
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitAlias(MySQLDMLVisitor.java:442)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitAlias(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$AliasContext.accept(MySQLStatementParser.java:5455)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjection(MySQLDMLVisitor.java:427)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjection(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionContext.accept(MySQLStatementParser.java:5370)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjections(MySQLDMLVisitor.java:410)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitProjections(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ProjectionsContext.accept(MySQLStatementParser.java:4865)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelectClause(MySQLDMLVisitor.java:329)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelectClause(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectClauseContext.accept(MySQLStatementParser.java:4551)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitUnionClause(MySQLDMLVisitor.java:322)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitUnionClause(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$UnionClauseContext.accept(MySQLStatementParser.java:4446)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelect(MySQLDMLVisitor.java:314)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitSelect(MySQLDMLVisitor.java:127)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$SelectContext.accept(MySQLStatementParser.java:3098)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80)
        at 
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to