mirror of https://github.com/apache/cassandra
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 |
||
|---|---|---|
| .. | ||
| anttasks/org/apache/cassandra/anttasks | ||
| bin | ||
| burn/org/apache/cassandra | ||
| conf | ||
| data | ||
| distributed/org/apache/cassandra | ||
| long/org/apache/cassandra | ||
| memory/org/apache/cassandra/db/compaction | ||
| microbench/org/apache/cassandra/test/microbench | ||
| resources | ||
| unit/org | ||