Skip to content

Commit 08557df

Browse files
authored
CNDB-13618 remove long index name test after fix (#1681)
Fixes riptano/cndb#13618 CNDB-13299 prevents creating indexes with too long index names and adds corresponding tests. Thus this test in another test class is not needed.
1 parent f7641a4 commit 08557df

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

test/unit/org/apache/cassandra/index/sai/cql/NativeIndexDDLTest.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -264,32 +264,6 @@ public void shouldNotFailCreateWithTupleType()
264264
assertTrue(tuple.isTuple());
265265
}
266266

267-
/**
268-
* The test reproduces CNDB-13198
269-
*/
270-
@Test
271-
public void reproFailOnLongIndexName()
272-
{
273-
// Generate an index name of the maximum allowed length, adding four chars accounting for components with a
274-
// generation number of the form "-XXX", which won't be included in the first index segment, and
275-
// the difference between actual index component representation and longest (4 chars).
276-
String longIndexName = "a".repeat(Version.calculateIndexNameAllowedLength() + 4 + 4);
277-
createTable("CREATE TABLE %s (key int PRIMARY KEY, value1 int, value2 int)");
278-
createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(value1) USING 'StorageAttachedIndex'", longIndexName));
279-
execute("INSERT INTO %s (\"key\", value1) VALUES (1, 1)");
280-
execute("INSERT INTO %s (\"key\", value2) VALUES (2, 2)");
281-
flush();
282-
283-
// Now try to create an index with a name that is one character longer than the maximum allowed length.
284-
longIndexName += "a";
285-
createTable("CREATE TABLE %s (key int PRIMARY KEY, value1 int, value2 int)");
286-
createIndex(String.format("CREATE CUSTOM INDEX %s ON %%s(value1) USING 'StorageAttachedIndex'", longIndexName));
287-
execute("INSERT INTO %s (\"key\", value1) VALUES (1, 1)");
288-
execute("INSERT INTO %s (\"key\", value2) VALUES (2, 2)");
289-
RuntimeException e = assertThrows(RuntimeException.class, this::flush);
290-
assertTrue(e.getCause() instanceof FileSystemException);
291-
}
292-
293267
@Test
294268
public void shouldCreateIndexIfExists()
295269
{

0 commit comments

Comments
 (0)