Skip to content

Commit

Permalink
CBG-667 - Backport CBG-659 to 2.7.1 (#4499)
Browse files Browse the repository at this point in the history
CBG-659 - Order channels query by ascending sequence (#4443)

* Order channels query by ascending sequence

* Update db/query.go

Co-authored-by: Adam Fraser <adam.fraser@couchbase.com>

Co-authored-by: Adam Fraser <adam.fraser@couchbase.com>
  • Loading branch information
bbrks and adamcfraser committed Feb 18, 2020
1 parent 20d3706 commit fd9c6d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ var QueryChannels = SGQuery{
"FROM `%s` "+
"USE INDEX ($idx) "+
"UNNEST OBJECT_PAIRS($sync.channels) AS op "+
"WHERE [op.name, LEAST($sync.sequence, op.val.seq),IFMISSING(op.val.rev,null),IFMISSING(op.val.del,null)] BETWEEN [$channelName, $startSeq] AND [$channelName, $endSeq]",
"WHERE [op.name, LEAST($sync.sequence, op.val.seq),IFMISSING(op.val.rev,null),IFMISSING(op.val.del,null)] BETWEEN [$channelName, $startSeq] AND [$channelName, $endSeq] "+
"ORDER BY seq",
base.BucketQueryToken, base.BucketQueryToken),
adhoc: false,
}
Expand Down

0 comments on commit fd9c6d6

Please sign in to comment.