From 60b4b36a9cdbd06908b4157aa13f52b2f4b1b3f4 Mon Sep 17 00:00:00 2001 From: 3AceShowHand Date: Tue, 21 Nov 2023 16:22:47 +0800 Subject: [PATCH] fix all unit test. --- pkg/sink/codec/canal/type_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/sink/codec/canal/type_test.go b/pkg/sink/codec/canal/type_test.go index 87ded464bb6..46b1f5d6302 100644 --- a/pkg/sink/codec/canal/type_test.go +++ b/pkg/sink/codec/canal/type_test.go @@ -76,6 +76,7 @@ func TestGetMySQLType4IntTypes(t *testing.T) { require.Equal(t, internal.JavaSQLTypeSMALLINT, javaType) columnInfo, ok = tableInfo.GetColumnInfo(colInfos[3].ID) + require.True(t, ok) flag = tableInfo.ColumnsFlag[colInfos[3].ID] mysqlType = getMySQLType(columnInfo, false) require.Equal(t, "mediumint", mysqlType) @@ -86,6 +87,7 @@ func TestGetMySQLType4IntTypes(t *testing.T) { require.Equal(t, internal.JavaSQLTypeINTEGER, javaType) columnInfo, ok = tableInfo.GetColumnInfo(colInfos[4].ID) + require.True(t, ok) flag = tableInfo.ColumnsFlag[colInfos[4].ID] mysqlType = getMySQLType(columnInfo, false) require.Equal(t, "bigint", mysqlType) @@ -107,6 +109,7 @@ func TestGetMySQLType4IntTypes(t *testing.T) { _, _, colInfos = tableInfo.GetRowColInfos() columnInfo, ok = tableInfo.GetColumnInfo(colInfos[0].ID) + require.True(t, ok) flag = tableInfo.ColumnsFlag[colInfos[0].ID] mysqlType = getMySQLType(columnInfo, false) require.Equal(t, "int unsigned", mysqlType)