cassandra/test
Ruslan Fomkin 6c29686ea7 Prevent too long table names not fitting file names
The length of table names was not controlled. This is likely due to
confusion between validation methods with similar names. As result
creating tables with too long names led to the too long file name
exceptions during table creations.

This commit adds a validation of table name lengths to avoid the too
long file name errors. The validation length is based on how the table
name is used to create file/directory names, and needs to be exact to
prevent the too long file name exception, but allow all other table
names, which didn't lead to the too long file name exception. This
length limit is different from the existing name length limit of 48
characters used by common validation functions.

Thus, this commit moves out the length validation from the validation
methods into a separate length validation method, so the errors on
names are more specific. The non-length validation methods combined
into a single method, which checks for empty names and valid characters.

New constants are added for the length limits.

Table name related code are moved into methods in TableMetadata class,
so their semantics are more clear and to allow reuse, e.g., in
asserting the table name length constant.
Tests are added for the long table names and non-alphanumeric names.

Keyspace name validation function is now shared between two classes and
a unit test of it is added.

Patch by Ruslan Fomkin; reviewed by Piotr Kołaczkowski, Dmitry
Konstantinov, Maxwell Guo for CASSANDRA-20389
2025-09-10 22:48:43 +01:00
..
anttasks/org/apache/cassandra/anttasks JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
bin JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
burn/org/apache/cassandra Fix BTree.FastBuilder.reset() and test 2024-09-16 12:24:32 -05:00
conf Use default commitlog settings in test YAMLs 2024-08-15 10:12:39 -05:00
data Fix IndexOutOfBoundsException in sstablemetadata tool when a range tombstone is a max clustering value 2025-08-27 18:54:10 +02:00
distributed/org/apache/cassandra Ensure prepared_statement INSERT timestamp precedes eviction DELETE 2025-05-27 22:17:15 -05:00
long/org/apache/cassandra Merge branch 'cassandra-3.11' into cassandra-4.0 2023-01-28 16:54:39 +01:00
memory/org/apache/cassandra/db/compaction Remove OrderedJUnit4ClassRunner 2021-09-20 13:37:32 +02:00
microbench/org/apache/cassandra/test/microbench JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
resources Remove byteman-related files from production sources 2023-10-10 09:51:11 +02:00
unit/org Prevent too long table names not fitting file names 2025-09-10 22:48:43 +01:00