Skip to content

Commit 448178b

Browse files
committed
Failing tests for nullability in result schemas
1 parent bbd0659 commit 448178b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

enginetest/evaluation.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ func checkResultsDefault(t *testing.T, ctx *sql.Context, expected []sql.Row, exp
868868
type resultSchemaCol struct {
869869
Name string
870870
Type querypb.Type
871+
Nullable bool
871872
}
872873

873874
func simplifyResultSchema(s sql.Schema) []resultSchemaCol {
@@ -876,6 +877,7 @@ func simplifyResultSchema(s sql.Schema) []resultSchemaCol {
876877
fields[i] = resultSchemaCol{
877878
Name: c.Name,
878879
Type: c.Type.Type(),
880+
Nullable: c.Nullable,
879881
}
880882
}
881883
return fields

enginetest/queries/queries.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,17 @@ var QueryTests = []QueryTest{
10721072
Query: "select sum(1) from emptytable",
10731073
Expected: []sql.Row{{nil}},
10741074
},
1075+
{
1076+
Query: "select sum(1) as s from emptytable",
1077+
Expected: []sql.Row{{nil}},
1078+
ExpectedColumns: sql.Schema{
1079+
{
1080+
Name: "s",
1081+
Type: types.Float64,
1082+
Nullable: true,
1083+
},
1084+
},
1085+
},
10751086
{
10761087
Query: "select * from (select count(*) from xy) dt",
10771088
Expected: []sql.Row{{4}},

0 commit comments

Comments
 (0)