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

Zhen Chen updated CALCITE-7316:
-------------------------------
    Description: 
The original test:
{code:java}
  @Test void testPositionFunctionForSqlite() {
    final String query = "select position('A' IN 'ABC') from \"product\"";
    final String expected = "SELECT INSTR('ABC', 'A')\n"
        + "FROM \"foodmart\".\"product\"";
    sql(query).withSQLite().ok(expected);
  } {code}
But I change position('A' IN 'ABC') to position('A' IN 'ABC' FROM 2), this case 
alse works well.
{code:java}
  @Test void testPositionFunctionForSqlite2() {
    final String query = "select position('A' IN 'ABC' FROM 2) from 
\"product\"";
    final String expected = "SELECT INSTR('ABC', 'A')\n"
        + "FROM \"foodmart\".\"product\"";
    sql(query).withSQLite().ok(expected);
  } {code}

  was:
The original test:

 
{code:java}
  @Test void testPositionFunctionForSqlite() {
    final String query = "select position('A' IN 'ABC') from \"product\"";
    final String expected = "SELECT INSTR('ABC', 'A')\n"
        + "FROM \"foodmart\".\"product\"";
    sql(query).withSQLite().ok(expected);
  } {code}
But I change position('A' IN 'ABC') to position('A' IN 'ABC' FROM 2), this case 
alse works well.

 
{code:java}
  @Test void testPositionFunctionForSqlite2() {
    final String query = "select position('A' IN 'ABC' FROM 2) from 
\"product\"";
    final String expected = "SELECT INSTR('ABC', 'A')\n"
        + "FROM \"foodmart\".\"product\"";
    sql(query).withSQLite().ok(expected);
  } {code}
 

 


> The POSITION function in SQLite is missing the FROM clause
> ----------------------------------------------------------
>
>                 Key: CALCITE-7316
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7316
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Zhen Chen
>            Priority: Minor
>
> The original test:
> {code:java}
>   @Test void testPositionFunctionForSqlite() {
>     final String query = "select position('A' IN 'ABC') from \"product\"";
>     final String expected = "SELECT INSTR('ABC', 'A')\n"
>         + "FROM \"foodmart\".\"product\"";
>     sql(query).withSQLite().ok(expected);
>   } {code}
> But I change position('A' IN 'ABC') to position('A' IN 'ABC' FROM 2), this 
> case alse works well.
> {code:java}
>   @Test void testPositionFunctionForSqlite2() {
>     final String query = "select position('A' IN 'ABC' FROM 2) from 
> \"product\"";
>     final String expected = "SELECT INSTR('ABC', 'A')\n"
>         + "FROM \"foodmart\".\"product\"";
>     sql(query).withSQLite().ok(expected);
>   } {code}



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

Reply via email to