Repository: apache/shardingsphere
Issue: The tables with no configuration appear in the proxy.

The tables which are not configed in yaml can be used with show tables, select etc.
It is not correct, i will fix it in next week.

Changed files:
sharding-proxy/src/main/java/io/shardingsphere/proxy/transport/mysql/packet/command/text/fieldlist/ComFieldListPacket.java
sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLPacketsBackendHandler.java

diff --git a/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLPacketsBackendHandler.java b/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLPacketsBackendHandler.java
index 55e509112e9..9af8cce6b0a 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLPacketsBackendHandler.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/proxy/backend/common/SQLPacketsBackendHandler.java
@@ -46,6 +46,7 @@ import io.shardingsphere.proxy.transport.mysql.packet.generic.ErrPacket;
 import io.shardingsphere.proxy.transport.mysql.packet.generic.OKPacket;
 import io.shardingsphere.proxy.util.MySQLResultCache;
 import io.shardingsphere.proxy.util.SynchronizedFuture;
+import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 
 import java.sql.SQLException;
@@ -64,6 +65,7 @@ import java.util.concurrent.TimeoutException;
  * @author panjuan
  */
 @Slf4j
+@Getter
 public final class SQLPacketsBackendHandler implements BackendHandler {
     private static final int CONNECT_TIMEOUT = 30;
     
diff --git a/sharding-proxy/src/main/java/io/shardingsphere/proxy/transport/mysql/packet/command/text/fieldlist/ComFieldListPacket.java b/sharding-proxy/src/main/java/io/shardingsphere/proxy/transport/mysql/packet/command/text/fieldlist/ComFieldListPacket.java
index 88836c3a5a3..a0292a57dc5 100644
--- a/sharding-proxy/src/main/java/io/shardingsphere/proxy/transport/mysql/packet/command/text/fieldlist/ComFieldListPacket.java
+++ b/sharding-proxy/src/main/java/io/shardingsphere/proxy/transport/mysql/packet/command/text/fieldlist/ComFieldListPacket.java
@@ -24,11 +24,18 @@ import io.shardingsphere.proxy.backend.common.SQLPacketsBackendHandler;
 import io.shardingsphere.proxy.config.RuleRegistry;
 import io.shardingsphere.proxy.transport.common.packet.CommandPacketRebuilder;
 import io.shardingsphere.proxy.transport.common.packet.DatabaseProtocolPacket;
+import io.shardingsphere.proxy.transport.mysql.constant.ColumnType;
+import io.shardingsphere.proxy.transport.mysql.constant.StatusFlag;
 import io.shardingsphere.proxy.transport.mysql.packet.MySQLPacketPayload;
 import io.shardingsphere.proxy.transport.mysql.packet.command.CommandPacket;
 import io.shardingsphere.proxy.transport.mysql.packet.command.CommandPacketType;
 import io.shardingsphere.proxy.transport.mysql.packet.command.CommandResponsePackets;
+import io.shardingsphere.proxy.transport.mysql.packet.command.statement.close.DummyPacket;
+import io.shardingsphere.proxy.transport.mysql.packet.command.text.query.ColumnDefinition41Packet;
 import io.shardingsphere.proxy.transport.mysql.packet.command.text.query.ComQueryPacket;
+import io.shardingsphere.proxy.transport.mysql.packet.command.text.query.TextResultSetRowPacket;
+import io.shardingsphere.proxy.transport.mysql.packet.generic.EofPacket;
+import io.shardingsphere.proxy.transport.mysql.packet.generic.ErrPacket;
 import lombok.extern.slf4j.Slf4j;
 
 import java.sql.SQLException;
@@ -49,6 +56,8 @@ public final class ComFieldListPacket extends CommandPacket implements CommandPa
     
     private final String fieldWildcard;
     
+    private int currentSequenceId;
+    
     private SQLExecuteBackendHandler sqlExecuteBackendHandler;
     
     private SQLPacketsBackendHandler sqlPacketsBackendHandler;
@@ -82,10 +91,12 @@ public final class ComFieldListPacket extends CommandPacket implements CommandPa
         // TODO use common database type
         if (RuleRegistry.getInstance().isWithoutJdbc()) {
             sqlPacketsBackendHandler = new SQLPacketsBackendHandler(this, DatabaseType.MySQL, RuleRegistry.getInstance().isShowSQL());
-            return sqlPacketsBackendHandler.execute();
+            sqlPacketsBackendHandler.execute();
+            return new CommandResponsePackets(new DummyPacket());
         } else {
             sqlExecuteBackendHandler = new SQLExecuteBackendHandler(sql, DatabaseType.MySQL, RuleRegistry.getInstance().isShowSQL());
-            return sqlExecuteBackendHandler.execute();
+            sqlExecuteBackendHandler.execute();
+            return new CommandResponsePackets(new DummyPacket());
         }
     }
     
@@ -104,10 +115,25 @@ public final class ComFieldListPacket extends CommandPacket implements CommandPa
     
     @Override
     public DatabaseProtocolPacket getResultValue() {
+        DatabaseProtocolPacket result;
         if (RuleRegistry.getInstance().isWithoutJdbc()) {
-            return sqlPacketsBackendHandler.getResultValue();
+            result = sqlPacketsBackendHandler.getResultValue();
+            if (!sqlPacketsBackendHandler.isHasMoreResultValueFlag()) {
+                return new EofPacket(++currentSequenceId, 0, StatusFlag.SERVER_STATUS_AUTOCOMMIT.getValue());
+            }
+        } else {
+            result = sqlExecuteBackendHandler.getResultValue();
+            if (!sqlExecuteBackendHandler.isHasMoreResultValueFlag()) {
+                return new EofPacket(++currentSequenceId, 0, StatusFlag.SERVER_STATUS_AUTOCOMMIT.getValue());
+            }
+        }
+        if (result instanceof TextResultSetRowPacket) {
+            TextResultSetRowPacket fieldListResponse = (TextResultSetRowPacket) result;
+            String columnName = (String) fieldListResponse.getData().get(0);
+            return new ColumnDefinition41Packet(++currentSequenceId, ShardingConstant.LOGIC_SCHEMA_NAME, table, table,
+                columnName, columnName, 100, ColumnType.MYSQL_TYPE_VARCHAR, 0);
         } else {
-            return sqlExecuteBackendHandler.getResultValue();
+            return new ErrPacket(1, 0, "", "", "");
         }
     }