Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4534

upsert/delete/upsert for the same row corrupts the indexes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 4.14.0, 5.0.0
    • 4.14.0
    • None

    Description

      If we delete and upsert again the same row, the corresponding index has a null value.

      0: jdbc:phoenix:> create table a (id integer primary key, f float);
      No rows affected (2.272 seconds)
      0: jdbc:phoenix:> create index i1 on a (f);
      No rows affected (5.769 seconds)
      0: jdbc:phoenix:> upsert into a values (1,0.5);
      1 row affected (0.021 seconds)
      0: jdbc:phoenix:> select * from i1;
      +------+------+
      | 0:F  | :ID  |
      +------+------+
      | 0.5  | 1    |
      +------+------+
      1 row selected (0.016 seconds)
      0: jdbc:phoenix:> delete from a where id = 1;
      1 row affected (0.009 seconds)
      0: jdbc:phoenix:> select * from i1;
      +------+------+
      | 0:F  | :ID  |
      +------+------+
      +------+------+
      No rows selected (0.015 seconds)
      0: jdbc:phoenix:> upsert into a values (1,0.5);
      1 row affected (0.008 seconds)
      0: jdbc:phoenix:> select * from i1;
      +-------+------+
      |  0:F  | :ID  |
      +-------+------+
      | null  | 1    |
      +-------+------+
      1 row selected (0.013 seconds)
      

      Attachments

        1. PHOENIX-4534_v2.patch
          4 kB
          Rajeshbabu Chintaguntla
        2. PHOENIX-4534_v3.patch
          6 kB
          Rajeshbabu Chintaguntla
        3. PHOENIX-4534.patch
          4 kB
          Rajeshbabu Chintaguntla

        Activity

          People

            rajeshbabu Rajeshbabu Chintaguntla
            romil.choksi Romil Choksi
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: