Maksim Zhuravkov created IGNITE-19890:
-----------------------------------------

             Summary: Sql. VARCHAR. SUBSTRING function call with length greater 
than INT, triggers java.lang.NoSuchMethodException
                 Key: IGNITE-19890
                 URL: https://issues.apache.org/jira/browse/IGNITE-19890
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 3.0.0-beta1
            Reporter: Maksim Zhuravkov


The following query results in  java.lang.NoSuchMethodException: 
org.apache.calcite.runtime.SqlFunctions.substring(java.lang.String, int, long)
{code:java}
   assertQuery("SELECT Substring('abc' from 2 for 
2147483650)").returns("ignore-me").check();
{code}

*Expected behaviour*: data exception — substring error (because precision is 
defined as int). Other databases such as PostgreSQL reject this query because 
all numeric parameters of this function are INTs.

*Additional information*: This also affects SUBSTR functions as both these 
functions rely on typecheckers that accept types of INTEGER type family.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to