trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sureshsubbiah <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #550: [TRAFODION-2074] Create index should ...
Date Mon, 20 Jun 2016 18:13:57 GMT
Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/550#discussion_r67738650
  
    --- Diff: core/sql/generator/GenPreCode.cpp ---
    @@ -2824,44 +2823,33 @@ short DDLExpr::ddlXnsInfo(NABoolean &isDDLxn, NABoolean &xnCanBeStarted)
            (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
            (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE) ||
            (ddlNode->getOperatorType() == DDL_DROP_TABLE)))
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    -  isDDLxn = FALSE;
    -  if ((ddlXns()) || 
    -      ((ddlNode && ddlNode->castToStmtDDLNode() &&
    -        ddlNode->castToStmtDDLNode()->ddlXns())))
    -    isDDLxn = TRUE;
    -
    -  // ddl transactions are on.
    -  // Following commands currently require transactions be started and
    -  // committed in the called methods.
    -  if ((ddlXns()) &&
    -      (
    -           (purgedataHbase()) ||
    -           (upgradeRepos())
    -       )
    -      )
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    -  // ddl transactions are on.
    -  // Cleanup and alter commands requires transactions to be started and commited
    -  // in the called method.
    -  if ((ddlNode && ddlNode->castToStmtDDLNode() &&
    -       ddlNode->castToStmtDDLNode()->ddlXns()) &&
    -      ((ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
    -       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
    -       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE)))
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    +     {
    +        // transaction will be started and commited in called methods.
    +        xnCanBeStarted = FALSE;
    +     }
    +     isDDLxn = FALSE;
    +  }
    +  else  // When the DDL transaction is turned on
    +  {
    +     isDDLxn = FALSE;
    +     if (ddlNode && ddlNode->castToStmtDDLNode() &&
    +        ddlNode->castToStmtDDLNode()->ddlXns())
    +     isDDLxn = TRUE;
    +
    +     if (purgedataHbase() || upgradeRepos())
    +        // transaction will be started and commited in called methods.
    +        xnCanBeStarted = FALSE;
    +     if ((ddlNode && ddlNode->castToStmtDDLNode() &&
    +          ddlNode->castToStmtDDLNode()->ddlXns()) &&
    +            ((ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
    +             (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
    +             (ddlNode->getOperatorType() == DDL_CREATE_INDEX) ||
    --- End diff --
    
    Should POPULATE INDEX be added to this list?
    I see that DDL_POPULATE_INDEX is an enum. I don't know though if popindex is a utility
that manages its own trandactions and takes care not to use one for the load part. It may
be worthwhile to check.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message