Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
This test case was based on the incorrect assumption that
`SELECT t.a FROM (VALUES 1, 1, null, 3) t(a) LIMIT 1`
will result in `1` and not in any other value from the VALUES.
It was fixed by moving filter below limit.
  • Loading branch information
kasiafi authored and kokosing committed Oct 14, 2019
1 parent 8c2d6bd commit 77f347b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testCorrelatedSubqueriesWithLimit()
"SELECT (SELECT sum(t.a) FROM (VALUES 1, 2) t(a) WHERE t.a=t2.b group by t.a LIMIT 2) FROM (VALUES 1) t2(b)",
"VALUES BIGINT '1'");
assertions.assertQuery(
"SELECT (SELECT count(*) FROM (SELECT t.a FROM (VALUES 1, 1, null, 3) t(a) LIMIT 1) t WHERE t.a=t2.b) FROM (VALUES 1, 2) t2(b)",
"SELECT (SELECT count(*) FROM (SELECT t.a FROM (VALUES 1, 1, null, 3) t(a) WHERE t.a=t2.b LIMIT 1)) FROM (VALUES 1, 2) t2(b)",
"VALUES BIGINT '1', BIGINT '0'");
assertExistsRewrittenToAggregationBelowJoin(
"SELECT EXISTS(SELECT 1 FROM (VALUES 1, 1, 3) t(a) WHERE t.a=t2.b LIMIT 1) FROM (VALUES 1, 2) t2(b)",
Expand Down

0 comments on commit 77f347b

Please sign in to comment.