diff --git a/internal/proxy/task.go b/internal/proxy/task.go index e6488aa3627ff..023138ee309d8 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -1246,14 +1246,11 @@ func (t *alterCollectionFieldTask) PreExecute(ctx context.Context) error { if !IsStringType { return merr.WrapErrParameterInvalid(fieldName, "%s can not modify the maxlength for non-string types", schemapb.DataType_name[dataType]) } - value, err := strconv.Atoi(prop.Value) + _, err := strconv.Atoi(prop.Value) if err != nil { return merr.WrapErrParameterInvalid("%s should be an integer, but got %T", prop.Key, prop.Value) } - if value > defaultMaxVarCharLength { - return merr.WrapErrParameterInvalid("%s exceeds the maximum allowed value 65535", prop.Value) - } } } diff --git a/internal/proxy/util.go b/internal/proxy/util.go index a159e2d950777..ead13707f7b9f 100644 --- a/internal/proxy/util.go +++ b/internal/proxy/util.go @@ -364,8 +364,8 @@ func validateMaxLengthPerRow(collectionName string, field *schemapb.FieldSchema) if err != nil { return err } - if maxLengthPerRow > defaultMaxVarCharLength || maxLengthPerRow <= 0 { - return merr.WrapErrParameterInvalidMsg("the maximum length specified for a VarChar should be in (0, 65535]") + if maxLengthPerRow <= 0 { + return merr.WrapErrParameterInvalidMsg("the maximum length specified for a VarChar should be greater than 0") } exist = true }