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

database/gdb: After mssql query data is converted into map, the underlying data type is inconsistent with the expected #4089

Open
sanrentai opened this issue Dec 31, 2024 · 4 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it.

Comments

@sanrentai
Copy link
Contributor

Go version

go version go1.20.14 windows/amd64

GoFrame version

v2.8.3

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

package main

import (
	_ "github.com/gogf/gf/contrib/drivers/mssql/v2"

	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gctx"
)
func main() {
	var (
		v   int   = 1
		v64 int64 = 1
	)
	var ctx = gctx.New()
	_, err := g.DB().Exec(ctx, `create table t_test(
		v int,
		v64 bigint,
	)`)
	if err != nil {
		panic(err)
	}
	_, err = g.DB().Model("t_test").Ctx(ctx).Insert(g.Map{
		"v":   v,
		"v64": v64,
	})
	if err != nil {
		panic(err)
	}
	one, err := g.DB().Model("t_test").Ctx(ctx).One()
	if err != nil {
		panic(err)
	}
	g.Log().Info(ctx, one.Map()["v"] == v, one.Map()["v64"] == v64)

	_, err = g.DB().Exec(ctx, `drop table t_test`)
	if err != nil {
		panic(err)
	}
}

What did you see happen?

false true

What did you expect to see?

true true

@sanrentai sanrentai added the bug It is confirmed a bug, but don't worry, we'll handle it. label Dec 31, 2024
@Issues-translate-bot Issues-translate-bot changed the title database/gdb: mssql 查询数据转换成map后,底层的数据类型跟预期的不一致 database/gdb: After mssql query data is converted into map, the underlying data type is inconsistent with the expected Dec 31, 2024
@sanrentai
Copy link
Contributor Author

sanrentai commented Dec 31, 2024

我测试了多个版本,发现2.3.1 和之前的版本返回的是 true true, 在2.3.2之后的版本返回的是 false true

@Issues-translate-bot
Copy link

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


I tested several versions and found that 2.3.1 and previous versions returned true true, and versions after 2.3.2 returned false true.

@sanrentai
Copy link
Contributor Author

数据库版本是 sql server 2008 r2

@Issues-translate-bot
Copy link

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


The database version is sql server 2008 r2

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.
Projects
None yet
Development

No branches or pull requests

2 participants