Derby
  1. Derby
  2. DERBY-887

Select statement returns wrong number of rows if you compare an integer column with a boolean expression in the where clause

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0
    • Fix Version/s: 10.5.3.1, 10.6.1.0
    • Component/s: SQL
    • Labels:
      None
    • Environment:
    • Urgency:
      Normal
    • Bug behavior facts:
      Wrong query result

      Description

      I have a table with 2 columns one is BIGINT which is Generated always starting with 1 and increment by1 and the other one is timestamp

      ij> select id,date from inbox where id = 0<3;
      ID |DATE
      -----------------------------------------------
      25 |2006-01-26 14:35:46.584
      34 |2006-01-26 14:36:16.588
      21 |2006-01-26 14:34:46.455
      22 |2006-01-26 14:34:47.176
      27 |2006-01-26 14:35:47.054
      24 |2006-01-26 14:35:16.58
      28 |2006-01-26 14:35:47.305
      35 |2006-01-26 14:36:18.771
      31 |2006-01-26 14:35:48.496
      32 |2006-01-26 14:35:48.887
      33 |2006-01-26 14:35:49.308

      11 rows selected
      ij> select id,date from inbox where id = true;
      ID |DATE
      -----------------------------------------------
      21 |2006-01-26 14:34:46.455

      1 row selected

      Both queries should return same number of rows

      Also If I delete the first row from the table then select id,date from inbox where id = true; returns the second row
      ij> delete from inbox where id=21;

      1 row inserted/updated/deleted

      Then again run
      ij> select id ,date from inbox where id=true;
      ID |DATE
      -----------------------------------------------
      22 |2006-01-26 14:35:16.58

      Which indicates that the select returns only the first row and then is getting closed

      1. bug887_interim.diff
        198 kB
        Rick Hillegas
      2. bug887_interim.diff
        198 kB
        Rick Hillegas
      3. DERBY-887.sql
        0.3 kB
        Manjula Kutty
      4. derby-887-01-ag-noImplicitCasts.diff
        27 kB
        Rick Hillegas
      5. derby-887-01-aj-noImplicitCasts.diff
        28 kB
        Rick Hillegas
      6. releaseNote.html
        2 kB
        Rick Hillegas

        Issue Links

          Activity

          Manjula Kutty created issue -
          Manjula Kutty made changes -
          Field Original Value New Value
          Attachment DERBY-887.sql [ 12322437 ]
          Kathey Marsden made changes -
          Link This issue blocks DERBY-499 [ DERBY-499 ]
          Kathey Marsden made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Attachment bug887_interim.diff [ 12322964 ]
          Rick Hillegas made changes -
          Attachment bug887_interim.diff [ 12322965 ]
          Satheesh Bandaram made changes -
          Fix Version/s 10.3.0.0 [ 12310800 ]
          Fix Version/s 10.2.0.0 [ 11187 ]
          Satheesh Bandaram made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Link This issue relates to DERBY-1029 [ DERBY-1029 ]
          Rick Hillegas made changes -
          Priority Critical [ 2 ] Major [ 3 ]
          Rick Hillegas made changes -
          Fix Version/s 10.3.0.0 [ 12310800 ]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Urgency Normal
          Rick Hillegas made changes -
          Bug behavior facts [Wrong query result]
          Rick Hillegas made changes -
          Assignee Rick Hillegas [ rhillegas ]
          Rick Hillegas made changes -
          Attachment derby-887-01-ag-noImplicitCasts.diff [ 12421895 ]
          Rick Hillegas made changes -
          Attachment releaseNote.html [ 12421899 ]
          Rick Hillegas made changes -
          Attachment derby-887-01-aj-noImplicitCasts.diff [ 12422251 ]
          Rick Hillegas made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Rick Hillegas made changes -
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Affects Version/s 10.5.2.0 [ 12314116 ]
          Affects Version/s 10.5.1.1 [ 12313771 ]
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Affects Version/s 10.4.1.3 [ 12313111 ]
          Affects Version/s 10.3.3.0 [ 12313142 ]
          Affects Version/s 10.3.2.1 [ 12312876 ]
          Affects Version/s 10.3.1.4 [ 12312590 ]
          Affects Version/s 10.2.2.0 [ 12312027 ]
          Affects Version/s 10.1.3.1 [ 12311953 ]
          Affects Version/s 10.1.2.1 [ 12310615 ]
          Affects Version/s 10.1.1.0 [ 10993 ]
          Affects Version/s 10.0.2.1 [ 10991 ]
          Affects Version/s 10.0.2.0 [ 10920 ]
          Kathey Marsden made changes -
          Link This issue is required by DERBY-4728 [ DERBY-4728 ]
          Kathey Marsden made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Kathey Marsden made changes -
          Assignee Rick Hillegas [ rhillegas ] Kathey Marsden [ kmarsden ]
          Kathey Marsden made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Assignee Kathey Marsden [ kmarsden ] Rick Hillegas [ rhillegas ]
          Fix Version/s 10.5.3.1 [ 12314182 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12346288 ] Default workflow, editable Closed status [ 12802885 ]

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Manjula Kutty
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development