[fix](sort)order by constant expr bug (#13613)
Issue Number: close (#13350)
This commit is contained in:
@ -1406,7 +1406,15 @@ public class SelectStmt extends QueryStmt {
|
||||
}
|
||||
if (orderByElements != null) {
|
||||
for (OrderByElement orderByElem : orderByElements) {
|
||||
// we must make sure the expr is analyzed before rewrite
|
||||
try {
|
||||
orderByElem.getExpr().analyze(analyzer);
|
||||
} catch (AnalysisException ex) {
|
||||
//ignore any exception
|
||||
}
|
||||
orderByElem.setExpr(rewriter.rewrite(orderByElem.getExpr(), analyzer));
|
||||
// after rewrite, need reset the analyze status for later re-analyze
|
||||
orderByElem.getExpr().reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user