|
9 | 9 | "fmt"
|
10 | 10 | "testing"
|
11 | 11 |
|
12 |
| - "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" |
13 | 12 | "github.com/cockroachdb/cockroach/pkg/sql/types"
|
14 | 13 | "github.com/cockroachdb/cockroach/pkg/util/leaktest"
|
15 | 14 | "github.com/cockroachdb/cockroach/pkg/util/randutil"
|
@@ -67,30 +66,7 @@ func TestCanonical(t *testing.T) {
|
67 | 66 | datum := RandDatum(rng, typ, false)
|
68 | 67 | datumTyp := datum.ResolvedType()
|
69 | 68 | if !datumTyp.Equivalent(typ.Canonical()) {
|
70 |
| - var tupleHasNullElement func(tree.Datum) bool |
71 |
| - tupleHasNullElement = func(d tree.Datum) bool { |
72 |
| - tup, ok := d.(*tree.DTuple) |
73 |
| - if !ok { |
74 |
| - return false |
75 |
| - } |
76 |
| - for _, el := range tup.D { |
77 |
| - if el == tree.DNull { |
78 |
| - return true |
79 |
| - } |
80 |
| - if tupleHasNullElement(el) { |
81 |
| - return true |
82 |
| - } |
83 |
| - } |
84 |
| - return false |
85 |
| - } |
86 |
| - // If we have a tuple, then we might have included a NULL element. |
87 |
| - // By construction in RandDatum, TupleContents[i] has been updated |
88 |
| - // to types.Unknown. In such case, we give an exception and don't |
89 |
| - // fail the test. |
90 |
| - tupleException := tupleHasNullElement(datum) |
91 |
| - if !tupleException { |
92 |
| - t.Errorf("fail: canonical type of %+v is %+v and the datum's type is %+v", typ, typ.Canonical(), datumTyp) |
93 |
| - } |
| 69 | + t.Errorf("fail: canonical type of %+v is %+v and the datum's type is %+v", typ, typ.Canonical(), datumTyp) |
94 | 70 | }
|
95 | 71 |
|
96 | 72 | if datumTyp.Oid() != typ.Canonical().Oid() {
|
|
0 commit comments