Delete select clause after Count, close #3814

This commit is contained in:
Jinzhu 2020-12-02 17:27:07 +08:00
parent 0c12a4c360
commit 51568ba4ab
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ func (db *DB) Count(count *int64) (tx *DB) {
}
tx.Statement.AddClause(clause.Select{Expression: expr})
defer tx.Statement.AddClause(clause.Select{})
defer delete(tx.Statement.Clauses, "SELECT")
}
if orderByClause, ok := db.Statement.Clauses["ORDER BY"]; ok {