mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
dbms: fixed error messages
This commit is contained in:
parent
60f69f8be0
commit
a97a959b6c
@ -78,7 +78,7 @@ void InterpreterAlterQuery::execute()
|
||||
|
||||
/// Проверяем, что колонка еще не существует
|
||||
if (std::find_if(columns_copy.begin(), columns_copy.end(), boost::bind(namesEqual, name_type.name, _1)) != columns_copy.end())
|
||||
throw Exception("Wrong column name. Column " << name_type.name << " already exists", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
throw Exception("Wrong column name. Column " + name_type.name + " already exists", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
|
||||
/// Проверяем опциональный аргумент AFTER
|
||||
ASTs::iterator insert_it = columns_copy.end();
|
||||
@ -87,7 +87,7 @@ void InterpreterAlterQuery::execute()
|
||||
const ASTIdentifier & col_after = dynamic_cast<const ASTIdentifier &>(*params.column);
|
||||
insert_it = std::find_if(columns_copy.begin(), columns_copy.end(), boost::bind(namesEqualIgnoreAfterDot, col_after.name, _1)) ;
|
||||
if (insert_it == columns_copy.end())
|
||||
throw Exception("Wrong column name. Cannot find column " << col_after.name << " to insert after", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
throw Exception("Wrong column name. Cannot find column " + col_after.name + " to insert after", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
}
|
||||
columns_copy.insert(insert_it, params.name_type);
|
||||
}
|
||||
@ -101,7 +101,7 @@ void InterpreterAlterQuery::execute()
|
||||
|
||||
ASTs::iterator drop_it = std::find_if(columns_copy.begin(), columns_copy.end(), boost::bind(namesEqual, drop_column.name, _1));
|
||||
if (drop_it == columns_copy.end())
|
||||
throw Exception("Wrong column name. Cannot find column " << drop_column.name <<" to drop", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
throw Exception("Wrong column name. Cannot find column " + drop_column.name +" to drop", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
else
|
||||
columns_copy.erase(drop_it);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ void IStorage::alterColumns(const ASTAlterQuery::Parameters & params, NamesAndTy
|
||||
NamesAndTypesList::reverse_iterator reverse_insert_it = std::find_if(columns->rbegin(), columns->rend(), boost::bind(namesEqual, column_name, _1) );
|
||||
|
||||
if (reverse_insert_it == columns->rend())
|
||||
throw Exception("Wrong column name. Cannot find column " << column_name << " to insert after", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
throw Exception("Wrong column name. Cannot find column " + column_name + " to insert after", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
else
|
||||
{
|
||||
/// base возвращает итератор уже смещенный на один элемент вправо
|
||||
@ -199,7 +199,7 @@ void IStorage::alterColumns(const ASTAlterQuery::Parameters & params, NamesAndTy
|
||||
if (column_it == columns->end())
|
||||
{
|
||||
if (is_first)
|
||||
throw Exception("Wrong column name. Cannot find column " << column_name << " to drop", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
throw Exception("Wrong column name. Cannot find column " + column_name + " to drop", DB::ErrorCodes::ILLEGAL_COLUMN);
|
||||
}
|
||||
else
|
||||
columns->erase(column_it);
|
||||
|
Loading…
Reference in New Issue
Block a user