Added a comment

This commit is contained in:
Alexey Milovidov 2020-01-05 08:45:13 +03:00
parent ac163ce6c6
commit ba6a56a485

View File

@ -369,6 +369,8 @@ void StorageFile::rename(const String & new_path_to_table_data, const String & n
void StorageFile::truncate(const ASTPtr & /*query*/, const Context & /* context */, TableStructureWriteLockHolder &)
{
/// NOTE: It will throw exception if the file is not created yet.
if (paths.size() != 1)
throw Exception("Can't truncate table '" + table_name + "' in readonly mode", ErrorCodes::DATABASE_ACCESS_DENIED);