mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #44447 from ClickHouse/42637_Disallow_arrayJoin_in_mutations
Disallow arrayjoin in mutations
This commit is contained in:
commit
f629425f96
@ -43,6 +43,7 @@ namespace ErrorCodes
|
||||
extern const int UNKNOWN_MUTATION_COMMAND;
|
||||
extern const int NO_SUCH_COLUMN_IN_TABLE;
|
||||
extern const int CANNOT_UPDATE_COLUMN;
|
||||
extern const int UNEXPECTED_EXPRESSION;
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -946,6 +947,8 @@ QueryPipelineBuilder MutationsInterpreter::addStreamsForLaterStages(const std::v
|
||||
for (size_t i = 0; i < stage.expressions_chain.steps.size(); ++i)
|
||||
{
|
||||
const auto & step = stage.expressions_chain.steps[i];
|
||||
if (step->actions()->hasArrayJoin())
|
||||
throw Exception("arrayJoin is not allowed in mutations", ErrorCodes::UNEXPECTED_EXPRESSION);
|
||||
if (i < stage.filter_column_names.size())
|
||||
{
|
||||
/// Execute DELETEs.
|
||||
|
@ -0,0 +1,3 @@
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
@ -0,0 +1,9 @@
|
||||
DROP TABLE IF EXISTS test_02504;
|
||||
|
||||
CREATE TABLE test_02504 (`a` UInt32,`b` UInt32) ENGINE = MergeTree ORDER BY a;
|
||||
INSERT INTO test_02504 values (1, 1) (2, 2), (3, 3);
|
||||
SELECT * FROM test_02504;
|
||||
|
||||
ALTER TABLE test_02504 UPDATE b = 33 WHERE arrayJoin([1, 2]) = a; -- { serverError UNEXPECTED_EXPRESSION}
|
||||
|
||||
DROP TABLE test_02504;
|
Loading…
Reference in New Issue
Block a user