库的版本: gorm.io/driver/mysql v1.5.7 gorm.io/gorm v1.25.12

go的版本: 1.24.3

模型文件: AutoClose bool json:"autoClose" gorm:"column:auto_close;type:tinyint;default:true;not nul;comment:是否自动关闭"

使用插入的函数: CreateInBatches

现象: 插入的结构的AutoClose值为false,然后使用 CreateInBatches插入到数据库时,字段的值会变为true的。 通过打印sql得出是gorm在插入时会把这个值改为true。

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