[fix](planner)ctas's query part is not analyzed correctly (#24111)

* [fix](planner)ctas's query part is not analyzed correctly
This commit is contained in:
starocean999
2023-09-09 20:55:09 +08:00
committed by GitHub
parent 8c2a721873
commit 21e30d4374
5 changed files with 119 additions and 0 deletions

View File

@ -108,4 +108,10 @@ public class CreateTableAsSelectStmt extends DdlStmt {
ErrorReport.reportAnalysisException(ErrorCode.ERR_COL_NUMBER_NOT_MATCH);
}
}
@Override
public void reset() {
super.reset();
queryStmt.reset();
}
}

View File

@ -785,6 +785,7 @@ public abstract class QueryStmt extends StatementBase implements Queriable {
sortInfo = (other.sortInfo != null) ? other.sortInfo.clone() : null;
analyzer = other.analyzer;
evaluateOrderBy = other.evaluateOrderBy;
disableTuplesMVRewriter = other.disableTuplesMVRewriter;
}
@Override

View File

@ -1164,6 +1164,10 @@ public class StmtExecutor {
if (parsedStmt instanceof InsertStmt) {
((InsertStmt) parsedStmt).getQueryStmt().resetSelectList();
}
if (parsedStmt instanceof CreateTableAsSelectStmt) {
((CreateTableAsSelectStmt) parsedStmt).getQueryStmt().resetSelectList();
}
}
// Because this is called by other thread