mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix error with ALTER CONSTRAINT formatting; added a test
This commit is contained in:
parent
e9eb722d4a
commit
e2607f005c
@ -146,7 +146,7 @@ void ASTAlterCommand::formatImpl(
|
|||||||
}
|
}
|
||||||
else if (type == ASTAlterCommand::ADD_CONSTRAINT)
|
else if (type == ASTAlterCommand::ADD_CONSTRAINT)
|
||||||
{
|
{
|
||||||
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "ADD CONSTRAINT" << (if_not_exists ? "IF NOT EXISTS " : "") << (settings.hilite ? hilite_none : "");
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << indent_str << "ADD CONSTRAINT " << (if_not_exists ? "IF NOT EXISTS " : "") << (settings.hilite ? hilite_none : "");
|
||||||
constraint_decl->formatImpl(settings, state, frame);
|
constraint_decl->formatImpl(settings, state, frame);
|
||||||
}
|
}
|
||||||
else if (type == ASTAlterCommand::DROP_CONSTRAINT)
|
else if (type == ASTAlterCommand::DROP_CONSTRAINT)
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE replicated_constraints1 ADD CONSTRAINT IF NOT EXISTS b_constraint CHECK b > 10
|
8
tests/queries/0_stateless/01318_alter_add_constraint_format.sh
Executable file
8
tests/queries/0_stateless/01318_alter_add_constraint_format.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
. $CURDIR/../shell_config.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
$CLICKHOUSE_FORMAT --oneline <<<"ALTER TABLE replicated_constraints1 ADD CONSTRAINT IF NOT EXISTS b_constraint CHECK b > 10"
|
Loading…
Reference in New Issue
Block a user