linguoxuan commented on code in PR #4425:
URL: https://github.com/apache/flink-cdc/pull/4425#discussion_r3643260042


##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-starrocks/src/test/java/org/apache/flink/cdc/connectors/starrocks/sink/StarRocksMetadataApplierITCase.java:
##########
@@ -583,6 +583,145 @@ void 
testMysqlDefaultTimestampValueConversionInAddColumn() throws Exception {
         assertEqualsInOrder(expected, actual);
     }
 
+    @Test
+    void testSpecialCharactersInCommentAndDefaultValueInCreateTable() throws 
Exception {
+        TableId tableId =
+                TableId.tableId(
+                        StarRocksContainer.STARROCKS_DATABASE_NAME,
+                        StarRocksContainer.STARROCKS_TABLE_NAME);
+
+        Schema schema =
+                Schema.newBuilder()
+                        .column(new PhysicalColumn("id", 
DataTypes.INT().notNull(), null))
+                        .column(
+                                new PhysicalColumn(
+                                        "col_backslash",
+                                        DataTypes.VARCHAR(100),
+                                        "comment with \\ backslash",
+                                        "default\\value"))
+                        .column(
+                                new PhysicalColumn(
+                                        "col_quote",
+                                        DataTypes.VARCHAR(100),
+                                        "comment with \" double quote",
+                                        "default\"value"))
+                        .column(
+                                new PhysicalColumn(
+                                        "col_newline",
+                                        DataTypes.VARCHAR(100),
+                                        "comment with \n newline",
+                                        "default\nvalue"))
+                        .column(
+                                new PhysicalColumn(
+                                        "col_mixed",
+                                        DataTypes.VARCHAR(100),
+                                        "mixed \\ and \" and \n chars",
+                                        "mix\\ed\"val\nue"))
+                        .primaryKey("id")
+                        .build();
+
+        runJobWithEvents(Collections.singletonList(new 
CreateTableEvent(tableId, schema)));
+
+        List<String> actual = inspectTableSchema(tableId);
+
+        List<String> expected =
+                Arrays.asList(
+                        "id | int | NO | true | null",
+                        "col_backslash | varchar(300) | YES | false | 
default\\value",
+                        "col_quote | varchar(300) | YES | false | 
default\"value",
+                        "col_newline | varchar(300) | YES | false | default 
value",

Review Comment:
   fix



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