go-xorm / xorm

Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
BSD 3-Clause "New" or "Revised" License
6.67k stars 754 forks source link

当xorm标签中的deleted字段的类型为int,且值为0时,会查不到这条数据 #1011

Open dwdcth opened 6 years ago

dwdcth commented 6 years ago

如题,sql log为: (deleted_time IS NULL OR deleted_time=?) []interface {}{ "0001-01-01 00:00:00"} 这里是否应该根据deleted 类型判断一下

bruinxs commented 6 years ago

而且如果使用的是postgresSQL数据库,还会报错pq: 无效的整数类型输入语法: "0001-01-01 00:00:00"