-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.
Description
Go version
go1.25.0 darwin/arm64
GoFrame version
v2.9.4
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
When storing a binary []byte slice (such as a gob stream) in a PostgreSQL bytea column and
retrieving it using the gogf/gf ORM, the record.Get("column").Bytes() method does not
return a byte-for-byte identical slice. It appears to append extra, unexpected data to the
end of the byte slice, causing deserialization errors for binary formats like gob.
Environment:
- Database: PostgreSQL
- Column Type: bytea
What did you see happen?
Steps to Reproduce:
- Save a []byte slice to a bytea column using dao.Data(do.MyStruct{Value:
myBytes}).Save(). - Retrieve the row using dao.Where(...).One().
- Get the value using retrievedBytes := record.Get("value").Bytes().
- Compare the len() and sha256.Sum256() of myBytes and retrievedBytes.
What did you expect to see?
Expected Result:
The length and SHA256 hash of the original and retrieved byte slices should be identical.
Actual Result:
The retrieved byte slice is longer than the original and has a different SHA256 hash,
indicating data corruption.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.