Github user DaveBirdsall commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/661#discussion_r75327411 --- Diff: core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp --- @@ -358,6 +358,75 @@ short CmpSeabaseDDL::copyOldReposToNew(ExeCliInterface * cliInterface) return 0; } +short CmpSeabaseDDL::migrateReposViews(ExeCliInterface * cliInterface, + NABoolean & someViewSaved /* out */) +{ + short retcode = 0; // assume success + someViewSaved = FALSE; + + // for each table that has been migrated, save and drop any views + // on the old table, and attempt to recreate them on the new + + for (Int32 i = 0; i < sizeof(allReposUpgradeInfo)/sizeof(MDUpgradeInfo); i++) + { + const MDUpgradeInfo &rti = allReposUpgradeInfo[i]; + + if ((! rti.newName) || (! rti.oldName) || (NOT rti.upgradeNeeded)) + continue; + + Int64 tableUID = getObjectUID(cliInterface, + getSystemCatalog(), SEABASE_REPOS_SCHEMA, rti.oldName, + COM_BASE_TABLE_OBJECT_LIT, NULL, NULL, FALSE, FALSE /* ignore error */); + + if (tableUID != -1) // if we got it + { + NAList<NAString> viewNameList; + NAList<NAString> viewDefnList; + --- End diff -- The viewDefnList contains the text from the TEXT table. These classes will use their default heap (which I think is global new/delete). When the variables go out of scope the destructors should clean everything up. I see this usage elsewhere so I'm guessing it is OK.
--- 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. ---