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

Dmitry Sysolyatin updated CALCITE-7220:
---------------------------------------
    Fix Version/s:     (was: 1.41.0)

> RelToSqlConverter throws exception for UPDATE with self-referencing column in 
> SET
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-7220
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7220
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.40.0
>            Reporter: Dmitry Sysolyatin
>            Assignee: Dmitry Sysolyatin
>            Priority: Major
>              Labels: pull-request-available
>
> The following test
> {code:java}
> @Test void testUpdate() {
>     final String sql0 =
>         "update \"foodmart\".\"product\" set \"product_name\" = 
> \"product_name\" || '_'"
>             + "where \"product_id\" > 10";
>     final String expected0 = "";
>     sql(sql0).ok(expected0);
>   }
> {code}
> throws an exception:
> {code:java}
> field ordinal 3 out of range {}
> java.lang.AssertionError: field ordinal 3 out of range {}
>       at 
> org.apache.calcite.rel.rel2sql.SqlImplementor$AliasContext.field(SqlImplementor.java:1702)
> {code}
> This happens because the current code uses an empty context for exprList. But 
> looks like using exprList is not needed at all.



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

Reply via email to