<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>For English only</strong>, other languages will not accept.</p>
<p dir="auto">Before report a bug, make sure you have:</p>
<ul dir="auto">
<li>Searched open and closed <a href="https://github.com/apache/shardingsphere/issues">GitHub issues</a>.</li>
<li>Read documentation: <a href="https://shardingsphere.apache.org/document/current/en/overview" rel="nofollow">ShardingSphere Doc</a>.</li>
</ul>
<p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br>
If no response anymore and we cannot reproduce it on current information, we will <strong>close it</strong>.</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">5.3.3-SNAPSHOT</p>
<h3 dir="auto">Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</h3>
<p dir="auto">ShardingSphere-Proxy</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">query success<br>
+------------------+<br>
|        SCHEMA_NAME|<br>
+------------------+<br>
|     shardingsphere|<br>
| performance_schema|<br>
| information_schema|<br>
|              mysql|<br>
|                sys|<br>
|           proxy_db|<br>
+------------------+</p>
<h3 dir="auto">Actual behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<h3 dir="auto">Reason analyze (If you can)</h3>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<p dir="auto">query from mysql by <code class="notranslate">select schema_name from information_schema.schemata order by schema_name</code></p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Shardingjdbc 4.0.0-RC2</strong>,</p>
<h3 dir="auto">Mybtais sql like:</h3>
<p dir="auto">insert into users set<br>
order_id = #{orim.orderId,jdbcType=BIGINT},<br>
s_id = #{orim.sId,jdbcType=BIGINT},<br>
<code class="notranslate">name</code> = CONVERT(to_base64(aes_encrypt(#{orim.<code class="notranslate">name</code>,jdbcType=VARCHAR},<br>
#{dataSecret,jdbcType=VARCHAR})) USING utf8),<br>
addr = #{orim.Addr,jdbcType=VARCHAR},<br>
mobile = CONVERT(to_base64(aes_encrypt(#{orim.mobile,jdbcType=VARCHAR},<br>
#{dataSecret,jdbcType=VARCHAR})) USING utf8),<br>
tel =  CONVERT(to_base64(aes_encrypt(#{orim.tel,jdbcType=VARCHAR},<br>
#{dataSecret,jdbcType=VARCHAR})) USING utf8)<br>
ON DUPLICATE KEY UPDATE<br>
<code class="notranslate">name</code>=values(<code class="notranslate">name</code>),<br>
addr=values(addr),<br>
mobile=values(mobile),<br>
tel=values(tel)</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<h3 dir="auto">Which version of ShardingJDBC did you use?</h3>
<p dir="auto">4.0.0-RC2</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-JDBC</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Caused by: java.lang.ClassCastException: org.antlr.v4.runtime.tree.TerminalNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext<br>
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]<br>
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]<br>
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]<br>
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]<br>
at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
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]<br>
at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:64) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:60) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:86) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:70) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
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]<br>
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]<br>
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184) ~[mybatis-3.5.2.jar:3.5.2]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]<br>
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]<br>
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426) ~[mybatis-spring-2.0.2.jar:2.0.2]<br>
at com.sun.proxy.$Proxy80.insert(Unknown Source) ~[?:?]<br>
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:271) ~[mybatis-spring-2.0.2.jar:2.0.2]<br>
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) ~[mybatis-3.5.2.jar:3.5.2]<br>
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57) ~[mybatis-3.5.2.jar:3.5.2]<br>
at com.sun.proxy.$Proxy81.insertWithEncrypt(Unknown Source) ~[?:?]<br>
at com.yundasys.order.service.impl.OrderServiceImpl.saveDesensitizedOrder2DB(OrderServiceImpl.java:393) ~[classes/:?]<br>
at com.yundasys.order.kafka.OrderConsumer.saveOrder2DB(OrderConsumer.java:46) ~[classes/:?]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]<br>
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]<br>
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]<br>
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) ~[spring-messaging-5.1.8.RELEASE.jar:5.1.8.RELEASE]<br>
at org.springframework.kafka.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:48) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:283) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:79) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.onMessage(RecordMessagingMessageListenerAdapter.java:50) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:1275) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeOnMessage(KafkaMessageListenerContainer.java:1258) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:1219) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]<br>
... 9 more</p>