mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
review suggestions
This commit is contained in:
parent
7da5e92754
commit
dbac7860b1
@ -422,6 +422,7 @@ void QueryFuzzer::fuzzMain(ASTPtr & ast)
|
||||
std::cout << std::endl;
|
||||
WriteBufferFromOStream ast_buf(std::cout, 4096);
|
||||
formatAST(*ast, ast_buf, false /*highlight*/);
|
||||
ast_buf.next();
|
||||
std::cout << std::endl << std::endl;
|
||||
}
|
||||
|
||||
|
@ -136,8 +136,9 @@ void MemoryTracker::alloc(Int64 size)
|
||||
const auto * description = description_ptr.load(std::memory_order_relaxed);
|
||||
amount.fetch_sub(size, std::memory_order_relaxed);
|
||||
throw DB::Exception(DB::ErrorCodes::MEMORY_LIMIT_EXCEEDED,
|
||||
"Memory tracker {}: fault injected. Would use {} (attempt to allocate chunk of {} bytes), maximum: {}",
|
||||
description ? description : "", formatReadableSizeWithBinarySuffix(will_be),
|
||||
"Memory tracker{}{}: fault injected. Would use {} (attempt to allocate chunk of {} bytes), maximum: {}",
|
||||
description ? " " : "", description ? description : "",
|
||||
formatReadableSizeWithBinarySuffix(will_be),
|
||||
size, formatReadableSizeWithBinarySuffix(current_hard_limit));
|
||||
}
|
||||
|
||||
@ -164,8 +165,9 @@ void MemoryTracker::alloc(Int64 size)
|
||||
const auto * description = description_ptr.load(std::memory_order_relaxed);
|
||||
amount.fetch_sub(size, std::memory_order_relaxed);
|
||||
throw DB::Exception(DB::ErrorCodes::MEMORY_LIMIT_EXCEEDED,
|
||||
"Memory limit {} exceeded: would use {} (attempt to allocate chunk of {} bytes), maximum: {}",
|
||||
description ? description : "", formatReadableSizeWithBinarySuffix(will_be),
|
||||
"Memory limit{}{} exceeded: would use {} (attempt to allocate chunk of {} bytes), maximum: {}",
|
||||
description ? " " : "", description ? description : "",
|
||||
formatReadableSizeWithBinarySuffix(will_be),
|
||||
size, formatReadableSizeWithBinarySuffix(current_hard_limit));
|
||||
}
|
||||
|
||||
|
@ -271,11 +271,6 @@ inline void writeString(const StringRef & ref, WriteBuffer & buf)
|
||||
writeString(ref.data, ref.size, buf);
|
||||
}
|
||||
|
||||
//inline void writeString(const std::string_view & view, WriteBuffer & buf)
|
||||
//{
|
||||
// writeString(view.data(), view.size(), buf);
|
||||
//}
|
||||
|
||||
|
||||
/** Writes a C-string without creating a temporary object. If the string is a literal, then `strlen` is executed at the compilation stage.
|
||||
* Use when the string is a literal.
|
||||
|
Loading…
Reference in New Issue
Block a user