yujun505646964 opened a new issue #8982:
URL: https://github.com/apache/shardingsphere/issues/8982


   
   show tables like xxx% can not return correct result
   
   LogicTablesMergedResult:
   
   ```
   @Override
       protected final List<MemoryQueryResultRow> init(final ShardingRule 
shardingRule, final SchemaMetaData schemaMetaData, 
                                                       final 
SQLStatementContext sqlStatementContext, final List<QueryResult> queryResults) 
throws SQLException {
           List<MemoryQueryResultRow> result = new LinkedList<>();
           Set<String> tableNames = new HashSet<>();
           for (QueryResult each : queryResults) {
               while (each.next()) {
                   MemoryQueryResultRow memoryResultSetRow = new 
MemoryQueryResultRow(each);
                   String actualTableName = 
memoryResultSetRow.getCell(1).toString();
                   Optional<TableRule> tableRule = 
shardingRule.findTableRuleByActualTable(actualTableName);
                   if (!tableRule.isPresent()) {
                       if (shardingRule.getTableRules().isEmpty() || 
schemaMetaData.containsTable(actualTableName) && 
tableNames.add(actualTableName)) {
                           result.add(memoryResultSetRow);
                       }
                   } else if (tableNames.add(tableRule.get().getLogicTable())) {
                       memoryResultSetRow.setCell(1, 
tableRule.get().getLogicTable());
                       setCellValue(memoryResultSetRow, 
tableRule.get().getLogicTable(), actualTableName);
                       result.add(memoryResultSetRow);
                   }
               }
           }
           return result;
       }
   ```
   
   


----------------------------------------------------------------
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]


Reply via email to