github-actions[bot] commented on code in PR #64310:
URL: https://github.com/apache/doris/pull/64310#discussion_r3385132304


##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/streaming/PostgresResourceValidator.java:
##########
@@ -123,6 +126,17 @@ private static String resolvePublicationName(Map<String, 
String> config, String
         return StringUtils.isNotBlank(name) ? name : 
DataSourceConfigKeys.defaultPublicationName(jobId);
     }
 
+    private static void checkDatabaseNameLength(String database) throws 
JobException {
+        if (StringUtils.isBlank(database)) {
+            return;

Review Comment:
   PostgreSQL's identifier limit is `NAMEDATALEN - 1` bytes, not Java 
characters. This check still lets a multibyte database name through (for 
example, 22 CJK characters are `length() == 22` but 66 bytes in UTF-8), and 
PostgreSQL will truncate it exactly the way this PR is trying to reject. Please 
compare the encoded byte length, or otherwise use the server's 
`max_identifier_length` byte semantics, and add coverage for a multibyte 
database name so the fail-fast path covers this case too.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to