[fix](planner) fix bug of select stmt toSql(#37274) (#37344)

cherry-pick from master #37274
This commit is contained in:
feiniaofeiafei
2024-07-09 20:34:57 +08:00
committed by GitHub
parent 9b075bc873
commit 8ef83259ff
3 changed files with 10 additions and 6 deletions

View File

@ -564,6 +564,7 @@ public class SelectStmt extends QueryStmt {
// remove excepted columns
resultExprs.removeIf(expr -> exceptCols.contains(expr.toColumnLabel()));
colLabels.removeIf(exceptCols::contains);
originalExpr = new ArrayList<>(resultExprs);
} else {
if (needToSql) {
originalExpr = new ArrayList<>();