@@ -9352,6 +9352,20 @@ from typestable`,
93529352 {"0" }, {"1" }, {"0" }, {"1" },
93539353 },
93549354 },
9355+ // https://github.com/dolthub/dolt/issues/7095
9356+ // References in group by and having should be allowed to match select aliases
9357+ {
9358+ Query : "select y as z from xy group by (y) having AVG(z) > 0" ,
9359+ Expected : []sql.Row {{1 }, {2 }, {3 }},
9360+ },
9361+ {
9362+ Query : "select y as z from xy group by (z) having AVG(z) > 0" ,
9363+ Expected : []sql.Row {{1 }, {2 }, {3 }},
9364+ },
9365+ {
9366+ Query : "select y + 1 as z from xy group by (z) having AVG(z) > 1" ,
9367+ Expected : []sql.Row {{2 }, {3 }, {4 }},
9368+ },
93559369}
93569370
93579371var KeylessQueries = []QueryTest {
@@ -9603,20 +9617,6 @@ FROM mytable;`,
96039617 {"DECIMAL" },
96049618 },
96059619 },
9606- // https://github.com/dolthub/dolt/issues/7095
9607- // References in group by and having should be allowed to match select aliases
9608- {
9609- Query : "select y as z from xy group by (y) having AVG(z) > 0" ,
9610- Expected : []sql.Row {{1 }, {2 }, {3 }},
9611- },
9612- {
9613- Query : "select y as z from xy group by (z) having AVG(z) > 0" ,
9614- Expected : []sql.Row {{1 }, {2 }, {3 }},
9615- },
9616- {
9617- Query : "select y + 1 as z from xy group by (z) having AVG(z) > 1" ,
9618- Expected : []sql.Row {{2 }, {3 }, {4 }},
9619- },
96209620}
96219621
96229622var VersionedQueries = []QueryTest {
0 commit comments