mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #36632 from DevTeamBK/Fix-Coverity-Issues
Minor Coverity defects fixes
This commit is contained in:
commit
66f62b2ba6
@ -570,6 +570,9 @@ void LRUFileCache::remove(bool force_remove_unreleasable)
|
||||
auto & [key, offset] = *it++;
|
||||
|
||||
auto * cell = getCell(key, offset, cache_lock);
|
||||
if (!cell)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cache is in inconsistent state: LRU queue contains entries with no cache cell");
|
||||
|
||||
if (cell->releasable() || force_remove_unreleasable)
|
||||
{
|
||||
auto file_segment = cell->file_segment;
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
const std::string & common_path_prefix_,
|
||||
const BlobsPathToSize & blobs_to_read_,
|
||||
const ReadSettings & settings_);
|
||||
|
||||
String getFileName() const;
|
||||
|
||||
void reset();
|
||||
@ -63,8 +62,6 @@ protected:
|
||||
|
||||
ReadSettings settings;
|
||||
|
||||
bool use_external_buffer;
|
||||
|
||||
size_t read_until_position = 0;
|
||||
|
||||
String current_path;
|
||||
|
@ -4108,6 +4108,9 @@ String MergeTreeData::getPartitionIDFromQuery(const ASTPtr & ast, ContextPtr loc
|
||||
assert(typeid_cast<ASTFunction *>(partition_ast.value.get()));
|
||||
assert(partition_ast.value->as<ASTFunction>()->name == "tuple");
|
||||
assert(partition_ast.value->as<ASTFunction>()->arguments);
|
||||
auto args = partition_ast.value->as<ASTFunction>()->arguments;
|
||||
if (!args)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Expected at least one argument in partition AST");
|
||||
bool empty_tuple = partition_ast.value->as<ASTFunction>()->arguments->children.empty();
|
||||
if (!empty_tuple)
|
||||
throw Exception(ErrorCodes::INVALID_PARTITION_VALUE, "Partition key is empty, expected 'tuple()' as partition key");
|
||||
|
@ -471,6 +471,7 @@ void ReplicatedMergeTreeCleanupThread::clearOldMutations()
|
||||
for (const String & replica : replicas)
|
||||
{
|
||||
String pointer;
|
||||
// No Need to check return value to delete mutations.
|
||||
zookeeper->tryGet(storage.zookeeper_path + "/replicas/" + replica + "/mutation_pointer", pointer);
|
||||
if (pointer.empty())
|
||||
return; /// One replica hasn't done anything yet so we can't delete any mutations.
|
||||
|
Loading…
Reference in New Issue
Block a user