This is an automated email from the ASF dual-hosted git repository.
luky116 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-seata-go.git
The following commit(s) were added to refs/heads/master by this push:
new 104269f5 fix: failed to decode ColumnImage mysql:text type by json
(#780)
104269f5 is described below
commit 104269f54db5fd403485ca35b01a94ec4f88e900
Author: LeeHao <[email protected]>
AuthorDate: Sat Mar 15 19:18:14 2025 +0800
fix: failed to decode ColumnImage mysql:text type by json (#780)
Signed-off-by: LeeHao <[email protected]>
---
pkg/datasource/sql/types/image.go | 2 +-
pkg/datasource/sql/types/image_test.go | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/pkg/datasource/sql/types/image.go
b/pkg/datasource/sql/types/image.go
index 0290b366..3244cef9 100644
--- a/pkg/datasource/sql/types/image.go
+++ b/pkg/datasource/sql/types/image.go
@@ -251,7 +251,7 @@ func (c *ColumnImage) UnmarshalJSON(data []byte) error {
if err != nil {
return err
}
- case JDBCTypeChar, JDBCTypeVarchar:
+ case JDBCTypeChar, JDBCTypeVarchar, JDBCTypeLongVarchar:
var val []byte
if val, err =
base64.StdEncoding.DecodeString(value.(string)); err != nil {
val = []byte(value.(string))
diff --git a/pkg/datasource/sql/types/image_test.go
b/pkg/datasource/sql/types/image_test.go
index 86e03735..88003b9b 100644
--- a/pkg/datasource/sql/types/image_test.go
+++ b/pkg/datasource/sql/types/image_test.go
@@ -42,6 +42,16 @@ func TestColumnImage_UnmarshalJSON(t *testing.T) {
},
expectValue: "Seata-go",
},
+ {
+ name: "test-text",
+ image: &ColumnImage{
+ KeyType: IndexTypePrimaryKey,
+ ColumnName: "Text",
+ ColumnType: JDBCTypeLongVarchar,
+ Value: []byte("Seata-go"),
+ },
+ expectValue: "Seata-go",
+ },
{
name: "test-int",
image: &ColumnImage{
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]