You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createtablet(a int, b enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') not null);
altertable t set tiflash replica 1;
insert into t values (1, "a");
select*from t as t1 right join t as t2 ont1.a!=t2.a;
error message:
ERROR 1105 (HY000): DB::Exception: Duplicate names in enum: 'a'=27and'a'=1
TiDB add enum types repeatedly in the following codes:
file: tidb/planner/core/plan_to_pb.go
func (e *PhysicalExchangeReceiver) ToPB(ctx sessionctx.Context, storeType kv.StoreType) (*tipb.Executor, error) {
...
for _, column := range e.Schema().Columns {
pbType := expression.ToPBFieldType(column.RetType)
if column.RetType.Tp == mysql.TypeEnum {
pbType.Elems = append(pbType.Elems, column.RetType.Elems...)
}
fieldTypes = append(fieldTypes, pbType)
...
}
pbTypes.Elems has been initialized in the clause pbType := expression.ToPBFieldType(column.RetType) and there is no need to append Elems again in pbType.Elems = append(pbType.Elems, column.RetType.Elems...).
I suggest to delete the pbType.Elems = append(pbType.Elems, column.RetType.Elems...)
reproduce step:
error message:
version:
20210617 tiup playground nightly
The text was updated successfully, but these errors were encountered: