Skip to content

Commit

Permalink
colexecwindow: remove some assertions that aren't valid
Browse files Browse the repository at this point in the history
This commit removes some of the `gcassert` assertions that are actually
invalid - here we use `// gcassert` as opposed to `//gcassert`, and
since we used the old gcassert version that only enforced the latter,
they weren't actually enforced.

Release note: None
  • Loading branch information
yuzefovich committed Oct 28, 2022
1 parent 9897efa commit a20a82e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
7 changes: 0 additions & 7 deletions pkg/sql/colexec/colexecwindow/min_max_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ func (q *minMaxQueue) isEmpty() bool {
// get returns the element at position pos in the minMaxQueue (zero-based).
// gcassert:inline
func (q *minMaxQueue) get(pos int) uint32 {
if q.empty || pos < 0 || pos >= q.len() {
colexecerror.InternalError(errors.AssertionFailedf("index out of bounds: %d", pos))
}
return q.buffer[(pos+q.head)%cap(q.buffer)]
}

Expand All @@ -75,7 +72,6 @@ func (q *minMaxQueue) getFirst() uint32 {
}

// getLast returns the element at the end of the minMaxQueue.
// gcassert:inline
func (q *minMaxQueue) getLast() uint32 {
if q.empty {
colexecerror.InternalError(errors.AssertionFailedf("getting last from empty minMaxQueue"))
Expand All @@ -87,7 +83,6 @@ func (q *minMaxQueue) getLast() uint32 {
// underlying slice if necessary, subject to the max length limit. If the
// minMaxQueue has already reached the maximum length, addLast returns true,
// otherwise false.
// gcassert:inline
func (q *minMaxQueue) addLast(element uint32) (reachedLimit bool) {
if q.maybeGrow() {
return true
Expand All @@ -99,7 +94,6 @@ func (q *minMaxQueue) addLast(element uint32) (reachedLimit bool) {
}

// removeLast removes a single element from the end of the minMaxQueue.
// gcassert:inline
func (q *minMaxQueue) removeLast() {
if q.empty {
colexecerror.InternalError(errors.AssertionFailedf("removing last from empty ring buffer"))
Expand All @@ -113,7 +107,6 @@ func (q *minMaxQueue) removeLast() {

// removeAllBefore removes from the minMaxQueue all values in the range
// [0, val).
// gcassert:inline
func (q *minMaxQueue) removeAllBefore(val uint32) {
if q.empty {
return
Expand Down
18 changes: 0 additions & 18 deletions pkg/sql/colexec/colexecwindow/min_max_removable_agg.eg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkg/sql/colexec/colexecwindow/min_max_removable_agg_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ func (a *_AGG_TYPEAggregator) processBatch(batch coldata.Batch, startIdx, endIdx
if a.queue.isEmpty() {
outNulls.SetNull(i)
} else {
// {{if not .IsBytesLike}}
// gcassert:bce
// {{end}}
outCol.Set(i, a.curAgg)
}
}
Expand Down

0 comments on commit a20a82e

Please sign in to comment.