Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid writing .tmp file when redirecting stdout to a file #5930

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

Mytherin
Copy link
Collaborator

This PR fixes a regression of #2296 found by @mskyttner where writing to stdout would fail if the result was redirected to a file, because the /dev/stdout pretends to be a file when it is redirected to a file (i.e. it sets st_mode in stat as if it is a file). For now we resolve this by checking directly if the output target is /dev/stdout as there does not seem to be a good way to resolve this using file system operations itself.

We also do some clean-up of the copy to file - as the is_file_and_exists property is not necessary anymore after binding it should not be propagated further into the plan.

@Mytherin Mytherin merged commit 5b5c625 into duckdb:master Jan 19, 2023
@Mytherin Mytherin deleted the usetmpfilestdout branch February 16, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant