You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2016/11/22 19:43:45 UTC
[3/4] incubator-trafodion git commit: fixed issue with repos upgrade
fixed issue with repos upgrade
repos upgrade would fail as it internally does an 'alter rename'
which cannot run inside of a transaction.
The core to begin/commit xn around alter rename has been removed.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/1396fe0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/1396fe0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/1396fe0c
Branch: refs/heads/master
Commit: 1396fe0c9265452d8239571908d561129ba980d3
Parents: 734783c
Author: Anoop Sharma <an...@esgyn.com>
Authored: Tue Nov 22 05:46:48 2016 +0000
Committer: Anoop Sharma <an...@esgyn.com>
Committed: Tue Nov 22 05:46:48 2016 +0000
----------------------------------------------------------------------
core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/1396fe0c/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
index b3076d5..20af639 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
@@ -283,6 +283,14 @@ short CmpSeabaseDDL::alterRenameRepos(ExeCliInterface * cliInterface,
NABoolean xnWasStartedHere = FALSE;
+ // alter table rename cannot run inside of a transaction.
+ // return an error if a xn is in progress
+ if (xnInProgress(cliInterface))
+ {
+ *CmpCommon::diags() << DgSqlCode(-20123);
+ return -1;
+ }
+
for (Int32 i = 0; i < sizeof(allReposUpgradeInfo)/sizeof(MDUpgradeInfo); i++)
{
const MDUpgradeInfo &rti = allReposUpgradeInfo[i];
@@ -297,9 +305,6 @@ short CmpSeabaseDDL::alterRenameRepos(ExeCliInterface * cliInterface,
str_sprintf(queryBuf, "alter table %s.\"%s\".%s rename to %s skip view check; ",
getSystemCatalog(), SEABASE_REPOS_SCHEMA, rti.oldName, rti.newName);
- if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere))
- return -1;
-
cliRC = cliInterface->executeImmediate(queryBuf);
if (cliRC == -1389 || cliRC == -1390)
{
@@ -310,10 +315,6 @@ short CmpSeabaseDDL::alterRenameRepos(ExeCliInterface * cliInterface,
{
cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
}
-
- if (endXnIfStartedHere(cliInterface, xnWasStartedHere, cliRC) < 0)
- return -1;
-
}
return 0;
@@ -325,13 +326,6 @@ short CmpSeabaseDDL::copyOldReposToNew(ExeCliInterface * cliInterface)
char queryBuf[10000];
- NABoolean xnWasStartedHere = FALSE;
- if (xnInProgress(cliInterface))
- {
- *CmpCommon::diags() << DgSqlCode(-20123);
- return -1;
- }
-
for (Int32 i = 0; i < sizeof(allReposUpgradeInfo)/sizeof(MDUpgradeInfo); i++)
{
const MDUpgradeInfo &rti = allReposUpgradeInfo[i];