Skip to content

Commit

Permalink
Merge pull request #1 from sljeff/master
Browse files Browse the repository at this point in the history
fix for kingshard
  • Loading branch information
HeathLee authored Jul 9, 2020
2 parents 7207664 + d28d294 commit b1d16e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dialect/sql/sqlgraph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func (q *query) count(ctx context.Context, drv dialect.Driver) (int, error) {
selector.Count(selector.C(q.Node.ID.Column))
if q.Unique {
selector.SetDistinct(false)
selector.Count(sql.Distinct(selector.C(q.Node.ID.Column)))
selector.Count()
}
query, args := selector.Query()
if err := drv.Query(ctx, query, args, rows); err != nil {
Expand Down Expand Up @@ -670,7 +670,7 @@ func (u *updater) nodes(ctx context.Context, tx dialect.ExecQuerier) (int, error
if len(ids) == 0 {
return 0, nil
}
update := u.builder.Update(u.Node.Table).Where(matchID(u.Node.ID.Column, ids))
update := u.builder.Update(u.Node.Table).Where(selector.Clone().P())
if err := u.setTableColumns(update, addEdges, clearEdges); err != nil {
return 0, err
}
Expand Down

0 comments on commit b1d16e4

Please sign in to comment.