udrnrso opened a new issue, #19369:
URL: https://github.com/apache/shardingsphere/issues/19369

   ## Bug Report
   
   
   ### Which version of ShardingSphere did you use?
   5.1.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   ### Expected behavior
   create table t_test_table (
   `id` varchar(64) NOT NULL,
   `biz_date` date NOT NULL,
   primary key (id, biz_date)
   );
   we have table like above(mysql), execute the following query(around 2000 
ids) shoud be ok
   
   select id from t_test_table  where (id = '001' and biz_date='2022-01-01') or 
 (id = '002' and biz_date='2022-02-01')
   or  (id = '003' and biz_date='2022-02-01') ...
   
   ### Actual behavior
   
   The above sql cause StackOverFlow:
   java.lang.StackOverflowError
        at 
org.apache.shardingsphere.infra.parser.sql.SQLStatementParserEngine.parse(SQLStatementParserEngine.java:47)
        at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:70)
        at 
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:59)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:167)
        at 
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.<init>(ShardingSpherePreparedStatement.java:137)
        at 
org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection.prepareStatement(ShardingSphereConnection.java:79)
   Caused by: java.lang.StackOverflowError
        at 
org.antlr.v4.runtime.CodePointCharStream$CodePoint16BitCharStream.getText(CodePointCharStream.java:215)
        at org.antlr.v4.runtime.CommonToken.getText(CommonToken.java:170)
        at 
org.antlr.v4.runtime.tree.TerminalNodeImpl.getText(TerminalNodeImpl.java:54)
        at org.antlr.v4.runtime.RuleContext.getText(RuleContext.java:137)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:399)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:220)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:18210)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.createBinaryOperationExpression(MySQLStatementSQLVisitor.java:405)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:399)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:220)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:18210)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.createBinaryOperationExpression(MySQLStatementSQLVisitor.java:405)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:399)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:220)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:18210)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.createBinaryOperationExpression(MySQLStatementSQLVisitor.java:405)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:399)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:220)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:18210)
        at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.createBinaryOperationExpression(MySQLStatementSQLVisitor.java:405)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:399)
        at 
org.apache.shardingsphere.sql.parser.mysql.visitor.statement.impl.MySQLStatementSQLVisitor.visitExpr(MySQLStatementSQLVisitor.java:220)
        at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$ExprContext.accept(MySQLStatementParser.java:18210)
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   execute the following sql with around 2000 ids: 
   select id from t_test_table  where (id = '001' and biz_date='2022-01-01') or 
 (id = '002' and biz_date='2022-02-01')
   or  (id = '003' and biz_date='2022-02-01') ...
   
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
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.

To unsubscribe, e-mail: 
[email protected]

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

Reply via email to