diff --git a/cdc/entry/mounter.go b/cdc/entry/mounter.go index c663a05c7b3..c11b9c081f4 100644 --- a/cdc/entry/mounter.go +++ b/cdc/entry/mounter.go @@ -756,6 +756,7 @@ func getDefaultOrZeroValue(col *timodel.ColumnInfo) (types.Datum, any, int, stri return d, v, size, warn, err } +// GetDDLDefaultDefinition returns the default definition of a column. func GetDDLDefaultDefinition(col *timodel.ColumnInfo) interface{} { defaultValue := col.GetDefaultValue() if defaultValue == nil { diff --git a/cdc/entry/mounter_test.go b/cdc/entry/mounter_test.go index e2cf6c4308a..dc9c019a6e1 100644 --- a/cdc/entry/mounter_test.go +++ b/cdc/entry/mounter_test.go @@ -1003,7 +1003,7 @@ func TestGetDefaultZeroValue(t *testing.T) { for _, tc := range testCases { _, val, _, _, _ := getDefaultOrZeroValue(&tc.ColInfo) require.Equal(t, tc.Res, val, tc.Name) - val = getDDLDefaultDefinition(&tc.ColInfo) + val = GetDDLDefaultDefinition(&tc.ColInfo) require.Equal(t, tc.Default, val, tc.Name) } }