Andrey Khitrin created IGNITE-20660:
---------------------------------------

             Summary: SQL: broken behavior of OCTET_LENGTH function
                 Key: IGNITE-20660
                 URL: https://issues.apache.org/jira/browse/IGNITE-20660
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 3.0.0-beta2
            Reporter: Andrey Khitrin


Recently, `OCTET_LENGTH` function acted like a synonym for `LENGTH` function. 
But in the latest AI3 versions, it started to decline usual strings:
{code:sql}
sql-cli> select OCTET_LENGTH('Some Text');
SQL query execution error
Failed to validate query. From line 0, column 0 to line 1, column 31: Cast 
function cannot convert value of type CHAR(9) to type VARBINARY
{code}

Looks like it only accepts a very specific type of strings:
{code:sql}
sql-cli> select OCTET_LENGTH(x'0123');
╔═══════════════════════╗
║ OCTET_LENGTH(X'0123') ║
╠═══════════════════════╣
║ 2                     ║
╚═══════════════════════╝
{code}

But as it said in ANSI99 specification, this function must be able to work with 
any correct string.



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

Reply via email to