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

xiong duan commented on CALCITE-6436:
-------------------------------------

Fixed in 
[d2e3350|https://github.com/apache/calcite/commit/d2e335021184b7a30af459c1f2d587286d017e61].
 Thanks for the review [~mbudiu] and [~caicancai].

> JDBC adapter generates SQL missing parentheses when comparing 3 values with 
> the same precedence like (a=b)=c
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6436
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6436
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Ulrich Kramer
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>
> Running the following unit test in {{JdbcAdapterTest}} fails with 
> {code:java}
> @Test void testOperatorInWhere() {
>     CalciteAssert.model(FoodmartSchema.FOODMART_MODEL)
>         .query("select * from \"sales_fact_1997\" "
>             + "where (\"product_id\" = 1) = ?")
>         .consumesPreparedStatement(p -> p.setBoolean(1, true))
>         .runs();
>   }
> {code}
> {noformat}
> Caused by: java.sql.SQLSyntaxErrorException: unexpected token: = : line: 3 in 
> statement [SELECT *
> FROM "foodmart"."sales_fact_1997"
> WHERE "product_id" = 1 = ?
> {noformat}



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

Reply via email to