You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/06/12 11:07:53 UTC

[GitHub] [shardingsphere] tristaZero commented on issue #6003: distinct sql assert failed in integration test after open db rule type

tristaZero commented on issue #6003:
URL: https://github.com/apache/shardingsphere/issues/6003#issuecomment-643213877


   Hi IMO, the key point here is to make sure it is a `DISTINCT` bug or an assertion error of integrated tests, for which I printed the result of a failed test, i.e., `select_distinct_with_multi_column_without_order_by`. 
   You can add the following code in `GeneralDQLIT` for reproduction.
   ```java
   private void assertExecuteQueryForStatement(final Connection connection) throws SQLException, JAXBException, IOException {
       try (
               Statement statement = connection.createStatement();
               ResultSet resultSet = statement.executeQuery(getSql())) {
           while (resultSet.next()) {
               System.err.println(resultSet.getString(1));
           }
           assertResultSet(resultSet);
       }
   }
   ```
   
   ![image](https://user-images.githubusercontent.com/27757146/84495953-adfd5780-acde-11ea-9d5f-0f969296a554.png)
   The printed result is
   
   ```yaml
   100001
   100002
   100101
   100102
   110001
   110002
   110101
   110102
   120001
   120002
   120101
   120102
   130001
   130002
   130101
   130102
   140001
   140002
   140101
   140102
   150001
   150002
   150101
   150102
   160001
   160002
   160101
   160102
   170001
   170002
   170101
   170102
   180001
   180002
   180101
   180102
   190001
   190002
   190101
   190102
   200001
   200002
   200101
   200102
   210001
   210002
   210101
   210102
   220001
   220002
   220101
   220102
   230001
   230002
   230101
   230102
   240001
   240002
   240101
   240102
   250001
   250002
   250101
   250102
   260001
   260002
   260101
   260102
   270001
   270002
   270101
   270102
   280001
   280002
   280101
   280102
   290001
   290002
   290101
   290102
   [ERROR] SQL::SELECT DISTINCT item_id FROM t_order_item, Parameter::[null], Expect::select_distinct_with_single_column_without_order_by.xml
   
   java.lang.AssertionError: Size of actual result set is different with size of expected dat set rows.
   Expected: is <160>
        but: was <0>
   Expected :is <160>
   Actual   :<0>
   ```


----------------------------------------------------------------
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:
users@infra.apache.org