You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/02/04 08:45:11 UTC

[GitHub] [cassandra] bereng commented on a change in pull request #1373: [17198] Removed LIKE restriction in StatementRestrictions

bereng commented on a change in pull request #1373:
URL: https://github.com/apache/cassandra/pull/1373#discussion_r799264354



##########
File path: test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java
##########
@@ -3191,4 +3191,20 @@ public void testCreatingUDFWithSameNameAsBuiltin_FullyQualifiedFunctionNameWorks
         execute("INSERT INTO %s (k1, k2) VALUES (uuid(), 'k2')");
         assertRowCount(execute("SELECT system.token(k1, k2) FROM %s"), 1);
     }
+
+    @Test
+    public void testLikeQueryWithoutFiltering() throws Throwable
+    {
+        createTable("CREATE TABLE %s (k1 uuid, k2 text, PRIMARY KEY (k1, k2))");
+        execute("INSERT INTO %s (k1, k2) VALUES(uuid(), 'John Doe')");
+        assertRows(execute("SELECT k2 from %s where k2 like '%%Doe'"), row("John Doe"));
+    }
+
+    @Test
+    public void testLikeQueryWithFiltering() throws Throwable
+    {
+        createTable("CREATE TABLE %s (k1 uuid, k2 text, PRIMARY KEY (k1))");
+        execute("INSERT INTO %s (k1, k2) VALUES(uuid(), 'John Doe')");

Review comment:
       For completion I would add tests for all `LIKE`flavors: `LIKE_PREFIX, LIKE_SUFFIX, LIKE_CONTAINS, LIKE_MATCHES`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org