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

Diverged view created via an older client still sees dropped column data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 5.0.0, 4.15.0
    • 5.1.0, 4.16.0
    • None
    • None

    Description

      By "diverged view" I mean creating a view and then dropping one of the inherited columns from the view. Steps to reproduce:

      Start a 4.x server and connect with a pre-4.15 (I tried a 4.14.3) client

      CREATE TABLE IF NOT EXISTS S.T (A INTEGER PRIMARY KEY, B INTEGER);
      CREATE VIEW IF NOT EXISTS S.V (new_col INTEGER) AS SELECT * FROM S.T;
      UPSERT INTO S.T VALUES(1,2);
      ALTER VIEW S.V DROP COLUMN B;
      SELECT * FROM S.T; 
      +----+------+
      | A  |  B   |
      +----+------+
      | 1  |  2   |
      +----+------+
      
      SELECT * FROM S.V; gives:
      +----+------+----------+
      | B  |  A   |  NEW_COL |
      +----+------+----------+
      | 2  |  1   |  null    |
      +----+------+----------+
      

      Though the column 'B' has been dropped from the view. This is a problem for both when phoenix.allow.system.catalog.rollback=true or false. This exact bug does not happen for a 4.x client, though PHOENIX-6030 and PHOENIX-6032 highlight other issues related to this code path for 4.x clients.
      The problem is mostly due to changes introduced by PHOENIX-4893

      Attachments

        1. PHOENIX-5958-4.x-v2.patch
          51 kB
          Chinmay Kulkarni
        2. PHOENIX-5958-4.x-v3.patch
          49 kB
          Chinmay Kulkarni

        Issue Links

          Activity

            People

              ckulkarni Chinmay Kulkarni
              ckulkarni Chinmay Kulkarni
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m