[ 
https://issues.apache.org/jira/browse/IMPALA-15532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiyoung Yoo resolved IMPALA-15532.
----------------------------------
    Resolution: Fixed

> 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
>            Assignee: Jiyoung Yoo
>            Priority: Major
>
> 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
(v10.3.26#10030026)

Reply via email to