You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/10/10 06:37:36 UTC

[GitHub] [shardingsphere] udrnrso opened a new issue, #19369: execute sql with mutiple 'or' cause stack overflow error

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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] commented on issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #19369:
URL: https://github.com/apache/shardingsphere/issues/19369#issuecomment-1272349306

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] github-actions[bot] closed issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #19369: execute sql with mutiple 'or' cause stack overflow error
URL: https://github.com/apache/shardingsphere/issues/19369


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] udrnrso commented on issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
udrnrso commented on issue #19369:
URL: https://github.com/apache/shardingsphere/issues/19369#issuecomment-1194880894

   > How about increase your Xss configuration?
   increase stack size means more memory occupied. it is inpredictable.  
   any other option? 


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN closed issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #19369: execute sql with mutiple 'or' cause stack overflow error
URL: https://github.com/apache/shardingsphere/issues/19369


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] terrymanu commented on issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #19369:
URL: https://github.com/apache/shardingsphere/issues/19369#issuecomment-1189807897

   How about increase your Xss configuration?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #19369: execute sql with mutiple 'or' cause stack overflow error

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #19369:
URL: https://github.com/apache/shardingsphere/issues/19369#issuecomment-1211676343

   > increase stack size means more memory occupied. it is inpredictable.
   > any other option?
   
   Usually this issue is caused by `Xss` too small or SQL too long. Just setting `Xss` to a proper value.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org