gorm 版本 v1 ``` type Player struct { Id int64 age string }
player := Player{} orm.Find(&player,1).Error
orm.Debug().Model(&player).Updates(map[string]interface{}{"age": "86aaa"}).Error ``
生成的sql 是
UPDATE player SET age = '86aaa' WHERE id = 1;
重点:实际数据库的 age 字段类型是int
这样最终会导致id为1 的记录 age更新为86的记录,而不是86aaa,而没有任何报错,这是为什么呢?
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨