*/
else if (IsA(node, CopyStmt))
{
- if (((CopyStmt *)node)->is_from)
- {
- return POOL_PRIMARY;
- }
- else
+ if (((CopyStmt *)node)->is_from)
{
- return (IsA(((CopyStmt *)node)->query, SelectStmt))?POOL_EITHER:POOL_PRIMARY;
- }
-
+ return POOL_PRIMARY;
+ }
+ else
+ {
+ if (((CopyStmt *)node)->query) {
+ return (IsA(((CopyStmt *)node)->query, SelectStmt))?POOL_EITHER:POOL_PRIMARY;
+ } else {
+ return POOL_EITHER;
+ }
+ }
}
/*
else if (IsA(node, CopyStmt))
{
CopyStmt *copy_stmt = (CopyStmt *)node;
- return (copy_stmt->is_from == FALSE &&
- copy_stmt->filename == NULL);
+
+ if (copy_stmt->is_from)
+ {
+ return false;
+ }
+ else if (copy_stmt->filename == NULL )
+ {
+ if (copy_stmt->query == NULL)
+ {
+ return true;
+ }
+ else if (copy_stmt->query && IsA(copy_stmt->query, SelectStmt))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ } else {
+ return false;
+ }
}
else if (IsA(node, ExplainStmt))
{