Skip to content

Commit

Permalink
remove field stringtype length limit
Browse files Browse the repository at this point in the history
Signed-off-by: Xianhui.Lin <[email protected]>

modify the message hint

Signed-off-by: Xianhui.Lin <[email protected]>
  • Loading branch information
JsDove committed Dec 19, 2024
1 parent 306e5e6 commit a084eae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions internal/proxy/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 1249 in internal/proxy/task.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/task.go#L1249

Added line #L1249 was not covered by tests
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)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/proxy/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Check warning on line 368 in internal/proxy/util.go

View check run for this annotation

Codecov / codecov/patch

internal/proxy/util.go#L368

Added line #L368 was not covered by tests
}
exist = true
}
Expand Down

0 comments on commit a084eae

Please sign in to comment.