[ 
https://issues.apache.org/jira/browse/CALCITE-7322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18044028#comment-18044028
 ] 

Yu Xu commented on CALCITE-7322:
--------------------------------

According to the document we can believe 'locate' can instead of 'instr' which 
can handle the 'from clause'

https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_locate

test with 2 paramters:
{code:java}
select locate('a', 'bbacda') {code}
result is ok:
{code:java}
3 {code}
test with 3 paramters:
{code:java}
select locate('a', 'bbacda', 4)  {code}
result is ok:
{code:java}
6
{code}

> The POSITION function in SQLite is missing the FROM clause
> ----------------------------------------------------------
>
>                 Key: CALCITE-7322
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7322
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Minor
>             Fix For: 1.42.0
>
>
> POSITION function would convert to 'instr' in MySQL dialect,but instr 
> function would lost the the third paramter 'from clause'
> origin sql:
>  
> {code:java}
> select POSITION('a' in 'bbacdac' from 4) {code}
>  
>  
> in MysqlDialect would convert to:
>  
> {code:java}
> select INSTR('bbacdac', 'a')
> {code}
> which lost the 'from clause':  '4'.
>  
>  
>  



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

Reply via email to