Ensure aliased field is output when fetching a multi-yield expressions with final alias
Closes #28
This commit is contained in:
parent
20a6ed88d3
commit
2ffa71d520
1 changed files with 6 additions and 2 deletions
|
@ -116,7 +116,7 @@ impl Fields {
|
||||||
for (p, x) in res {
|
for (p, x) in res {
|
||||||
match p.last().unwrap().alias() {
|
match p.last().unwrap().alias() {
|
||||||
// This is an alias expression part
|
// This is an alias expression part
|
||||||
Some(i) => out.set(ctx, opt, txn, i, x).await?,
|
Some(a) => out.set(ctx, opt, txn, a, x).await?,
|
||||||
// This is the end of the expression
|
// This is the end of the expression
|
||||||
None => out.set(ctx, opt, txn, v, x).await?,
|
None => out.set(ctx, opt, txn, v, x).await?,
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,11 @@ impl Fields {
|
||||||
for (p, x) in res {
|
for (p, x) in res {
|
||||||
match p.last().unwrap().alias() {
|
match p.last().unwrap().alias() {
|
||||||
// This is an alias expression part
|
// This is an alias expression part
|
||||||
Some(i) => out.set(ctx, opt, txn, i, x).await?,
|
Some(a) => {
|
||||||
|
let v = x.clone();
|
||||||
|
out.set(ctx, opt, txn, a, x).await?;
|
||||||
|
out.set(ctx, opt, txn, i, v).await?;
|
||||||
|
}
|
||||||
// This is the end of the expression
|
// This is the end of the expression
|
||||||
None => out.set(ctx, opt, txn, i, x).await?,
|
None => out.set(ctx, opt, txn, i, x).await?,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue