You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2023/06/22 07:31:31 UTC

[GitHub] [ignite-3] zstan commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

zstan commented on code in PR #2223:
URL: https://github.com/apache/ignite-3/pull/2223#discussion_r1238120187


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   just to make sure that it works with cast too



-- 
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: notifications-unsubscribe@ignite.apache.org

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