Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some pvs reported issues #6837

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dbms/src/Interpreters/ClusterProxy/executeQuery.cpp
Expand Up @@ -30,7 +30,7 @@ Context removeUserRestrictionsFromSettings(const Context & context, const Settin
/// Set as unchanged to avoid sending to remote server.
new_settings.max_concurrent_queries_for_user.changed = false;
new_settings.max_memory_usage_for_user.changed = false;
new_settings.max_memory_usage_for_all_queries = false;
new_settings.max_memory_usage_for_all_queries.changed = false;

Context new_context(context);
new_context.setSettings(new_settings);
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Interpreters/Context.cpp
Expand Up @@ -1222,8 +1222,8 @@ void Context::setCurrentQueryId(const String & query_id)
} words;
} random;

random.words.a = thread_local_rng();
random.words.b = thread_local_rng();
random.words.a = thread_local_rng(); //-V656
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any description?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppresstion. It's required by PVS-Studio to be in exactly this format.
The only way is to write an additional describing comment in a line above, but it's too cumbersome to do it for every suppression.

random.words.b = thread_local_rng(); //-V656

/// Use protected constructor.
struct qUUID : Poco::UUID
Expand Down
7 changes: 3 additions & 4 deletions dbms/src/Interpreters/InterpreterSelectQuery.cpp
Expand Up @@ -413,8 +413,6 @@ QueryPipeline InterpreterSelectQuery::executeWithProcessors()

Block InterpreterSelectQuery::getSampleBlockImpl()
{
FilterInfoPtr filter_info;

/// Need to create sets before analyzeExpressions(). Otherwise some sets for index won't be created.
query_analyzer->makeSetsForIndex(getSelectQuery().where());
query_analyzer->makeSetsForIndex(getSelectQuery().prewhere());
Expand All @@ -426,8 +424,9 @@ Block InterpreterSelectQuery::getSampleBlockImpl()
options.to_stage,
context,
storage,
true,
filter_info);
true, // only_types
{} // filter_info
);

if (options.to_stage == QueryProcessingStage::Enum::FetchColumns)
{
Expand Down