Skip to content

Commit

Permalink
Merge #37938
Browse files Browse the repository at this point in the history
37938: sql: Address inet casting roundtrip issue r=rohany a=rohany

Address a small issue brought up in #32876, where conversion of an inet into a string, and back into an inet would fail. 

Co-authored-by: Rohan Yadav <[email protected]>
  • Loading branch information
craig[bot] and rohany committed Jun 3, 2019
2 parents 4976bca + b3f2f94 commit 79cc7c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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
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

0 comments on commit 79cc7c0

Please sign in to comment.