From 53025b0ae894e4953871671d598c2a5f858de42d Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Tue, 22 Oct 2024 11:39:49 +0300 Subject: [PATCH] fix support 'COPY .. TO file'. Daniil Davidov & Dmitriy Koval --- online_analyze.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); } } -- 2.46.1