Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - Test Failure
-
Low
-
Low Hanging Fruit
-
DTest
-
All
-
None
-
Description
The following test fails
@Test public void incorrectClusteringColumnTest() throws IOException { try (Cluster cluster = init(Cluster.build(1).start())) { cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int, c int, v int, primary key(k, c))")); cluster.coordinator(1).execute(withKeyspace("INSERT INTO %s.t (k, c, v) VALUES (0, 1, 2)"), ConsistencyLevel.QUORUM); String query = withKeyspace("SELECT v FROM %s.t WHERE k IN (0, 1) ORDER BY c LIMIT 10"); assertRows(cluster.coordinator(1).execute(query, ConsistencyLevel.ONE), row(2)); } }
The query is returning the clustering column c as well as the regular column v.
The reason for the extra column being returned is that the RowUtil is using ResultMessage.Rows.result.metadata.names instead on ResultMessage.Rows.result.metadata.requestNames(). This last method removes columns that have not been requested.