Change error code in LIVE VIEW

This commit is contained in:
Alexey Milovidov 2021-06-27 15:40:07 +03:00
parent 4b994fc3c7
commit 4dbd659d64

View File

@ -81,8 +81,7 @@ static StorageID extractDependentTable(ASTPtr & query, ContextPtr context, const
{
auto * ast_select = subquery->as<ASTSelectWithUnionQuery>();
if (!ast_select)
throw Exception("Logical error while creating StorageLiveView."
" Could not retrieve table name from select query.",
throw Exception("LIVE VIEWs are only supported for queries from tables, but there is no table name in select query.",
DB::ErrorCodes::QUERY_IS_NOT_SUPPORTED_IN_LIVE_VIEW);
if (ast_select->list_of_selects->children.size() != 1)
throw Exception("UNION is not supported for LIVE VIEW", ErrorCodes::QUERY_IS_NOT_SUPPORTED_IN_LIVE_VIEW);