Skip to content

Commit 7b312d4

Browse files
committed
Merge branch 'cassandra-4.0' into cassandra-4.1
2 parents fca850c + 2d7e99f commit 7b312d4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

doc/modules/cassandra/pages/cql/ddl.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ include::example$BNF/ks_table.bnf[]
2222
----
2323

2424
Both keyspace and table name should be comprised of only alphanumeric
25-
characters, cannot be empty and are limited in size to 48 characters
26-
(that limit exists mostly to avoid filenames (which may include the
25+
or underscore characters and cannot be empty.
26+
Keyspace name is limited in size to 48 characters, while
27+
table name is limited in size to 222 characters
28+
(those limits exist mostly to avoid filenames (which may include the
2729
keyspace and table name) to go over the limits of certain file systems).
2830
By default, keyspace and table names are case-insensitive (`myTable` is
2931
equivalent to `mytable`) but case sensitivity can be forced by using

test/unit/org/apache/cassandra/schema/CreateTableValidationTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.apache.cassandra.schema.SchemaConstants.TABLE_NAME_LENGTH;
4141
import static org.assertj.core.api.Assertions.assertThat;
4242
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
43+
import static org.junit.Assert.assertEquals;
4344
import static org.junit.Assert.assertTrue;
4445
import static org.junit.Assert.fail;
4546

@@ -171,6 +172,9 @@ public void testCreatingTableWithLongName() throws Throwable
171172
String tableName = StringUtils.repeat("t", FILENAME_LENGTH - tableIdSuffix);
172173
String tooLongTableName = StringUtils.repeat("l", FILENAME_LENGTH - tableIdSuffix + 1);
173174

175+
// Assert that the documented value of 222 corresponds to the actual constant.
176+
assertEquals(222, TABLE_NAME_LENGTH);
177+
174178
execute(String.format("CREATE KEYSPACE %s with replication = " +
175179
"{ 'class' : 'SimpleStrategy', 'replication_factor' : 1 }",
176180
keyspaceName));

0 commit comments

Comments
 (0)