mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
update fmtlib version to 9.1.0
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
This commit is contained in:
parent
3f58fcb26b
commit
de5258128e
@ -32,7 +32,7 @@ constexpr void static_for(F && f)
|
||||
template <is_enum T>
|
||||
struct fmt::formatter<T> : fmt::formatter<std::string_view>
|
||||
{
|
||||
constexpr auto format(T value, auto& format_context)
|
||||
constexpr auto format(T value, auto& format_context) const
|
||||
{
|
||||
return formatter<string_view>::format(magic_enum::enum_name(value), format_context);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ struct fmt::formatter<wide::integer<Bits, Signed>>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const wide::integer<Bits, Signed> & value, FormatContext & ctx)
|
||||
auto format(const wide::integer<Bits, Signed> & value, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", to_string(value));
|
||||
}
|
||||
|
2
contrib/fmtlib
vendored
2
contrib/fmtlib
vendored
@ -1 +1 @@
|
||||
Subproject commit b6f4ceaed0a0a24ccf575fab6c56dd50ccf6f1a9
|
||||
Subproject commit a33701196adfad74917046096bf5a2aa0ab0bb50
|
@ -13,7 +13,6 @@ set (SRCS
|
||||
${FMT_SOURCE_DIR}/include/fmt/core.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/format.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/format-inl.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/locale.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/os.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/ostream.h
|
||||
${FMT_SOURCE_DIR}/include/fmt/printf.h
|
||||
|
@ -406,7 +406,7 @@ struct fmt::formatter<DB::Identifier>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::Identifier & identifier, FormatContext & ctx)
|
||||
auto format(const DB::Identifier & identifier, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", identifier.getFullName());
|
||||
}
|
||||
@ -428,7 +428,7 @@ struct fmt::formatter<DB::IdentifierView>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::IdentifierView & identifier_view, FormatContext & ctx)
|
||||
auto format(const DB::IdentifierView & identifier_view, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", identifier_view.getFullName());
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ struct fmt::formatter<DB::TestHint::ErrorVector>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::TestHint::ErrorVector & ErrorVector, FormatContext & ctx)
|
||||
auto format(const DB::TestHint::ErrorVector & ErrorVector, FormatContext & ctx) const
|
||||
{
|
||||
if (ErrorVector.empty())
|
||||
return fmt::format_to(ctx.out(), "{}", 0);
|
||||
|
@ -108,7 +108,7 @@ struct fmt::formatter<DB::TransactionID>
|
||||
}
|
||||
|
||||
template<typename FormatContext>
|
||||
auto format(const DB::TransactionID & tid, FormatContext & context)
|
||||
auto format(const DB::TransactionID & tid, FormatContext & context) const
|
||||
{
|
||||
return fmt::format_to(context.out(), "({}, {}, {})", tid.start_csn, tid.local_tid, tid.host_id);
|
||||
}
|
||||
|
@ -647,7 +647,7 @@ public:
|
||||
|
||||
template <> struct fmt::formatter<Coordination::Error> : fmt::formatter<std::string_view>
|
||||
{
|
||||
constexpr auto format(Coordination::Error code, auto & ctx)
|
||||
constexpr auto format(Coordination::Error code, auto & ctx) const
|
||||
{
|
||||
return formatter<string_view>::format(Coordination::errorMessage(code), ctx);
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "filesystemHelpers.h"
|
||||
#include <bits/types/struct_timeval.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
# include <mntent.h>
|
||||
@ -11,7 +13,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <utime.h>
|
||||
#include <sys/time.h>
|
||||
#include <IO/ReadBufferFromFile.h>
|
||||
#include <IO/Operators.h>
|
||||
#include <IO/WriteBufferFromString.h>
|
||||
@ -369,10 +371,11 @@ Poco::Timestamp getModificationTimestamp(const std::string & path)
|
||||
|
||||
void setModificationTime(const std::string & path, time_t time)
|
||||
{
|
||||
struct utimbuf tb;
|
||||
tb.actime = time;
|
||||
tb.modtime = time;
|
||||
if (utime(path.c_str(), &tb) != 0)
|
||||
struct timeval times[2];
|
||||
times[0].tv_usec = times[1].tv_usec = 0;
|
||||
times[0].tv_sec = ::time(nullptr);
|
||||
times[1].tv_sec = time;
|
||||
if (utimes(path.c_str(), times) != 0)
|
||||
DB::ErrnoException::throwFromPath(DB::ErrorCodes::PATH_ACCESS_DENIED, path, "Cannot set modification time to file: {}", path);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ struct fmt::formatter<ReadableSize>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const ReadableSize & size, FormatContext & ctx)
|
||||
auto format(const ReadableSize & size, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", formatReadableSizeWithBinarySuffix(size.value));
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ void KeeperStorageSnapshot::deserialize(SnapshotDeserializationResult & deserial
|
||||
#ifdef NDEBUG
|
||||
/// TODO (alesapin) remove this, it should be always CORRUPTED_DATA.
|
||||
LOG_ERROR(getLogger("KeeperSnapshotManager"), "Children counter in stat.numChildren {}"
|
||||
" is different from actual children size {} for node {}", itr.value.numChildren(), itr.value.getChildren().size(), itr.key);
|
||||
" is different from actual children size {} for node {}", itr.value.numChildren(), itr.value.getChildren().size(), itr.key.toView());
|
||||
#else
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Children counter in stat.numChildren {}"
|
||||
" is different from actual children size {} for node {}",
|
||||
|
@ -57,7 +57,7 @@ using ClusterUpdateActions = std::vector<ClusterUpdateAction>;
|
||||
template <>
|
||||
struct fmt::formatter<DB::RaftServerConfig> : fmt::formatter<string_view>
|
||||
{
|
||||
constexpr auto format(const DB::RaftServerConfig & server, format_context & ctx)
|
||||
constexpr auto format(const DB::RaftServerConfig & server, format_context & ctx) const
|
||||
{
|
||||
return fmt::format_to(
|
||||
ctx.out(), "server.{}={};{};{}", server.id, server.endpoint, server.learner ? "learner" : "participant", server.priority);
|
||||
@ -67,7 +67,7 @@ struct fmt::formatter<DB::RaftServerConfig> : fmt::formatter<string_view>
|
||||
template <>
|
||||
struct fmt::formatter<DB::ClusterUpdateAction> : fmt::formatter<string_view>
|
||||
{
|
||||
constexpr auto format(const DB::ClusterUpdateAction & action, format_context & ctx)
|
||||
constexpr auto format(const DB::ClusterUpdateAction & action, format_context & ctx) const
|
||||
{
|
||||
if (const auto * add = std::get_if<DB::AddRaftServer>(&action))
|
||||
return fmt::format_to(ctx.out(), "(Add server {})", add->id);
|
||||
|
@ -1038,7 +1038,7 @@ struct fmt::formatter<DB::Field>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::Field & x, FormatContext & ctx)
|
||||
auto format(const DB::Field & x, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", toString(x));
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ namespace fmt
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::QualifiedTableName & name, FormatContext & ctx)
|
||||
auto format(const DB::QualifiedTableName & name, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}.{}", DB::backQuoteIfNeed(name.database), DB::backQuoteIfNeed(name.table));
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ struct fmt::formatter<DB::DataTypePtr>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::DataTypePtr & type, FormatContext & ctx)
|
||||
auto format(const DB::DataTypePtr & type, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", type->getName());
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ struct ByteJaccardIndexImpl
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal UTF-8 sequence, while processing '{}'", StringRef(haystack, haystack_end - haystack));
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal UTF-8 sequence, while processing '{}'", std::string_view(haystack, haystack_end - haystack));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,7 +186,7 @@ struct ByteJaccardIndexImpl
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal UTF-8 sequence, while processing '{}'", StringRef(needle, needle_end - needle));
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Illegal UTF-8 sequence, while processing '{}'", std::string_view(needle, needle_end - needle));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1420,7 +1420,7 @@ struct fmt::formatter<DB::UUID>
|
||||
}
|
||||
|
||||
template<typename FormatContext>
|
||||
auto format(const DB::UUID & uuid, FormatContext & context)
|
||||
auto format(const DB::UUID & uuid, FormatContext & context) const
|
||||
{
|
||||
return fmt::format_to(context.out(), "{}", toString(uuid));
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ namespace fmt
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::StorageID & storage_id, FormatContext & ctx)
|
||||
auto format(const DB::StorageID & storage_id, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", storage_id.getNameForLogs());
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ struct fmt::formatter<DB::ASTPtr>
|
||||
}
|
||||
|
||||
template<typename FormatContext>
|
||||
auto format(const DB::ASTPtr & ast, FormatContext & context)
|
||||
auto format(const DB::ASTPtr & ast, FormatContext & context) const
|
||||
{
|
||||
return fmt::format_to(context.out(), "{}", DB::serializeAST(*ast));
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ void BSONEachRowRowInputFormat::readTuple(IColumn & column, const DataTypePtr &
|
||||
"Cannot parse tuple column with type {} from BSON array/embedded document field: "
|
||||
"tuple doesn't have element with name \"{}\"",
|
||||
data_type->getName(),
|
||||
name);
|
||||
name.toView());
|
||||
index = *try_get_index;
|
||||
}
|
||||
|
||||
@ -806,7 +806,7 @@ bool BSONEachRowRowInputFormat::readRow(MutableColumns & columns, RowReadExtensi
|
||||
else
|
||||
{
|
||||
if (seen_columns[index])
|
||||
throw Exception(ErrorCodes::INCORRECT_DATA, "Duplicate field found while parsing BSONEachRow format: {}", name);
|
||||
throw Exception(ErrorCodes::INCORRECT_DATA, "Duplicate field found while parsing BSONEachRow format: {}", name.toView());
|
||||
|
||||
seen_columns[index] = true;
|
||||
read_columns[index] = readField(*columns[index], types[index], BSONType(type));
|
||||
|
@ -37,7 +37,7 @@ struct fmt::formatter<DB::RowNumber>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::RowNumber & x, FormatContext & ctx)
|
||||
auto format(const DB::RowNumber & x, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}:{}", x.block, x.row);
|
||||
}
|
||||
|
@ -1,7 +1,4 @@
|
||||
// Needs to go first because its partial specialization of fmt::formatter
|
||||
// should be defined before any instantiation
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
#include <fmt/ranges.h>
|
||||
#include <Storages/Kafka/KafkaConsumer.h>
|
||||
#include <IO/ReadBufferFromMemory.h>
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cppkafka/topic_partition.h>
|
||||
#include <fmt/ostream.h>
|
||||
#include <boost/circular_buffer.hpp>
|
||||
|
||||
#include <Core/Names.h>
|
||||
@ -197,3 +199,6 @@ private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <> struct fmt::formatter<cppkafka::TopicPartition> : fmt::ostream_formatter {};
|
||||
template <> struct fmt::formatter<cppkafka::Error> : fmt::ostream_formatter {};
|
||||
|
@ -69,7 +69,7 @@ struct fmt::formatter<DB::MarkRange>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::MarkRange & range, FormatContext & ctx)
|
||||
auto format(const DB::MarkRange & range, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", fmt::format("({}, {})", range.begin, range.end));
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ struct fmt::formatter<DB::Part>
|
||||
static constexpr auto parse(format_parse_context & ctx) { return ctx.begin(); }
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::Part & part, FormatContext & ctx)
|
||||
auto format(const DB::Part & part, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{} in replicas [{}]", part.description.describe(), fmt::join(part.replicas, ", "));
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ struct fmt::formatter<DB::RangesInDataPartDescription>
|
||||
static constexpr auto parse(format_parse_context & ctx) { return ctx.begin(); }
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::RangesInDataPartDescription & range, FormatContext & ctx)
|
||||
auto format(const DB::RangesInDataPartDescription & range, FormatContext & ctx) const
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", range.describe());
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ struct fmt::formatter<DB::NamedCollectionValidateKey<T>>
|
||||
}
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::NamedCollectionValidateKey<T> & elem, FormatContext & context)
|
||||
auto format(const DB::NamedCollectionValidateKey<T> & elem, FormatContext & context) const
|
||||
{
|
||||
return fmt::format_to(context.out(), "{}", elem.value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user