Fix review issues.

This commit is contained in:
Yarik Briukhovetskyi 2024-10-31 16:36:53 +01:00 committed by GitHub
parent feb1fbbacb
commit f46a6fabd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -23,7 +23,7 @@ size_t computeMaxTableNameLength(const String & database_name, ContextPtr contex
size_t escaped_db_name_length = escapeForFileName(database_name).length();
const size_t uuid_length = 36; // Standard UUID length
const size_t extension_length = 6; // Length of ".sql" including three dots
const size_t extension_length = strlen(".sql"); // Length of ".sql"
// Adjust for database name and UUID in dropped table filenames
size_t max_to_drop = max_dropped_length - escaped_db_name_length - uuid_length - extension_length;

View File

@ -393,10 +393,12 @@ void DatabaseOnDisk::checkMetadataFilenameAvailabilityUnlocked(const String & to
size_t allowed_max_length = computeMaxTableNameLength(database_name, getContext());
String table_metadata_path = getObjectMetadataPath(to_table_name);
if (escapeForFileName(to_table_name).length() > allowed_max_length)
const auto escaped_name_length = escapeForFileName(to_table_name).length();
if (escaped_length > allowed_max_length)
throw Exception(ErrorCodes::ARGUMENT_OUT_OF_BOUND,
"The max length of table name for database {} is {}, current length is {}",
database_name, allowed_max_length, to_table_name.length());
database_name, allowed_max_length, escaped_length);
if (fs::exists(table_metadata_path))
{

View File

@ -56,8 +56,6 @@ public:
return std::make_shared<DataTypeUInt64>();
}
bool isDeterministic() const override { return false; }
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }
ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override