Skip to content

Commit

Permalink
Merge pull request #89297 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.2-88969

release-22.2: sql: address minor typos in recent overflow fix
  • Loading branch information
mgartner authored Oct 5, 2022
2 parents b628b8a + 5a4b5f0 commit 4f7dadf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/overflow
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ true
# constant addend to the right side of the comparison when the subtraction would
# overflow.
query B
SELECT i + 1000 > -9223372036854775800 FROM t88128
SELECT i + (-1000) < 9223372036854775800 FROM t88128
----
true
6 changes: 3 additions & 3 deletions pkg/sql/opt/norm/comp_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ func (c *CustomFuncs) CommuteInequality(

// FoldBinaryCheckOverflow attempts to evaluate a binary expression with
// constant inputs. The only operations supported are plus and minus. It returns
// a constant expression as if all the following criteria are met:
// a constant expression if all the following criteria are met:
//
// 1. The right datum is an integer, float, decimal, or interval. This
// restriction can be lifted for any type that we can construct a zero value
// of. The zero value of the right type is required in order to check for
// overflow/underflow (see #4).
// overflow/underflow (see #5).
// 2. An overload function for the given operator and input types exists and
// has an appropriate volatility.
// 3. The result type of the overload is equivalent to the type of left. This
// is required in order to check for overflow/underflow (see #4).
// is required in order to check for overflow/underflow (see #5).
// 4. The evaluation causes no error.
// 5. The evaluation does not overflow or underflow.
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/norm/rules/comp.opt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
# 1. $leftRight is an integer, float, decimal, or interval. This restriction
# can be lifted for any type that we can construct a zero value of. The
# zero value of the right type is required in order to check for
# overflow/underflow (see #4).
# overflow/underflow (see #5).
# 2. A Minus overload for the given input types exists and has an appropriate
# volatility.
# 3. The result type of the overload is equivalent to the type of $right. This
# is required in order to check for overflow/underflow (see #4).
# is required in order to check for overflow/underflow (see #5).
# 4. The evaluation of the Minus operator causes no error.
# 5. The evaluation of the Minus operator does not overflow or underflow.
#
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sem/tree/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -3027,7 +3027,7 @@ type DInterval struct {
duration.Duration
}

// DZeroInterval is the zero-valued DTimestamp.
// DZeroInterval is the zero-valued DInterval.
var DZeroInterval = &DInterval{}

// AsDInterval attempts to retrieve a DInterval from an Expr, panicking if the
Expand Down

0 comments on commit 4f7dadf

Please sign in to comment.