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


##########
fe/fe-type/src/main/java/org/apache/doris/catalog/VariantField.java:
##########
@@ -74,7 +75,8 @@ public String toSql(int depth) {
         sb.append("'").append(pattern).append("'");
         sb.append(":").append(type.toSql(depth + 1));
         if (!comment.isEmpty()) {
-            sb.append(" COMMENT '").append(comment).append("'");
+            // Quote the comment so SHOW CREATE TABLE output can be replayed 
when it holds quotes or backslashes.
+            sb.append(" COMMENT ").append(SqlUtils.quoteStringLiteral(comment, 
false));

Review Comment:
   [P2] Honor NO_BACKSLASH_ESCAPES when rendering this comment
   
   This hard-coded `false` makes the catalog DDL path always double 
backslashes. In a session with `NO_BACKSLASH_ESCAPES`, a stored comment such as 
`C:\path` is emitted as `C:\\path`; replay treats both backslashes literally, 
so the copy stores two and the next cycle produces four. `CREATE TABLE LIKE` 
hits the same failure automatically because it renders through this path and 
immediately reparses under the active session mode. The parser change in this 
PR and the Nereids renderer both use the active mode, so please thread that 
mode into the catalog serializer as the STRUCT comment path does, and cover 
both modes (including a trailing backslash) in the round-trip test.



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