Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: address minor typos in recent overflow fix #88969

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
sql: address minor typos in recent overflow fix
This commit fixes minor typos introduced in #88199.

Release note: None
mgartner committed Sep 29, 2022
commit cebb8abce5dd5f588330793a01599274b95e3edf
2 changes: 1 addition & 1 deletion pkg/sql/logictest/testdata/logic_test/overflow
Original file line number Diff line number Diff line change
@@ -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
@@ -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.
//
4 changes: 2 additions & 2 deletions pkg/sql/opt/norm/rules/comp.opt
Original file line number Diff line number Diff line change
@@ -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.
#
2 changes: 1 addition & 1 deletion pkg/sql/sem/tree/datum.go
Original file line number Diff line number Diff line change
@@ -3031,7 +3031,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