Skip to content

Commit

Permalink
Blob supports a maximum storage capacity of 64M data (#20713)
Browse files Browse the repository at this point in the history
Blob supports a maximum storage capacity of 64M data

Approved by: @m-schen, @XuPeng-SH
  • Loading branch information
qingxinhome authored Dec 12, 2024
1 parent f02599d commit a786a71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/container/types/bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ const (
MaxBinaryLen = 255
MaxEnumLen = 65535
MaxBitLen = 64
MaxBlobLen = 65535
MaxVarcharLen = MaxBlobLen
MaxVarBinaryLen = MaxBlobLen
MaxStringSize = MaxBlobLen
MaxBlobLen = 67108864 // 64 MB
MaxStringSize = 65535 // 64 KB
MaxVarcharLen = MaxStringSize
MaxVarBinaryLen = MaxStringSize
)

func (v *Varlena) UnsafePtr() unsafe.Pointer {
Expand Down
3 changes: 2 additions & 1 deletion pkg/sql/plan/function/func_unary.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ func LoadFile(ivecs []*vector.Vector, result vector.FunctionResultWrapper, proc
if err != nil {
return err
}
if len(ctx) > 65536 /*blob size*/ {

if len(ctx) > types.MaxBlobLen /*blob size*/ {
return moerr.NewInternalError(proc.Ctx, "Data too long for blob")
}
if len(ctx) == 0 {
Expand Down

0 comments on commit a786a71

Please sign in to comment.