提交 2487442c authored 作者: Thomas Mueller's avatar Thomas Mueller

Subqueries or views with "order by" an alias expression could not be executed

上级 bd762ce8
......@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Issue 73: MySQL compatibility: support REPLACE, patch by Cemo Koc.
<ul><li>Subqueries or views with "order by" an alias expression could not be executed
due to a regression introduced in version 1.3.174.
</li><li>Issue 73: MySQL compatibility: support REPLACE, patch by Cemo Koc.
</li><li>MVStore: concurrency problems have been fixed.
</li><li>Improve error message when dropping an index that belongs to a constraint,
specify constraint in error message.
......
......@@ -429,7 +429,8 @@ public abstract class Query extends Prepared {
expressionSQL.add(sql);
}
o.columnIndexExpr = ValueExpression.get(ValueInt.get(idx + 1));
o.expression = expressions.get(idx);
Expression expr = expressions.get(idx).getNonAliasExpression();
o.expression = expr;
}
}
......
select * from (select x as y from dual order by y);
> 1;
select a.x from dual a, dual b order by x;
> 1;
select trunc(1.3);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论