yuqi1129 commented on code in PR #12007:
URL: https://github.com/apache/gravitino/pull/12007#discussion_r3603845345


##########
catalogs/catalog-jdbc-doris/src/test/java/org/apache/gravitino/catalog/doris/utils/TestDorisUtils.java:
##########
@@ -92,6 +97,12 @@ public void testExtractTablePropertiesFromSql() {
     result = DorisUtils.extractPropertiesFromSql(createTableSql);
     assertEquals("value1", result.get("property1"));
     assertEquals("comment", result.get("comment"));
+
+    createTableSql =
+        "CREATE DATABASE `test`\nPROPERTIES (\n"
+            + "\"key\"name\" = \"owner's \"comment\" D:\\data; --\"\n)";
+    result = DorisUtils.extractPropertiesFromSql(createTableSql);
+    assertEquals("owner's \"comment\" D:\\data; --", result.get("key\"name"));

Review Comment:
   The test string does compile (the double quotes are escaped as \"), but the 
round-trip point is valid: the write path now escapes while the read path 
returned raw captured text. Fixed in 89687d9f71 — added 
`JdbcConnectorUtils.unescapeSqlLiteral` (inverse of `escapeSqlLiteral`, also 
tolerating backslash-style escapes), used it in 
`DorisUtils.extractPropertiesFromSql` for both key and value, and updated this 
test to feed escaped SHOW CREATE output and assert the original text comes 
back. StarRocks' private comment unescaper now delegates to the shared helper.



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