You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: flink-connector-mysql-cdc/src/test/java/com/ververica/cdc/connectors/mysql/table/MySqlConnectorITCase.java
+31-70Lines changed: 31 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -485,16 +485,18 @@ public void testWideTable() throws Exception {
485
485
486
486
@Test
487
487
publicvoidtestMetadataColumns() throwsException {
488
-
customerDatabase.createAndInitialize();
488
+
userDatabase1.createAndInitialize();
489
489
StringsourceDDL =
490
490
String.format(
491
-
"CREATE TABLE customer_source ("
491
+
"CREATE TABLE mysql_users ("
492
492
+ " db_name STRING METADATA FROM 'database_name' VIRTUAL,"
493
493
+ " table_name STRING METADATA VIRTUAL,"
494
-
+ " `id` INT NOT NULL,"
494
+
+ " `id` DECIMAL(20, 0) NOT NULL,"
495
495
+ " name STRING,"
496
496
+ " address STRING,"
497
497
+ " phone_number STRING,"
498
+
+ " email STRING,"
499
+
+ " age INT,"
498
500
+ " primary key (`id`) not enforced"
499
501
+ ") WITH ("
500
502
+ " 'connector' = 'mysql-cdc',"
@@ -511,22 +513,25 @@ public void testMetadataColumns() throws Exception {
511
513
+ ")",
512
514
MYSQL_CONTAINER.getHost(),
513
515
MYSQL_CONTAINER.getDatabasePort(),
514
-
TEST_USER,
515
-
TEST_PASSWORD,
516
-
customerDatabase.getDatabaseName(),
517
-
"customers.*",
516
+
userDatabase1.getUsername(),
517
+
userDatabase1.getPassword(),
518
+
userDatabase1.getDatabaseName(),
519
+
"user_table_.*",
518
520
getDezImplementation(),
519
521
incrementalSnapshot,
520
522
getServerId(),
521
523
getSplitSize());
524
+
522
525
StringsinkDDL =
523
526
"CREATE TABLE sink ("
524
527
+ " database_name STRING,"
525
528
+ " table_name STRING,"
526
-
+ " `id` INT NOT NULL,"
529
+
+ " `id` DECIMAL(20, 0) NOT NULL,"
527
530
+ " name STRING,"
528
531
+ " address STRING,"
529
532
+ " phone_number STRING,"
533
+
+ " email STRING,"
534
+
+ " age INT,"
530
535
+ " primary key (database_name, table_name, id) not enforced"
531
536
+ ") WITH ("
532
537
+ " 'connector' = 'values',"
@@ -536,80 +541,36 @@ public void testMetadataColumns() throws Exception {
536
541
tEnv.executeSql(sinkDDL);
537
542
538
543
// async submit job
539
-
TableResultresult = tEnv.executeSql("INSERT INTO sink SELECT * FROM customer_source");
544
+
TableResultresult = tEnv.executeSql("INSERT INTO sink SELECT * FROM mysql_users");
0 commit comments