gorm-driver-dm icon indicating copy to clipboard operation
gorm-driver-dm copied to clipboard

字符串转化错误

Open go1223 opened this issue 2 years ago • 1 comments

数据库表中有数据时,使用in 进行数据查找,如果参数是nil,查询报字符串转化错误,错误堆栈信息如下: ` Error -6111: 字符串转换出错

1). github.com/jeyrce/gorm-dm8-driver/dmr.(*dm_build_741).dm_build_774 H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/zq.go:708 2). github.com/jeyrce/gorm-dm8-driver/dmr.(*dm_build_741).dm_build_730 H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/zq.go:695 3). github.com/jeyrce/gorm-dm8-driver/dmr.(*dm_build_741).dm_build_733 H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/zq.go:745 4). github.com/jeyrce/gorm-dm8-driver/dmr.(*dm_build_332).dm_build_372 H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/a.go:247 5). github.com/jeyrce/gorm-dm8-driver/dmr.(*dm_build_332).Dm_build_439 H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/a.go:452 6). github.com/jeyrce/gorm-dm8-driver/dmr.(*DmStatement).executeInner H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/u.go:882 7). github.com/jeyrce/gorm-dm8-driver/dmr.(*DmStatement).query H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/u.go:418 8). github.com/jeyrce/gorm-dm8-driver/dmr.(*DmStatement).queryContext H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/u.go:437 9). github.com/jeyrce/gorm-dm8-driver/dmr.(*DmConnection).queryContext H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/m.go:639 10). github.com/jeyrce/gorm-dm8-driver/dmr.(*DmConnection).QueryContext H:/CVICSE/dm/pkg/mod/github.com/jeyrce/[email protected]/dmr/m.go:303 11). database/sql.ctxDriverQuery H:/soft/go/src/database/sql/ctxutil.go:48 12). database/sql.(*DB).queryDC.func1 H:/soft/go/src/database/sql/sql.go:1650 13). database/sql.withLock H:/soft/go/src/database/sql/sql.go:3294 14). database/sql.(*DB).queryDC H:/soft/go/src/database/sql/sql.go:1645 15). database/sql.(*DB).query H:/soft/go/src/database/sql/sql.go:1628 16). database/sql.(*DB).QueryContext H:/soft/go/src/database/sql/sql.go:1605 17). gorm.io/gorm/callbacks.Query H:/CVICSE/dm/pkg/mod/gorm.io/[email protected]/callbacks/query.go:18 18). gorm.io/gorm.(*processor).Execute H:/CVICSE/dm/pkg/mod/gorm.io/[email protected]/callbacks.go:130 19). gorm.io/gorm.(*DB).Find H:/CVICSE/dm/pkg/mod/gorm.io/[email protected]/finisher_api.go:170 20). main.CreateStudent H:/CVICSE/dm/src/test/main.go:157 21). main.main H:/CVICSE/dm/src/test/main.go:24 22). runtime.main H:/soft/go/src/runtime/proc.go:225 23). runtime.goexit H:/soft/go/src/runtime/asm_amd64.s:1371 `

go版本:1.16.6 操作系统版本:windows 10(10.0.19043) 数据库版本:dm8_20211025_x86_win_64_ent gorm语句如下: var students []model.Student db.Model(&model.Student{}).Where("id in (?)",[]string{}).Find(&students)``

go1223 avatar Jun 28 '22 11:06 go1223