linghengqian commented on PR #19878:
URL: https://github.com/apache/shardingsphere/pull/19878#issuecomment-1207461768

   Awaiting investigation, as the following unit test executes normally, which 
means there is a logic execution error.
   ```java
   @Test
   public void assertGetGeneratedKeys() throws SQLException {
       Connection conn = 
DriverManager.getConnection("jdbc:h2:mem:test;DATABASE_TO_UPPER=false;MODE=MySQL",
 "sa", "");
       conn.createStatement().execute("CREATE TABLE IF NOT EXISTS t_config (id 
INT NOT NULL AUTO_INCREMENT, status VARCHAR(45) NULL, PRIMARY KEY (id));");
       try (
               PreparedStatement preparedStatement = 
conn.prepareStatement("INSERT INTO t_config(status) VALUES(?);", 
Statement.RETURN_GENERATED_KEYS)) {
           preparedStatement.setString(1, "OK");
           preparedStatement.executeUpdate();
           ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
           assertTrue(generatedKeys.next());
           int columnCount = generatedKeys.getMetaData().getColumnCount();
           for (int index = 0; index < columnCount; index++) {
               assertNotNull(generatedKeys.getObject(index + 1));
               assertNotNull(generatedKeys.getMetaData().getColumnLabel(index + 
1));
               assertNotNull(generatedKeys.getMetaData().getColumnName(index + 
1));
           }
           assertFalse(generatedKeys.next());
       }
       conn.close();
   }
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to