Skip to content

Commit

Permalink
fix(proto): properly handle Enum8 and Enum8(...) in conflicts che…
Browse files Browse the repository at this point in the history
…cker
  • Loading branch information
tdakkota committed Oct 22, 2024
1 parent abd6ab7 commit 958bcc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions proto/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ func (c ColumnType) Conflicts(b ColumnType) bool {
if cBase == ColumnTypeDecimal || bBase == ColumnTypeDecimal {
return c.decimalDowncast() != b.decimalDowncast()
}

if cBase != bBase {
return true
}
switch cBase {
case ColumnTypeEnum8, ColumnTypeEnum16:
return false
}

if c.normalizeCommas() == b.normalizeCommas() {
return false
}
Expand Down
2 changes: 2 additions & 0 deletions proto/column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func TestColumnType_Elem(t *testing.T) {
{A: "Map(String,String)", B: "Map(String, String)"},
{A: "Enum8('increment' = 1, 'gauge' = 2)", B: "Int8"},
{A: "Int8", B: "Enum8('increment' = 1, 'gauge' = 2)"},
{A: "Enum8('increment' = 1, 'gauge' = 2)", B: "Enum8"},
{A: "Enum8", B: "Enum8('increment' = 1, 'gauge' = 2)"},
{A: "Decimal256", B: "Decimal(76, 38)"},
{A: "Nullable(Decimal256)", B: "Nullable(Decimal(76, 38))"},
} {
Expand Down

0 comments on commit 958bcc8

Please sign in to comment.