Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Gorm问题,.raw()导致连接超时_Mysql_Go_Go Gorm - Fatal编程技术网

Mysql Gorm问题,.raw()导致连接超时

Mysql Gorm问题,.raw()导致连接超时,mysql,go,go-gorm,Mysql,Go,Go Gorm,因此,我的程序以前工作得非常好,出于某种原因(并非必要),我在函数中插入了一个.raw()sql,它导致了(110:连接超时)。是因为raw()占用了一个连接而从未关闭它吗 func ErrorLog(id uint, working *WorkingRecord, record map[string]interface{}) { instance, err := db.GetDBInstance() instance.Gorm().Raw("UPDATE

因此,我的程序以前工作得非常好,出于某种原因(并非必要),我在函数中插入了一个.raw()sql,它导致了(110:连接超时)。是因为raw()占用了一个连接而从未关闭它吗

func ErrorLog(id uint, working *WorkingRecord, record map[string]interface{}) {

      instance, err := db.GetDBInstance()

      instance.Gorm().Raw("UPDATE `renopipe`.`attendences` SET `log` = ? WHERE id =?", record["body"], id).Scan(&attendence)

      return record["body"]
}