time.Time 类型,tag 为 deleted not null 的字段在 insert 的时候,会将 UTC 时区的 time.Time{} 转换为数据库时区,导致查询不到 #2208
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2208
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
这是 insert 时对 deleted 字段的处理:
这是 select 时对 deleted 字段的处理:
总觉得select的时候无视了时区只查 deleted_at = 0001-01-01 00:00:00 的数据,那对称的话,insert的时候就不该把tag 为 deleted 的字段的值 time.Time{} 的时区指定为 local 变为 0001-01-01 08:05:43 导致 select 查不出来
把该字段设置为可以为null的确可以避开这个问题本身,但是会导致无法对该软删除字段建联合唯一索引了,因为会使得联合唯一索引失效。
fix in #2295