Merge pull request #56867 from kitaisreal/planner-support-transactions

Planner support transactions
This commit is contained in:
Nikolai Kochetov 2023-11-20 17:10:22 +01:00 committed by GitHub
commit 2a59a688de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -116,7 +116,7 @@ namespace
void checkStoragesSupportTransactions(const PlannerContextPtr & planner_context)
{
const auto & query_context = planner_context->getQueryContext();
if (query_context->getSettingsRef().throw_on_unsupported_query_inside_transaction)
if (!query_context->getSettingsRef().throw_on_unsupported_query_inside_transaction)
return;
if (!query_context->getCurrentTransaction())
@ -130,13 +130,11 @@ void checkStoragesSupportTransactions(const PlannerContextPtr & planner_context)
else if (auto * table_function_node = table_expression->as<TableFunctionNode>())
storage = table_function_node->getStorage();
if (storage->supportsTransactions())
continue;
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
"Storage {} (table {}) does not support transactions",
storage->getName(),
storage->getStorageID().getNameForLogs());
if (storage && !storage->supportsTransactions())
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
"Storage {} (table {}) does not support transactions",
storage->getName(),
storage->getStorageID().getNameForLogs());
}
}
@ -1334,9 +1332,9 @@ void Planner::buildPlanForQueryNode()
query_node.getHaving() = {};
}
checkStoragesSupportTransactions(planner_context);
collectSets(query_tree, *planner_context);
collectTableExpressionData(query_tree, planner_context);
checkStoragesSupportTransactions(planner_context);
if (!select_query_options.only_analyze)
collectFiltersForAnalysis(query_tree, planner_context);

View File

@ -5,7 +5,6 @@
01064_incremental_streaming_from_2_src_with_feedback
01083_expressions_in_engine_arguments
01155_rename_move_materialized_view
01173_transaction_control_queries
01214_test_storage_merge_aliases_with_where
01244_optimize_distributed_group_by_sharding_key
01268_mv_scalars
@ -26,7 +25,6 @@
02139_MV_with_scalar_subquery
02174_cte_scalar_cache_mv
02302_s3_file_pruning
02345_implicit_transaction
02352_grouby_shadows_arg
02354_annoy
02428_parameterized_view