You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/04/17 18:33:00 UTC

[jira] [Resolved] (CALCITE-5648) SqlDelegatingConformance incorrectly delegates to SqlConformanceEnum.DEFAULT

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

Julian Hyde resolved CALCITE-5648.
----------------------------------
    Fix Version/s: 1.35.0
       Resolution: Fixed

Fixed in [1abb7ad7|https://github.com/apache/calcite/commit/1abb7ad737d691b0a1ef5e04c3deb7cb07ec44a8]; thanks for the PR, [~adamkennedy77] and thanks for reviewing/merging [~libenchao]!

> SqlDelegatingConformance incorrectly delegates to SqlConformanceEnum.DEFAULT
> ----------------------------------------------------------------------------
>
>                 Key: CALCITE-5648
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5648
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Adam Kennedy
>            Assignee: Adam Kennedy
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>   Original Estimate: 1h
>          Time Spent: 20m
>  Remaining Estimate: 40m
>
> SqlDelegatingConformance is implemented as a sub-class of SqlAbstractConformance instead of being a pure delegator and just implemented the SqlConformance interface.
> Because of this when a new method is added to the SqlConformance interface (as happens fairly regularly) no exception or missing method compile error will be triggered for SqlDelegatingConformance and there is no indication that the class will misbehave.
> Instead what will happen is that for the newly added methods, calls to an instance of SqlDelegatingConformance will be send to the SqlAbstractConformance version of the method instead of the delegate's version of the method, silently returning the incorrect value any time the delegate has a different behavior than SqlConformanceEnum.DEFAULT.
> SqlDelegatingConformance should be changed to directly implement the interface, which will force a new delegating method to be added any time a new method is added to the SqlConformance interface by just failing to compile. On compilation failure, the fix of added a new delegating method is obvious.



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