You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/09 10:45:35 UTC

[GitHub] [dolphinscheduler] insist777 commented on a diff in pull request #11371: [Fix-1360]: Fix Description length check

insist777 commented on code in PR #11371:
URL: https://github.com/apache/dolphinscheduler/pull/11371#discussion_r941186312


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/BaseServiceImpl.java:
##########
@@ -212,4 +212,9 @@ public Map<String, Object> checkAndParseDateParameters(String startDateStr, Stri
         putMsg(result, Status.SUCCESS);
         return result;
     }
+
+    @Override
+    public boolean checkDescriptionLength(String description) {
+        return description!=null && description.codePointCount(0, description.length()) > 255;

Review Comment:
   MySQL:In contrast to CHAR, VARCHAR values are stored as a 1-byte or 2-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes.
   Because more than 256 will apply for additional space, lock the table, and then add new fields, it will definitely affect the database performance in the case of high concurrency.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org