Skip to content

Commit

Permalink
cleaning up, found root of issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rohany committed May 30, 2019
1 parent 8dac4a7 commit 6e8fb57
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/inet
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ SELECT '0.0.0.0':::INET;
----
0.0.0.0

query T
SELECT '::/0'::inet::text::inet;
----
::/0

# Basic IPv6 tests

query T
Expand Down
1 change: 0 additions & 1 deletion pkg/sql/sem/tree/datum.go
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,6 @@ func MakeDTime(t timeofday.TimeOfDay) *DTime {
// ParseDTime parses and returns the *DTime Datum value represented by the
// provided string, or an error if parsing is unsuccessful.
func ParseDTime(ctx ParseTimeContext, s string) (*DTime, error) {
fmt.Printf("Input time string: %s\n", s)
now := relativeParseTime(ctx)
t, err := pgdate.ParseTime(now, 0 /* mode */, s)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sem/tree/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,7 @@ func PerformCast(ctx *EvalContext, d Datum, t *types.T) (Datum, error) {
case *DUuid:
s = t.UUID.String()
case *DIPAddr:
s = t.String()
s = AsStringWithFlags(d, FmtBareStrings)
case *DString:
s = string(*t)
case *DCollatedString:
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/sem/tree/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func AsStringWithFQNames(n NodeFormatter, ann *Annotations) string {

// AsString pretty prints a node to a string.
func AsString(n NodeFormatter) string {
return AsStringWithFlags(n, FmtSimple|FmtBareStrings)
return AsStringWithFlags(n, FmtSimple)
}

// ErrString pretty prints a node to a string. Identifiers are not quoted.
Expand Down
3 changes: 0 additions & 3 deletions pkg/util/ipaddr/ipaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"math"
"math/rand"
"net"
"runtime/debug"
"strconv"
"strings"

Expand Down Expand Up @@ -133,7 +132,6 @@ func (ipAddr IPAddr) String() string {
// mask during net.IPNet.String, so we need to add the mask manually.
return "::ffff:" + ip.String() + "/" + strconv.Itoa(int(ipAddr.Mask))
}
debug.PrintStack()
return ip.String() + "/" + strconv.Itoa(int(ipAddr.Mask))
}

Expand Down Expand Up @@ -179,7 +177,6 @@ func getFamily(addr string) IPFamily {
// examples.
func ParseINet(s string, dest *IPAddr) error {
var maskSize byte

i := strings.IndexByte(s, '/')
family := getFamily(s)

Expand Down

0 comments on commit 6e8fb57

Please sign in to comment.