- if (parsetree && IsA(parsetree, CreateTableAsStmt) &&
- ((CreateTableAsStmt*)parsetree)->into &&
- online_analyze_enable)
- tblname = (RangeVar*)copyObject(((CreateTableAsStmt*)parsetree)->into->rel);
+ if (parsetree && online_analyze_enable)
+ {
+ if (IsA(parsetree, CreateTableAsStmt) &&
+ ((CreateTableAsStmt*)parsetree)->into)
+ {
+ tblnames =
+ list_make1((RangeVar*)copyObject(((CreateTableAsStmt*)parsetree)->into->rel));
+ op = CK_CREATE;
+ }
+ else if (IsA(parsetree, TruncateStmt))
+ {
+ tblnames = list_copy(((TruncateStmt*)parsetree)->relations);
+ op = CK_TRUNCATE;
+ }
+ }