[
https://issues.apache.org/jira/browse/CALCITE-2071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde updated CALCITE-2071:
---------------------------------
Summary: Query with IN and OR in WHERE clause returns wrong result (was:
Query with IN operators in WHERE clause returns wrong result)
> Query with IN and OR in WHERE clause returns wrong result
> ---------------------------------------------------------
>
> Key: CALCITE-2071
> URL: https://issues.apache.org/jira/browse/CALCITE-2071
> Project: Calcite
> Issue Type: Bug
> Reporter: Volodymyr Vysotskyi
> Assignee: Julian Hyde
> Fix For: 1.16.0
>
>
> Query in this test returns the wrong result (it returns empty result):
> {code:java}
> @Test
> @Ignore
> public void testWhereInOr() throws Exception {
> CalciteAssert.hr()
> .query("select \"empid\"\n"
> + "from \"hr\".\"emps\" t\n"
> + " where (\"empid\" in (select \"empid\" from
> \"hr\".\"emps\") \n"
> + " or \"empid\" in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, "
> + " 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
> 22, 23, 24, 25) )\n"
> + " and \"empid\" in (100, 200, 150)")
> .returns("empid=100\n"
> + "empid=200\n"
> + "empid=150\n");
> }
> {code}
> Without condition in {{or}} operator
> {code:sql}
> \"empid\" in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
> 19, 20, 21, 22, 23, 24, 25)
> {code}
> it returns the right result.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)