ClickHouse/tests/queries/0_stateless/02158_explain_ast_alter_commands.reference
Azat Khuzhin 48a700edba Support query parameters in ALTER TABLE ... PART
But, to make this happen it is not enough to simply fix the parser, the
whole ASTs for ALTER should be fixed as well, since they store `ASTPtr`
instead of `IAST *`, and so because of `ReplaceQueryParameterVisitor`
does not work for ALTER query.

So this patch converts ASTPtr to `IAST *` for ASTAlterQuery and
ASTAlterCommand (plus it also fixes when the children for
ASTAlterCommand had not been updated sometimes).

And only after this it is possible to adjust the parser (see
places with `parser_string_and_substituion` in the parser code).

v2: also fix ASTAlterCommand::clone (add missing components) and ParserAlterCommand::parseImpl
v3: fix APPLY DELETED MASK
v4: fix mutations_execute_nondeterministic_on_initiator/mutations_execute_subqueries_on_initiator
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-01-15 14:16:54 +03:00

42 lines
1.6 KiB
Plaintext

AlterCommand ADD_COLUMN (children 1)
AlterCommand DROP_COLUMN (children 1)
AlterCommand MODIFY_COLUMN (children 1)
AlterCommand COMMENT_COLUMN (children 2)
AlterCommand RENAME_COLUMN (children 2)
AlterCommand MATERIALIZE_COLUMN (children 1)
AlterCommand MODIFY_ORDER_BY (children 1)
AlterCommand MODIFY_SAMPLE_BY (children 1)
AlterCommand MODIFY_TTL (children 1)
AlterCommand MATERIALIZE_TTL (children 1)
AlterCommand MODIFY_SETTING (children 1)
AlterCommand RESET_SETTING (children 1)
AlterCommand MODIFY_QUERY (children 1)
AlterCommand REMOVE_TTL
AlterCommand REMOVE_SAMPLE_BY
AlterCommand ADD_INDEX (children 1)
AlterCommand DROP_INDEX (children 1)
AlterCommand MATERIALIZE_INDEX (children 1)
AlterCommand ADD_CONSTRAINT (children 1)
AlterCommand DROP_CONSTRAINT (children 1)
AlterCommand ADD_PROJECTION (children 1)
AlterCommand DROP_PROJECTION (children 1)
AlterCommand MATERIALIZE_PROJECTION (children 1)
AlterCommand DROP_PARTITION (children 1)
AlterCommand DROP_PARTITION (children 1)
AlterCommand ATTACH_PARTITION (children 1)
AlterCommand ATTACH_PARTITION (children 1)
AlterCommand REPLACE_PARTITION (children 1)
AlterCommand REPLACE_PARTITION (children 1)
AlterCommand MOVE_PARTITION (children 1)
AlterCommand DROP_COLUMN (children 2)
AlterCommand FREEZE_ALL
AlterCommand FREEZE_PARTITION (children 1)
AlterCommand UNFREEZE_ALL
AlterCommand UNFREEZE_PARTITION (children 1)
AlterCommand FETCH_PARTITION (children 1)
AlterCommand FETCH_PARTITION (children 1)
AlterCommand UPDATE (children 2)
AlterCommand UPDATE (children 3)
AlterCommand DELETE (children 1)
AlterCommand DELETE (children 2)