未验证 提交 f104c382 编写于 作者: A alesapin 提交者: GitHub

Merge pull request #14887 from azat/StorageFile-write-to-fd

Fix SIGSEGV for an attempt to INSERT into StorageFile(fd)
......@@ -502,8 +502,12 @@ BlockOutputStreamPtr StorageFile::write(
if (format_name == "Distributed")
throw Exception("Method write is not implemented for Distributed format", ErrorCodes::NOT_IMPLEMENTED);
std::string path;
if (!paths.empty())
path = paths[0];
return std::make_shared<StorageFileBlockOutputStream>(*this, metadata_snapshot,
chooseCompressionMethod(paths[0], compression_method), context);
chooseCompressionMethod(path, compression_method), context);
}
Strings StorageFile::getDataPaths() const
......
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh
# The following command will execute:
# CREATE TABLE table (key UInt32) ENGINE = File(TSV, stdin);
# INSERT INTO `table` SELECT key FROM input('key UInt32') FORMAT TSV
${CLICKHOUSE_LOCAL} -S 'key UInt32' -q "INSERT INTO \`table\` SELECT key FROM input('key UInt32') FORMAT TSV" < /dev/null
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册