Skip to content

Commit 51f2952

Browse files
sougoubramp
authored andcommitted
v3: join tests
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
1 parent 2752e5b commit 51f2952

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

dependency/sqltypes/testing.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,20 @@ func MakeTestFields(names, types string) []*querypb.Field {
5353
// "10|abcd",
5454
// )
5555
// The field type values are set as the types for the rows built.
56-
// Spaces are trimmed from row values.
56+
// Spaces are trimmed from row values. "null" is treated as NULL.
5757
func MakeTestResult(fields []*querypb.Field, rows ...string) *Result {
5858
result := &Result{
5959
Fields: fields,
60-
Rows: make([][]Value, len(rows)),
60+
}
61+
if len(rows) > 0 {
62+
result.Rows = make([][]Value, len(rows))
6163
}
6264
for i, row := range rows {
6365
result.Rows[i] = make([]Value, len(fields))
6466
for j, col := range split(row) {
67+
if col == "null" {
68+
continue
69+
}
6570
result.Rows[i][j] = MakeTrusted(fields[j].Type, []byte(col))
6671
}
6772
}

0 commit comments

Comments
 (0)