Issue 1:
Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Searched open and closed GitHub issues.

Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details.

If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

5.3.3-SNAPSHOT

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

query success

+------------------+

| SCHEMA_NAME|

+------------------+

| shardingsphere|

| performance_schema|

| information_schema|

| mysql|

| sys|

| proxy_db|

+------------------+

Actual behavior

java.lang.NullPointerException: element cannot be mapped to a null key
at java.base/java.util.Objects.requireNonNull(Objects.java:246)
at java.base/java.util.stream.Collectors.lambda$groupingBy$53(Collectors.java:1134)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1239)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.information.SelectInformationSchemataExecutor.removeDuplicatedRow(SelectInformationSchemataExecutor.java:77)
at org.apache.shardingsphere.proxy.backend.mysql.handler.admin.executor.information.SelectInformationSchemataExecutor.createPreProcessing(SelectInformationSchemataExecutor.java:72)
at org.apache.shardingsphere.proxy.backend.handler.admin.executor.AbstractDatabaseMetaDataExecutor.execute(AbstractDatabaseMetaDataExecutor.java:78)
at org.apache.shardingsphere.proxy.backend.handler.admin.DatabaseAdminQueryBackendHandler.execute(DatabaseAdminQueryBackendHandler.java:56)
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:92)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:116)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:111)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

query from mysql by select schema_name from information_schema.schemata order by schema_name

Example codes for reproduce this issue (such as a github link).

Issue 2:
Bug Report

Shardingjdbc 4.0.0-RC2,

Mybtais sql like:

insert into users set

order_id = #{orim.orderId,jdbcType=BIGINT},

s_id = #{orim.sId,jdbcType=BIGINT},

name = CONVERT(to_base64(aes_encrypt(#{orim.name,jdbcType=VARCHAR},

#{dataSecret,jdbcType=VARCHAR})) USING utf8),

addr = #{orim.Addr,jdbcType=VARCHAR},

mobile = CONVERT(to_base64(aes_encrypt(#{orim.mobile,jdbcType=VARCHAR},

#{dataSecret,jdbcType=VARCHAR})) USING utf8),

tel = CONVERT(to_base64(aes_encrypt(#{orim.tel,jdbcType=VARCHAR},

#{dataSecret,jdbcType=VARCHAR})) USING utf8)

ON DUPLICATE KEY UPDATE

name=values(name),

addr=values(addr),

mobile=values(mobile),

tel=values(tel)

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingJDBC did you use?

4.0.0-RC2

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

Caused by: java.lang.ClassCastException: org.antlr.v4.runtime.tree.TerminalNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext

at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.update.AssignmentExtractor.extract(AssignmentExtractor.java:52) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.update.SetAssignmentsExtractor.extract(SetAssignmentsExtractor.java:49) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.core.extractor.SQLSegmentsExtractorEngine.extract(SQLSegmentsExtractorEngine.java:47) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.core.SQLParseKernel.parse(SQLParseKernel.java:62) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.route.router.sharding.ParsingSQLRouter.parse(ParsingSQLRouter.java:66) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:64) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:60) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:86) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:70) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:224) ~[sharding-jdbc-core-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:170) ~[sharding-jdbc-core-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.2.jar:3.5.2]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.2.jar:2.0.2]

at com.sun.proxy.$Proxy80.insert(Unknown Source) ~[?:?]

at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:271) ~[mybatis-spring-2.0.2.jar:2.0.2]

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) ~[mybatis-3.5.2.jar:3.5.2]

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57) ~[mybatis-3.5.2.jar:3.5.2]

at com.sun.proxy.$Proxy81.insertWithEncrypt(Unknown Source) ~[?:?]

at com.yundasys.order.service.impl.OrderServiceImpl.saveDesensitizedOrder2DB(OrderServiceImpl.java:393) ~[classes/:?]

at com.yundasys.order.kafka.OrderConsumer.saveOrder2DB(OrderConsumer.java:46) ~[classes/:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]

at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]

at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]

at org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:283) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:79) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:50) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:1275) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeOnMessage(KafkaMessageListenerContainer.java:1258) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:1219) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]

... 9 more