Ensure aliased GROUP BY fields are output correctly

This commit is contained in:
Tobie Morgan Hitchcock 2022-07-30 22:57:30 +01:00
parent b5b8f70330
commit 3c57496655

View file

@ -204,7 +204,10 @@ impl Iterator {
if let Field::Alias(v, i) = field { if let Field::Alias(v, i) = field {
match v { match v {
Value::Function(f) if f.is_aggregate() => { Value::Function(f) if f.is_aggregate() => {
let x = vals.all().get(ctx, opt, txn, i).await?; let x = vals
.all()
.get(ctx, opt, txn, v.to_idiom().as_ref())
.await?;
let x = f.aggregate(x).compute(ctx, opt, txn, None).await?; let x = f.aggregate(x).compute(ctx, opt, txn, None).await?;
obj.set(ctx, opt, txn, i, x).await?; obj.set(ctx, opt, txn, i, x).await?;
} }