This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit d48548c7afe91fc654f4dfd518628dd90ab16ccd
Merge: 9619e4ed31 20310db64c
Author: Caleb Rackliffe <[email protected]>
AuthorDate: Thu Sep 17 21:20:52 2026 -0500

    Merge branch 'cassandra-6.0' into trunk
    
    * cassandra-6.0:
      Throw InvalidRequestException instead of crashing on malformed IN marker 
values

 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/cql3/terms/InMarker.java  | 11 +++-
 .../apache/cassandra/cql3/terms/InMarkerTest.java  | 64 ++++++++++++++++++++++
 3 files changed, 75 insertions(+), 1 deletion(-)

diff --cc CHANGES.txt
index b34f16769a,bb3db66447..a4ad309786
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,16 -1,5 +1,17 @@@
 -6.0-alpha3
 +7.0
 + * Redact hash and _hash suffixed parameters in system_views.settings 
(CASSANDRA-21686)
 + * Allow CQLSSTableWriter to specify SSTable id generator to use 
(CASSANDRA-21012)
 + * Reject LIKE patterns with a wildcard (%) anywhere other than the start or 
end (CASSANDRA-21068)
 + * Support pluggable default role initialization (CASSANDRA-21546)
 + * Add prepared statement cache stats to nodetool info (CASSANDRA-14366)
 + * Don't increment client metrics on messaging service connection unpause 
(CASSANDRA-21491)
 + * Add nodetool getreplicas (CASSANDRA-17665)
 + * Implementation of CEP-49: Hardware-accelerated compression 
(CASSANDRA-20975)
 + * Avoid using ObjectUtils.getFirstNonNull in Schema (CASSANDRA-21394)
 + * Allow nodetool garbagecollect to take a user defined list of SSTables 
(CASSANDRA-16767)
 + * Add a guardrail for misprepared statements (CASSANDRA-21139)
 +Merged from 6.0:
+  * Throw InvalidRequestException instead of crashing on malformed IN marker 
values (CASSANDRA-21648)
   * Avoid serialization and deserialization for coordinator-local single 
partition data read (CASSANDRA-21354)
   * Allow nodetool cms reconfigure to ignore nodes via --ignore, excluding 
them from the new CMS (CASSANDRA-21627)
   * Accord: Compute Dependencies Incrementally (CASSANDRA-21682)
diff --cc test/unit/org/apache/cassandra/cql3/terms/InMarkerTest.java
index 0000000000,abf07ac0e9..a0eaba0f39
mode 000000,100644..100644
--- a/test/unit/org/apache/cassandra/cql3/terms/InMarkerTest.java
+++ b/test/unit/org/apache/cassandra/cql3/terms/InMarkerTest.java
@@@ -1,0 -1,64 +1,64 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements.  See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership.  The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License.  You may obtain a copy of the License at
+  *
+  *     http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ 
+ package org.apache.cassandra.cql3.terms;
+ 
+ import java.nio.ByteBuffer;
+ import java.util.Collections;
+ 
+ import org.junit.Test;
+ 
+ import org.apache.cassandra.cql3.CQLTester;
+ import org.apache.cassandra.cql3.QueryOptions;
+ import org.apache.cassandra.cql3.statements.SelectStatement;
+ import org.apache.cassandra.exceptions.InvalidRequestException;
+ import org.apache.cassandra.service.QueryState;
+ 
+ import static org.junit.Assert.fail;
+ 
+ public class InMarkerTest extends CQLTester
+ {
+     @Test
+     public void testNotEnoughBytesThrowsInvalidRequest()
+     {
+         assertInMarkerRejectsMalformedValue(new byte[]{ 0, 0, 0, 1 });
+     }
+ 
+     @Test
+     public void testExtraneousBytesThrowsInvalidRequest()
+     {
+         assertInMarkerRejectsMalformedValue(new byte[]{ 0, 0, 0, 0, 9, 9 });
+     }
+ 
+     private void assertInMarkerRejectsMalformedValue(byte[] 
malformedListBytes)
+     {
+         createTable("CREATE TABLE %s (pk int PRIMARY KEY, v int)");
+         SelectStatement select = (SelectStatement) parseStatement("SELECT * 
FROM " + KEYSPACE + '.' + currentTable() + " WHERE pk IN ?");
+ 
+         QueryOptions options = 
QueryOptions.forInternalCalls(Collections.singletonList(ByteBuffer.wrap(malformedListBytes)));
+         try
+         {
+             select.getQuery(options, 
QueryState.forInternalCalls().getNowInSeconds());
+             fail("Expected InvalidRequestException to be thrown for a 
malformed IN marker value");
+         }
+         catch (InvalidRequestException e)
+         {
+             // expected
+         }
+     }
 -}
++}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to