From: Teodor Sigaev Date: Tue, 22 Oct 2024 08:39:49 +0000 (+0300) Subject: fix support 'COPY .. TO file'. Daniil Davidov & Dmitriy Koval X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=53025b0ae894e4953871671d598c2a5f858de42d;p=online_analyze.git fix support 'COPY .. TO file'. Daniil Davidov & Dmitriy Koval --- diff --git a/online_analyze.c b/online_analyze.c index b9aae90..0479dbf 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -1051,8 +1051,13 @@ onlineAnalyzeHookerUtility( } else if (IsA(parsetree, CopyStmt)) { CopyStmt *cpystmt = (CopyStmt*) parsetree; - tblnames = list_make1((RangeVar*)copyObject(cpystmt->relation)); - op = CK_CREATE; + /* Create tblnames only if it is not "COPY (query) TO file" command */ + if (cpystmt->relation) { + tblnames = list_make1((RangeVar*)copyObject(cpystmt->relation)); + op = CK_CREATE; + } + else + Assert(cpystmt->query); } }