GitHub user DaveBirdsall opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/661

    [TRAFODION-2161] Support migration of user views on Repository upgrade

    Today, users can create views that reference Repository tables. However, 
when they do so, "initialize trafodion, upgrade" fails because under the covers 
it does ALTER TABLE RENAME on old Repository tables and the latter does not 
support views.
    
    This change adds support for such views to "initialize trafodion, upgrade".
    
    The design is as follows:
    
    1. An internal-only option, "SKIP VIEW CHECK", has been added to ALTER 
TABLE RENAME. This causes any views on the object being renamed to be ignored; 
that is, they remain in the metadata, referring to the object by its old name. 
Note that if we abort the upgrade, we'll rename the old repository tables back 
to their original names (again using "SKIP VIEW CHECK"), so the views are then 
in their original state.
    
    2. When we determine that upgrade has progressed far enough that we will 
not turn back, we drop the views but replay their view text to create new views 
of the same name. If this succeeds, the view has been successfully migrated. 
But it might not succeed, for example if it depends on a column in the old 
repository table that has been dropped. In this case, we save the view text in 
the metadata TEXT table, with TEXT_TYPE = 9 and report that fact to the user. 
This gives the user a way to take that view text and modify it at their leisure 
after the upgrade has completed.
    
    While making these changes, I also noticed and fixed a bug in 
CmpSeabaseDDL::dropOneTableorView where the SQL parser flags global was not 
being handled correctly.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2161

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/661.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #661
    
----
commit 3b760a58636cc325093930466ac668d87e43619a
Author: Dave Birdsall <dbirds...@apache.org>
Date:   2016-08-17T22:01:10Z

    [TRAFODION-2161] Support migration of user views on Repository upgrade

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to