Skip to content

Commit 8a7da93

Browse files
authored
codec(ticdc): fix test in debezium protocol (#12176)
ref #11566
1 parent 40b34d5 commit 8a7da93

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

pkg/sink/codec/debezium/codec_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ func TestDDLEvent(t *testing.T) {
486486
query = "DROP TABLE test.table2"
487487
e = &model.DDLEvent{
488488
CommitTs: 1,
489+
TableInfo: preTableInfo,
489490
PreTableInfo: preTableInfo,
490491
Query: query,
491492
Type: timodel.ActionDropTable,
@@ -509,8 +510,8 @@ func TestDDLEvent(t *testing.T) {
509510
"name": "test_cluster",
510511
"ts_ms": 0,
511512
"snapshot": "false",
512-
"db": "",
513-
"table": "",
513+
"db": "test",
514+
"table": "table2",
514515
"server_id": 0,
515516
"gtid": null,
516517
"file": "",
@@ -525,7 +526,13 @@ func TestDDLEvent(t *testing.T) {
525526
"databaseName": "test",
526527
"schemaName": null,
527528
"ddl": "DROP TABLE test.table2",
528-
"tableChanges": []
529+
"tableChanges": [
530+
{
531+
"type": "DROP",
532+
"id": "\"test\".\"table2\"",
533+
"table": null
534+
}
535+
]
529536
}
530537
}`, buf.String())
531538
}

tests/integration_tests/debezium/sql/ddl.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ CREATE TABLE t9 (
145145
/* RENAME TABLE */
146146
RENAME TABLE t7 TO rename_t7;
147147
RENAME TABLE t8 To rename_t8, t9 To rename_t9;
148+
RENAME TABLE rename_t8 TO test.t8;
148149

149150
/* TRUNCATE TABLE */
150151
TRUNCATE TABLE rename_t7;

0 commit comments

Comments
 (0)