在达梦v8,xorm(master分支),反序列化结构体的切片时,time.Time反序列化失败 #2055

Closed
opened 3 months ago by iyongfei · 1 comments

1、建表语句如下:
CREATE TABLE "saflys"
("id" BIGINT NOT NULL IDENTITY(1, 1),
"created_at" TIMESTAMP(6) NULL,
"updated_at" TIMESTAMP(6) NULL,
"deleted_at" TIMESTAMP(6) NULL,
"stime" TIMESTAMP(6) NULL,
"etime" TIMESTAMP(6) NULL,
CONSTRAINT PK_saflys PRIMARY KEY ("id"));

image

结构体定义如下
image

2、插入一条记录,通过get获取单条记录,能取到time.time字段值,通过find获取切片,遍历切片时候,不能取到time.time值

image

以下是dm数据库的插入记录
image

1、建表语句如下: CREATE TABLE "saflys" ("id" BIGINT NOT NULL IDENTITY(1, 1), "created_at" TIMESTAMP(6) NULL, "updated_at" TIMESTAMP(6) NULL, "deleted_at" TIMESTAMP(6) NULL, "stime" TIMESTAMP(6) NULL, "etime" TIMESTAMP(6) NULL, CONSTRAINT PK_saflys PRIMARY KEY ("id")); ![image](/attachments/5f63da1e-374a-4e92-b501-a2393f16d4c5) 结构体定义如下 ![image](/attachments/db14f5fd-e30a-421c-bc05-2ad353f712ec) 2、插入一条记录,通过get获取单条记录,能取到time.time字段值,通过find获取切片,遍历切片时候,不能取到time.time值 ![image](/attachments/97fe701d-a4b3-464d-a578-42b594dd2e6f) 以下是dm数据库的插入记录 ![image](/attachments/db0dd58e-048e-4e1b-a83c-8c187729e01e)
type DATETIME time.Time

\\\ 已经实现 FromDB 和 ToDB 并在 xormplus 里测试过


type Goods struct {
	UpdatedAt   xtime.DATETIME
}

当我某结构体包含定义类型时,反序列化失败

cannot convert time.Date(2021, time.January, 10, 13, 16, 6, 0, time.Local) as bytes

``` type DATETIME time.Time \\\ 已经实现 FromDB 和 ToDB 并在 xormplus 里测试过 type Goods struct { UpdatedAt xtime.DATETIME } ``` 当我某结构体包含定义类型时,反序列化失败 ``` cannot convert time.Date(2021, time.January, 10, 13, 16, 6, 0, time.Local) as bytes ```
lunny closed this issue 3 months ago
lunny referenced this issue from a commit 3 months ago
lunny added the
kind/bug
label 3 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.