Adam Kennedy created CALCITE-5648:
-------------------------------------

             Summary: 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


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)

Reply via email to