zjcnb opened a new issue #13736:
URL: https://github.com/apache/shardingsphere/issues/13736
### Which version of ShardingSphere did you use?
`master`
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
`ShardingSphere-Proxy`
### Expected behavior
alter READWRITE_SPLITTING rule successful.
### Actual behavior
```
java.lang.NullPointerException: null
at
org.apache.shardingsphere.readwritesplitting.distsql.parser.core.ReadwriteSplittingDistSQLStatementVisitor.visitReadwriteSplittingRuleDefinition(ReadwriteSplittingDistSQLStatementVisitor.java:97)
at
org.apache.shardingsphere.readwritesplitting.distsql.parser.core.ReadwriteSplittingDistSQLStatementVisitor.visitReadwriteSplittingRuleDefinition(ReadwriteSplittingDistSQLStatementVisitor.java:60)
at
org.apache.shardingsphere.distsql.parser.autogen.ReadwriteSplittingDistSQLStatementParser$ReadwriteSplittingRuleDefinitionContext.accept(ReadwriteSplittingDistSQLStatementParser.java:918)
at
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
at
org.apache.shardingsphere.readwritesplitting.distsql.parser.core.ReadwriteSplittingDistSQLStatementVisitor.lambda$visitAlterReadwriteSplittingRule$1(ReadwriteSplittingDistSQLStatementVisitor.java:69)
at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at
java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at
org.apache.shardingsphere.readwritesplitting.distsql.parser.core.ReadwriteSplittingDistSQLStatementVisitor.visitAlterReadwriteSplittingRule(ReadwriteSplittingDistSQLStatementVisitor.java:69)
at
org.apache.shardingsphere.readwritesplitting.distsql.parser.core.ReadwriteSplittingDistSQLStatementVisitor.visitAlterReadwriteSplittingRule(ReadwriteSplittingDistSQLStatementVisitor.java:60)
at
org.apache.shardingsphere.distsql.parser.autogen.ReadwriteSplittingDistSQLStatementParser$AlterReadwriteSplittingRuleContext.accept(ReadwriteSplittingDistSQLStatementParser.java:778)
at
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
at
org.apache.shardingsphere.distsql.parser.core.featured.FeaturedDistSQLStatementParserEngine.getSQLStatement(FeaturedDistSQLStatementParserEngine.java:77)
at
org.apache.shardingsphere.distsql.parser.core.featured.FeaturedDistSQLStatementParserEngine.parse(FeaturedDistSQLStatementParserEngine.java:56)
at
org.apache.shardingsphere.distsql.parser.engine.api.DistSQLStatementParserEngine.parse(DistSQLStatementParserEngine.java:43)
at
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse0(ShardingSphereSQLParserEngine.java:74)
at
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine.parse(ShardingSphereSQLParserEngine.java:59)
at
org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandlerFactory.newInstance(TextProtocolBackendHandlerFactory.java:82)
at
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.<init>(MySQLComQueryPacketExecutor.java:55)
at
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecutorFactory.newInstance(MySQLCommandExecutorFactory.java:73)
at
org.apache.shardingsphere.proxy.frontend.mysql.command.MySQLCommandExecuteEngine.getCommandExecutor(MySQLCommandExecuteEngine.java:60)
at
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:97)
at
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:72)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
```
`DistSQL: `
```
ALTER READWRITE_SPLITTING RULE readwrite_splitting_db (
WRITE_RESOURCE=write_ds,
READ_RESOURCES(read_ds_0)
);
```
`Configuration:`
```
schemaName: readwrite_splitting_db
dataSources:
write_ds:
url:
jdbc:mysql://127.0.0.1:13306/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_0:
url:
jdbc:mysql://127.0.0.1:13307/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
read_ds_1:
url:
jdbc:mysql://127.0.0.1:13308/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !READWRITE_SPLITTING
dataSources:
pr_ds:
writeDataSourceName: write_ds
readDataSourceNames:
- read_ds_0
- read_ds_1
```
--
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]