Use more suitable method hasRealColumn. [#CLICKHOUSE-2896]

This commit is contained in:
Vitaliy Lyudvichenko 2017-07-15 00:51:52 +03:00 committed by alexey-milovidov
parent 9ce4ff4c5b
commit c6eb11aad5

View File

@ -240,7 +240,7 @@ void InterpreterAlterQuery::PartitionCommands::validate(const IStorage * table)
{
String column_name = command.column_name.safeGet<String>();
if (table->getColumnsList().filter(Names{column_name}).empty())
if (!table->hasRealColumn(column_name))
{
throw Exception("Wrong column name. Cannot find column " + column_name + " to clear it from partition",
DB::ErrorCodes::ILLEGAL_COLUMN);