Skip to content

Commit e169866

Browse files
committed
added test with more rows, primary key, and true/false groups
1 parent bc36c09 commit e169866

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

enginetest/queries/order_by_group_by_queries.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,23 @@ var OrderByGroupByScriptTests = []ScriptTest{
326326
SetUpScript: []string{
327327
"create table t0(c0 int, c1 int)",
328328
"insert into t0(c0, c1) values(NULL,1),(1,NULL)",
329+
"create table t1(id int primary key, c0 int, c1 int)",
330+
"insert into t1(id, c0, c1) values(1,NULL,NULL),(2,1,1),(3,1,NULL),(4,2,1),(5,NULL,1)",
329331
},
330332
Assertions: []ScriptTestAssertion{
331333
{
332-
Query: "select t0.c0 = t0.c1 as ref0, sum(1) as ref1 from t0 group by ref0",
333-
Expected: []sql.Row{{nil, float64(2)}},
334+
Query: "select t0.c0 = t0.c1 as ref0, sum(1) as ref1 from t0 group by ref0",
335+
Expected: []sql.Row{
336+
{nil, float64(2)},
337+
},
338+
},
339+
{
340+
Query: "select t1.c0 = t1.c1 as ref0, sum(1) as ref1 from t1 group by ref0",
341+
Expected: []sql.Row{
342+
{nil, float64(3)},
343+
{true, float64(1)},
344+
{false, float64(1)},
345+
},
334346
},
335347
},
336348
},

0 commit comments

Comments
 (0)