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

Ulrich Kramer updated CALCITE-6436:
-----------------------------------
    Summary: JDBC adapter generates SQL with missing round brackets when WHERE 
condition which contains calculations  (was: Missing round brackets in WHERE 
condition which contains calculations)

> JDBC adapter generates SQL with missing round brackets when WHERE condition 
> which contains calculations
> -------------------------------------------------------------------------------------------------------
>
>                 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
>            Priority: Major
>
> 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