From 67abc5a2896b1e37b94d126f1ed4e93620fc18e6 Mon Sep 17 00:00:00 2001 From: Slach Date: Fri, 25 Oct 2024 08:44:59 +0400 Subject: [PATCH] fix `Nullable(Enum())` types corner case for `check_parts_columns: true`, fix https://github.com/Altinity/clickhouse-backup/issues/1033 --- pkg/clickhouse/clickhouse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/clickhouse/clickhouse.go b/pkg/clickhouse/clickhouse.go index 1d0d74f3..b4cc43bb 100644 --- a/pkg/clickhouse/clickhouse.go +++ b/pkg/clickhouse/clickhouse.go @@ -1250,7 +1250,7 @@ func (ch *ClickHouse) CheckSystemPartsColumns(ctx context.Context, table *Table) partColumnsDataTypes := make([]ColumnDataTypes, 0) partsColumnsSQL := "SELECT column, groupUniqArray(type) AS uniq_types " + "FROM system.parts_columns " + - "WHERE active AND database=? AND table=? AND type NOT LIKE 'Enum%(%' AND type NOT LIKE 'Tuple(%' type NOT LIKE 'Nullable(Enum%(%' AND type NOT LIKE 'Nullable(Tuple(%' AND type NOT LIKE 'Array(Tuple(%' AND type NOT LIKE 'Nullable(Array(Tuple(%' " + + "WHERE active AND database=? AND table=? AND type NOT LIKE 'Enum%(%' AND type NOT LIKE 'Tuple(%' AND type NOT LIKE 'Nullable(Enum%(%' AND type NOT LIKE 'Nullable(Tuple(%' AND type NOT LIKE 'Array(Tuple(%' AND type NOT LIKE 'Nullable(Array(Tuple(%' " + "GROUP BY column HAVING length(uniq_types) > 1" if err = ch.SelectContext(ctx, &partColumnsDataTypes, partsColumnsSQL, table.Database, table.Name); err != nil { return err