Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Aleksey Yeschenko 2023-10-26 17:46:05 +01:00
commit f5fba9b702
3 changed files with 24 additions and 0 deletions

View File

@ -3,6 +3,7 @@
* Add the ability to disable bulk loading of SSTables (CASSANDRA-18781)
* Clean up obsolete functions and simplify cql_version handling in cqlsh (CASSANDRA-18787)
Merged from 5.0:
* Fix schema loading of UDTs inside vectors inside UDTs (CASSANDRA-18964)
* Add cqlsh autocompletion for the vector data type (CASSANDRA-18946)
* Fix nodetool tablehistograms output to avoid printing repeated information and ensure at most two arguments (CASSANDRA-18955)
* Change the checksum algorithm SAI-related files use from CRC32 to CRC32C (CASSANDRA-18836)

View File

@ -899,6 +899,12 @@ public interface CQL3Type
return true;
}
@Override
public boolean referencesUserType(String name)
{
return element.referencesUserType(name);
}
@Override
public boolean supportsFreezing()
{

View File

@ -34,6 +34,7 @@ import org.apache.cassandra.db.marshal.FloatType;
import org.apache.cassandra.db.marshal.Int32Type;
import org.apache.cassandra.db.marshal.VectorType;
import org.apache.cassandra.exceptions.InvalidRequestException;
import org.apache.cassandra.schema.SchemaKeyspace;
import org.apache.cassandra.transport.ProtocolVersion;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.assertj.core.api.Assertions;
@ -188,6 +189,22 @@ public class CQLVectorTest extends CQLTester.InMemory
"INSERT INTO %s (pk, value) VALUES (0, ?)", vector("a", "b", "c"));
}
@Test
public void sandwichBetweenUDTs()
{
schemaChange("CREATE TYPE cql_test_keyspace.b (y int);");
schemaChange("CREATE TYPE cql_test_keyspace.a (z vector<frozen<b>, 2>);");
// make sure types can be loaded back; see https://issues.apache.org/jira/browse/CASSANDRA-18964
SchemaKeyspace.fetchNonSystemKeyspaces();
createTable("CREATE TABLE %s (pk int primary key, value a)");
execute("INSERT INTO %s (pk, value) VALUES (0, {z: [{y:1}, {y:2}]})");
assertRows(execute("SELECT * FROM %s"),
row(0, userType("z", vector(userType("y", 1), userType("y", 2)))));
}
@Test
public void invalidElementTypeFixedWidth() throws Throwable
{