sepuri sai krishna created FLINK-41319:
------------------------------------------

             Summary: REGEXP_INSTR disagrees with POSITION, LOCATE and INSTR 
for characters outside the BMP
                 Key: FLINK-41319
                 URL: https://issues.apache.org/jira/browse/FLINK-41319
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Runtime
    Affects Versions: 2.4.0
            Reporter: sepuri sai krishna


All four functions are documented as returning the position of a match, with 
indexes beginning at 1.
They disagree as soon as the string holds a character outside the BMP.

{code:sql}
-- four characters, each outside the BMP
SELECT REGEXP_INSTR('𝕏𝕐𝕒𝕓', '𝕒'), POSITION('𝕒' IN '𝕏𝕐𝕒𝕓'),
       LOCATE('𝕒', '𝕏𝕐𝕒𝕓'), INSTR('𝕏𝕐𝕒𝕓', '𝕒');
{code}

Returns {{5, 3, 3, 3}}. The match is the third character. On a string without 
such characters all
four agree.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to