diff --git a/base/common/logger_useful.h b/base/common/logger_useful.h index f760d59de453a589e76bedd322543bef0aeaabe7..d3b4d38d54694da183c4fa109991b16911117a52 100644 --- a/base/common/logger_useful.h +++ b/base/common/logger_useful.h @@ -3,7 +3,6 @@ /// Macros for convenient usage of Poco logger. #include -#include #include #include #include diff --git a/src/Interpreters/InterpreterCreateQuery.cpp b/src/Interpreters/InterpreterCreateQuery.cpp index 88066b8f1585591900ea9d9befdaf1125a073877..d1c989c5347545f7ef852c28126700db8a2c6530 100644 --- a/src/Interpreters/InterpreterCreateQuery.cpp +++ b/src/Interpreters/InterpreterCreateQuery.cpp @@ -115,7 +115,7 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create) auto ast = DatabaseOnDisk::parseQueryFromMetadata(nullptr, context, metadata_file_path); create = ast->as(); if (!create.table.empty() || !create.storage) - throw Exception(ErrorCodes::INCORRECT_QUERY, "Metadata file {} contains incorrect CREATE DATABASE query", metadata_file_path); + throw Exception(ErrorCodes::INCORRECT_QUERY, "Metadata file {} contains incorrect CREATE DATABASE query", metadata_file_path.string()); create.attach = true; create.attach_short_syntax = true; create.database = database_name; @@ -149,7 +149,7 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create) metadata_path = metadata_path / "store" / DatabaseCatalog::getPathForUUID(create.uuid); if (!create.attach && fs::exists(metadata_path)) - throw Exception(ErrorCodes::DATABASE_ALREADY_EXISTS, "Metadata directory {} already exists", metadata_path); + throw Exception(ErrorCodes::DATABASE_ALREADY_EXISTS, "Metadata directory {} already exists", metadata_path.string()); } else { diff --git a/src/Parsers/formatAST.h b/src/Parsers/formatAST.h index 15381b62028b2a4bd14206ec8c04207270f54d7a..28af2400a4c2a9af32402a8059837eb2fe1ebc45 100644 --- a/src/Parsers/formatAST.h +++ b/src/Parsers/formatAST.h @@ -1,6 +1,5 @@ #pragma once -#include #include @@ -29,3 +28,20 @@ inline WriteBuffer & operator<<(WriteBuffer & buf, const ASTPtr & ast) } } + +template<> +struct fmt::formatter +{ + template + constexpr auto parse(ParseContext & context) + { + return context.begin(); + } + + template + auto format(const DB::ASTPtr & ast, FormatContext & context) + { + return fmt::format_to(context.out(), "{}", DB::serializeAST(*ast)); + } +}; + diff --git a/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp b/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp index 4114ab05975159368d681deff71030732109c7cc..b3ca1579bd138fbb0a3cf1b99670cef42d21092e 100644 --- a/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp +++ b/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp @@ -4,6 +4,7 @@ #include #include +#include #include namespace DB diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index c6a5694843e028d681847a75e920e4fb6a3bce3a..09667484deaa5adaa4c79d9c06cf9254790fc24b 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -695,7 +695,7 @@ void StorageDistributed::createDirectoryMonitors(const std::string & disk) if (std::filesystem::is_empty(dir_path)) { - LOG_DEBUG(log, "Removing {} (used for async INSERT into Distributed)", dir_path); + LOG_DEBUG(log, "Removing {} (used for async INSERT into Distributed)", dir_path.string()); /// Will be created by DistributedBlockOutputStream on demand. std::filesystem::remove(dir_path); }