TeslaCN commented on issue #24043:
URL: 
https://github.com/apache/shardingsphere/issues/24043#issuecomment-1423452466

   > Hi @TeslaCN I am trying to fix this issue to give it a try. But I am 
facing the below issue after I tried making similar changes.
   > 
   > ```
   > org.postgresql.util.PSQLException: ERROR: Unsupported SQL operation: 
Unsupported PostgreSQL format code `63762`
   > at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2468)
 ~[postgresql-42.2.6.jar:42.2.6]
   > ```
   > 
   > This issue is occuring from PostgreSQLValueFormat.java class. For UUID 
data type do we have to pass 0 or 1?
   > 
   > It is failing at 
**result.add(PostgreSQLValueFormat.valueOf(payload.readInt2()));** of 
PostgreSQLComBindPacket.java because payload.readInt2() returns value greater 
than 0 or 1.
   > 
   > ```
   >  public List<PostgreSQLValueFormat> readResultFormats() {
   >         int resultFormatsLength = payload.readInt2();
   >         if (0 == resultFormatsLength) {
   >             return Collections.emptyList();
   >         }
   >         if (1 == resultFormatsLength) {
   >             return 
Collections.singletonList(PostgreSQLValueFormat.valueOf(payload.readInt2()));
   >         }
   >         List<PostgreSQLValueFormat> result = new 
ArrayList<>(resultFormatsLength);
   >         for (int i = 0; i < resultFormatsLength; i++) {
   >             result.add(PostgreSQLValueFormat.valueOf(payload.readInt2()));
   >         }
   >         return result;
   >     }
   > ```
   
   The result format in protocol must be 0 or 1. 
   
   If the result was not 0 or 1, it may be affected by decoding previous fields 
such as value of parameter.
   
   https://www.postgresql.org/docs/current/protocol-message-formats.html
   <img width="1525" alt="image" 
src="https://user-images.githubusercontent.com/20503072/217686524-fd87a22f-7663-4601-a805-7e721d974b38.png";>
   


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