mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 19:42:00 +00:00
Fix review issues.
This commit is contained in:
parent
feb1fbbacb
commit
f46a6fabd1
@ -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;
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user