Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/backend/commands/copyto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,10 @@ CopyToDispatchDirectoryTable(CopyToState cstate)

pfree(cdbCopy);

return 1;
if (processed)
return 1;
else
return 0;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/test/regress/input/directory_table.source
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ COPY BINARY dir_table2 TO '@abs_srcdir@/data/dir_table2'; -- fail
COPY BINARY dir_table1 TO '@abs_srcdir@/data/dir_table1'; -- fail
\COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'nation2' TO stdin; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'nation2' TO stdin; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'nation2' TO stdout; -- OK
Expand Down
2 changes: 2 additions & 0 deletions src/test/regress/output/directory_table.source
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,8 @@ COPY BINARY dir_table1 TO '@abs_srcdir@/data/dir_table1'; -- fail
ERROR: COPY to directory table must specify the relative_path name.
\COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'nation2' TO stdin; -- OK
0|ALGERIA|0| haggle. carefully final deposits detect slyly agai
1|ARGENTINA|1|al foxes promise slyly according to the regular accounts. bold requests alon
Expand Down
2 changes: 2 additions & 0 deletions src/test/regress/output/directory_table_optimizer.source
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,8 @@ COPY BINARY dir_table1 TO '@abs_srcdir@/data/dir_table1'; -- fail
ERROR: COPY to directory table must specify the relative_path name.
\COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'nation1' TO '@abs_srcdir@/data/nation1'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
COPY BINARY DIRECTORY TABLE dir_table1 'unknown' TO '@abs_srcdir@/data/unknown'; -- OK
\COPY BINARY DIRECTORY TABLE dir_table1 'nation2' TO stdin; -- OK
0|ALGERIA|0| haggle. carefully final deposits detect slyly agai
1|ARGENTINA|1|al foxes promise slyly according to the regular accounts. bold requests alon
Expand Down