Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dameng database clob type mapping error #2648

Closed
tianbocheng opened this issue May 16, 2023 · 5 comments
Closed

dameng database clob type mapping error #2648

tianbocheng opened this issue May 16, 2023 · 5 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. help wanted

Comments

@tianbocheng
Copy link

tianbocheng commented May 16, 2023

一、开发环境

  • github.com/gogf/gf/contrib/drivers/dm/v2 v2.4.1
  • github.com/gogf/gf/v2 v2.4.1

二、操作步骤

2.1 初始化数据库表

CREATE TABLE HANDLE_INFO (
                             ID INT IDENTITY (1, 1) NOT NULL,
                             SUB_PREFIX VARCHAR(128),
                             PREFIX VARCHAR(256),
                             HANDLE_NAME VARCHAR(1024) NOT NULL,
                             CREATE_TIME TIMESTAMP,
                             UPDATE_TIME TIMESTAMP,
                             VALUE CLOB   ,
                             NOT CLUSTER PRIMARY KEY (ID)
);

INSERT INTO OA.HANDLE_INFO (SUB_PREFIX,PREFIX,HANDLE_NAME,CREATE_TIME,UPDATE_TIME,VALUE) VALUES ('88.111','88.111.1','88.111.1/test','2023-05-16 14:37:45.337897','2023-05-16 14:37:45.337897', '[{"a": "b"}]');


2.2 执行查询操作

adsf, _ := g.DB().Model("handle_info").Where("handle_name", handle).One()
fmt.Println(adsf)

查询到 clob 字段与中不一致,结果为 {"Valid":true} 但是库中并非如此

image
@zhonghuaxunGM
Copy link
Member

Dameng database clob corresponding mysql is a blob?
What is the correct value? Is it a character problem or a content conversion problem?

@tianbocheng
Copy link
Author

tianbocheng commented Jun 8, 2023

Dameng database clob corresponding mysql is a blob? What is the correct value? Is it a character problem or a content conversion problem?

this is a content conversion problem

find one record by handle_name return gdb.Record , gdb.Record "VALUE" conversion is wrong

adsf, _ := g.DB().Model("handle_info").Where("handle_name", handle).One()
fmt.Println(adsf)

"VALUE" content is wrong , should like this image

image

@gqcn gqcn added bug It is confirmed a bug, but don't worry, we'll handle it. help wanted labels Aug 21, 2023
@github-actions
Copy link

Hello @tianbocheng. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @tianbocheng。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@wln32
Copy link
Member

wln32 commented May 5, 2024

最新版2.7.0中已修复

@wln32 wln32 closed this as completed May 5, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Fixed in the latest version 2.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. help wanted
Projects
None yet
Development

No branches or pull requests

5 participants