FindAndCount 生成的SQL语句会多判断一次 deleted #1617

Closed
opened 2020-03-23 09:02:33 +00:00 by kisesy · 1 comment
Contributor

重复 #1398 因为原帖无法回复,所以重开一个

比如:

type Comment struct {
	Id        int               `xorm:"pk autoincr"`
	DeletedAt int64             `xorm:"deleted notnull default(0) index"`
}

var comments []Comment
x.FindAndCount(&comments)
[xorm] [info]  2020/03/23 16:53:00.492750 [SQL] SELECT count(*) FROM `comment` WHERE deleted_at=? AND deleted_at=? [0 0] - 999.4µs

deleted_at=? AND deleted_at=? 重复判断,如果单独使用 Find 就是一个判断

重复 https://gitea.com/xorm/xorm/issues/1398 因为原帖无法回复,所以重开一个 比如: ```go type Comment struct { Id int `xorm:"pk autoincr"` DeletedAt int64 `xorm:"deleted notnull default(0) index"` } var comments []Comment x.FindAndCount(&comments) ``` ```sql [xorm] [info] 2020/03/23 16:53:00.492750 [SQL] SELECT count(*) FROM `comment` WHERE deleted_at=? AND deleted_at=? [0 0] - 999.4µs ``` deleted_at=? AND deleted_at=? 重复判断,如果单独使用 Find 就是一个判断
lunny added the
kind
bug
label 2020-03-23 12:45:44 +00:00
lunny added this to the 1.0.1 milestone 2020-03-23 12:54:21 +00:00
Author
Contributor

这个我测试也可以了

这个我测试也可以了
lunny closed this issue 2020-03-23 14:42:43 +00:00
lunny reopened this issue 2020-03-23 14:43:07 +00:00
lunny closed this issue 2020-03-24 00:48:57 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1617
No description provided.