Jiyoung Yoo created IMPALA-15532:
------------------------------------

             Summary: Incorrect result in instr() function when start position 
overflows 32-bit integer
                 Key: IMPALA-15532
                 URL: https://issues.apache.org/jira/browse/IMPALA-15532
             Project: IMPALA
          Issue Type: Bug
            Reporter: Jiyoung Yoo


In instr() string function, passing a 64-bit integer as the 'position' argument 
can lead to integer overflow when implicitly converted or cast to int32_t or 
uint32_t.

As a result, when the start position is outside the string boundary, the 
function returns an incorrect non-zero index instead of returning '0' (not 
found).

 

Examples: 

instr('corporate floor', 'or', 4294967297) -> returns 2 (expected 0)

instr('corporate floor', 'or', -4294967294) -> returns 14 (expected 0)

 



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

Reply via email to