Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2071

Query with IN and OR in WHERE clause returns wrong result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.16.0
    • Component/s: None
    • Labels:
      None

      Description

      Query in this test returns the wrong result (it returns empty result):

        @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");
        }
      

      Without condition in or operator

      \"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) 
      

      it returns the right result.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                vvysotskyi Volodymyr Vysotskyi
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: