Merge pull request #64532 from azat/file-use-max_read_buffer_size

Use max_read_buffer_size for file descriptors as well in file()
This commit is contained in:
Alexey Milovidov 2024-06-02 20:13:18 +02:00 committed by GitHub
commit f6125d2d9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -274,7 +274,7 @@ std::unique_ptr<ReadBuffer> selectReadBuffer(
if (S_ISREG(file_stat.st_mode) && (read_method == LocalFSReadMethod::pread || read_method == LocalFSReadMethod::mmap))
{
if (use_table_fd)
res = std::make_unique<ReadBufferFromFileDescriptorPRead>(table_fd);
res = std::make_unique<ReadBufferFromFileDescriptorPRead>(table_fd, context->getSettingsRef().max_read_buffer_size);
else
res = std::make_unique<ReadBufferFromFilePRead>(current_path, context->getSettingsRef().max_read_buffer_size);
@ -296,7 +296,7 @@ std::unique_ptr<ReadBuffer> selectReadBuffer(
else
{
if (use_table_fd)
res = std::make_unique<ReadBufferFromFileDescriptor>(table_fd);
res = std::make_unique<ReadBufferFromFileDescriptor>(table_fd, context->getSettingsRef().max_read_buffer_size);
else
res = std::make_unique<ReadBufferFromFile>(current_path, context->getSettingsRef().max_read_buffer_size);