TeslaCN edited a comment on issue #11453:
URL: 
https://github.com/apache/shardingsphere/issues/11453#issuecomment-925468993


   Hi @JoinWDT 
   Sorry for the delay.
   I wrote some code, but I could not reproduce this problem in master branch. 
The query worked.
   ```java
               try (Statement statement = connection.createStatement()) {
                   statement.execute("create table if not exists t_b (id bigint 
primary key, a boolean not null, b boolean not null)");
               }
               try (PreparedStatement preparedStatement = 
connection.prepareStatement("insert into t_b values (?, ?, ?)")) {
                   preparedStatement.setLong(1, System.nanoTime());
                   preparedStatement.setBoolean(2, true);
                   preparedStatement.setBoolean(3, false);
                   preparedStatement.addBatch();
                   preparedStatement.setLong(1, System.nanoTime());
                   preparedStatement.setBoolean(2, true);
                   preparedStatement.setBoolean(3, false);
                   preparedStatement.addBatch();
                   preparedStatement.executeBatch();
               }
               try (PreparedStatement preparedStatement = 
connection.prepareStatement("select * from t_b where a = ? and b = ? ")) {
                   preparedStatement.getParameterMetaData();
                   preparedStatement.setObject(1, "true", Types.OTHER);
                   preparedStatement.setObject(2, "false", Types.OTHER);
                   try (ResultSet resultSet = preparedStatement.executeQuery()) 
{
                       printResultSet(resultSet);
                   }
               }
   ```
   
   
![image](https://user-images.githubusercontent.com/20503072/134447367-63601536-82cf-42c4-824d-e50231db05e5.png)
   
   
![image](https://user-images.githubusercontent.com/20503072/134447383-84401457-863a-4691-9f72-2f70077ee9b0.png)
   
   And I tried revert #10691 in master branch and the following error occurred.
   ```
   Exception in thread "main" org.postgresql.util.PSQLException: ERROR: 
operator does not exist: boolean = character varying
     Hint: No operator matches the given name and argument types. You might 
need to add explicit type casts.
     Position: 27
        at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
        at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
        at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
        at 
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
        at 
org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)
        at icu.wwj.hello.jdbc.BooleanType.main(BooleanType.java:37)
   ```
   
   I'm not familiar with Ruby. Could you provide more info about this issue?


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