glon commented on issue #10063:
URL:
https://github.com/apache/shardingsphere/issues/10063#issuecomment-819317629
Executing SQLs :
```mysql
root@localhost:6033 [(none)]>use yaochufa
Database changed
sharding_user@localhost:6033 [yaochufa]>select * from city;
Query OK, 0 rows affected, 25971 warnings (0.02 sec)
sharding_user@localhost:6033 [(none)]>
```
And it's debug level log behind, logs/stdout.log
```
[INFO ] 15:56:46.718 [ShardingSphere-Command-4] ShardingSphere-SQL - Logic
SQL: select USER()
[INFO ] 15:56:46.719 [ShardingSphere-Command-4] ShardingSphere-SQL -
SQLStatement:
SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@79e971a4,
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@1a58e36),
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@1a58e36,
projectionsContext=ProjectionsContext(startIndex=7, stopIndex=12,
distinctRow=false, projections=[ExpressionProjection(expression=USER(),
alias=Optional.empty)]),
groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@263a2033,
orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@772f2786,
paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@45790c96,
containsSubquery=false)
[INFO ] 15:56:46.719 [ShardingSphere-Command-4] ShardingSphere-SQL - Actual
SQL: ds_1 ::: select USER()
[INFO ] 15:56:56.947 [ShardingSphere-Command-5] ShardingSphere-SQL - Logic
SQL: select * from city
[INFO ] 15:56:56.947 [ShardingSphere-Command-5] ShardingSphere-SQL -
SQLStatement:
SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@a825ed5,
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@477123c8),
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@477123c8,
projectionsContext=ProjectionsContext(startIndex=7, stopIndex=7,
distinctRow=false, projections=[ShorthandProjection(owner=Optional.empty,
actualColumns=[])]),
groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@bd0e9f,
orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@42875337,
paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@5a6bd944,
containsSubquery=false)
[INFO ] 15:56:56.947 [ShardingSphere-Command-5] ShardingSphere-SQL - Actual
SQL: ds_3 ::: select * from city
[ERROR] 15:56:57.007 [ShardingSphere-Command-5]
o.a.s.s.f.c.CommandExecutorTask - Exception occur:
java.sql.SQLException: Operation not allowed after ResultSet closed
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:898)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:887)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:861)
at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:733)
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6279)
at
com.zaxxer.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
at
org.apache.shardingsphere.sharding.execute.sql.execute.result.StreamQueryResult.next(StreamQueryResult.java:50)
at
org.apache.shardingsphere.sharding.merge.dql.iterator.IteratorStreamMergedResult.next(IteratorStreamMergedResult.java:41)
at
org.apache.shardingsphere.shardingproxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.next(JDBCDatabaseCommunicationEngine.java:138)
at
org.apache.shardingsphere.shardingproxy.backend.text.query.QueryBackendHandler.next(QueryBackendHandler.java:57)
at
org.apache.shardingsphere.shardingproxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.next(MySQLComQueryPacketExecutor.java:135)
at
org.apache.shardingsphere.shardingproxy.frontend.mysql.command.MySQLCommandExecuteEngine.writeQueryData(MySQLCommandExecuteEngine.java:81)
at
org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:101)
at
org.apache.shardingsphere.shardingproxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:71)
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)
[INFO ] 15:56:57.009 [ShardingSphere-Command-6] ShardingSphere-SQL - Logic
SQL: SELECT DATABASE()
[INFO ] 15:56:57.009 [ShardingSphere-Command-6] ShardingSphere-SQL -
SQLStatement:
SelectStatementContext(super=CommonSQLStatementContext(sqlStatement=org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement@5e580a5f,
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@b9131d2),
tablesContext=org.apache.shardingsphere.sql.parser.binder.segment.table.TablesContext@b9131d2,
projectionsContext=ProjectionsContext(startIndex=7, stopIndex=16,
distinctRow=false, projections=[ExpressionProjection(expression=DATABASE(),
alias=Optional.empty)]),
groupByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.groupby.GroupByContext@f52981e,
orderByContext=org.apache.shardingsphere.sql.parser.binder.segment.select.orderby.OrderByContext@c1cde8d,
paginationContext=org.apache.shardingsphere.sql.parser.binder.segment.select.pagination.PaginationContext@120837a3,
containsSubquery=false)
[INFO ] 15:56:57.009 [ShardingSphere-Command-6] ShardingSphere-SQL - Actual
SQL: ds_2 ::: SELECT DATABASE()
```
logback.xml :
```yaml
<configuration>
<appender name="file"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>sharding.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>sharding.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>60</maxHistory>
<!--<totalSizeCap>1GB</totalSizeCap>-->
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{80} -
%msg%n</pattern>
</encoder>
</appender>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%-5level] %d{HH:mm:ss.SSS} [%thread] %logger{36} -
%msg%n</pattern>
</encoder>
</appender>
<logger name="org.apache.shardingsphere" level="info" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="file"/>
</logger>
<root>
<level value="debug" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</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.
For queries about this service, please contact Infrastructure at:
[email protected]