ShenFeng312 commented on code in PR #36372:
URL: https://github.com/apache/shardingsphere/pull/36372#discussion_r2558700852
##########
database/protocol/dialect/postgresql/src/main/java/org/apache/shardingsphere/database/protocol/postgresql/packet/command/query/extended/bind/protocol/PostgreSQLStringBinaryProtocolValue.java:
##########
@@ -26,25 +26,26 @@ public final class PostgreSQLStringBinaryProtocolValue
implements PostgreSQLBina
@Override
public int getColumnLength(final PostgreSQLPacketPayload payload, final
Object value) {
- if (value instanceof byte[]) {
- return ((byte[]) value).length;
- }
- return value.toString().getBytes(payload.getCharset()).length;
+ return -1;
Review Comment:
For performance considerations, I believe it's reasonable to return -1 when
the length cannot be determined, and then obtain the value when writing. I have
noted the reason for the change in the interface.
--
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]