http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/optimizer/RelExeUtil.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp index 88fa66a..e3401b5 100644 --- a/core/sql/optimizer/RelExeUtil.cpp +++ b/core/sql/optimizer/RelExeUtil.cpp @@ -3829,12 +3829,12 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) isHbase_ = TRUE; hbaseDDLNoUserXn_ = TRUE; } - else if (getExprNode() && getExprNode()->castToElemDDLNode()) + else if (getExprNode() && getExprNode()->castToStmtDDLNode()) { - if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateTable()) + if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateTable()) { StmtDDLCreateTable * createTableNode = - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateTable(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateTable(); isCreate_ = TRUE; isTable_ = TRUE; @@ -3883,13 +3883,16 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) if ((createTableNode->getAddConstraintUniqueArray().entries() > 0) || (createTableNode->getAddConstraintRIArray().entries() > 0) || (createTableNode->getAddConstraintCheckArray().entries() > 0)) - hbaseDDLNoUserXn_ = TRUE; - + { + if ((NOT createTableNode->ddlXns()) && + (NOT Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL))) + hbaseDDLNoUserXn_ = TRUE; + } } // createTable - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateHbaseTable()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateHbaseTable()) { StmtDDLCreateHbaseTable * createHbaseTableNode = - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateHbaseTable(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateHbaseTable(); isCreate_ = TRUE; isTable_ = TRUE; @@ -3904,7 +3907,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLCreateHbaseTable()-> getTableNameAsQualifiedName(); } // createHbaseTable - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateIndex()) { isCreate_ = TRUE; isIndex_ = TRUE; @@ -3917,7 +3920,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLCreateIndex()-> getIndexNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLPopulateIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLPopulateIndex()) { isCreate_ = TRUE; isIndex_ = TRUE; @@ -3930,21 +3933,22 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLPopulateIndex()-> getIndexNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropTable()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropTable()) { isDrop_ = TRUE; isTable_ = TRUE; StmtDDLDropTable * dropTableNode = - getExprNode()->castToElemDDLNode()->castToStmtDDLDropTable(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropTable(); qualObjName_ = dropTableNode->getTableNameAsQualifiedName(); // Normally, when a drop table is executed and DDL transactions is not - // enabled, a user started transaction is not allow. However, when a + // enabled, a user started transaction is not allowed. However, when a // session ends, a call is made to drop a volatile table, this drop should - // succeed. Make this type of delete to allow transactions - if (dropTableNode->isVolatile()) + // succeed. + if ((dropTableNode->isVolatile()) && + (NOT getExprNode()->castToStmtDDLNode()->ddlXns())) hbaseDDLNoUserXn_ = TRUE; // Drops of Hive and HBase external tables are allowed @@ -3963,7 +3967,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) } } } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropHbaseTable()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropHbaseTable()) { isDrop_ = TRUE; isTable_ = TRUE; @@ -3974,7 +3978,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropHbaseTable()-> getTableNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropIndex()) { isDrop_ = TRUE; isIndex_ = TRUE; @@ -3983,32 +3987,32 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropIndex()-> getIndexNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTable()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTable()) { isAlter_ = TRUE; isTable_ = TRUE; - if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableAddColumn()) + if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableAddColumn()) alterAddCol = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableDropColumn()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableDropColumn()) alterDropCol = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableDisableIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableDisableIndex()) alterDisableIndex = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableEnableIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableEnableIndex()) alterEnableIndex = TRUE; - else if ((getExprNode()->castToElemDDLNode()->castToStmtDDLAddConstraintUnique()) || - (getExprNode()->castToElemDDLNode()->castToStmtDDLAddConstraintRI()) || - (getExprNode()->castToElemDDLNode()->castToStmtDDLAddConstraintCheck())) + else if ((getExprNode()->castToStmtDDLNode()->castToStmtDDLAddConstraintUnique()) || + (getExprNode()->castToStmtDDLNode()->castToStmtDDLAddConstraintRI()) || + (getExprNode()->castToStmtDDLNode()->castToStmtDDLAddConstraintCheck())) alterAddConstr = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropConstraint()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropConstraint()) alterDropConstr = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableRename()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableRename()) alterRenameTable = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableAlterColumnSetSGOption()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableAlterColumnSetSGOption()) alterIdentityCol = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableAlterColumnDatatype()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableAlterColumnDatatype()) alterColDatatype = TRUE; - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterTableHBaseOptions()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterTableHBaseOptions()) alterHBaseOptions = TRUE; else otherAlters = TRUE; @@ -4017,11 +4021,11 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLAlterTable()-> getTableNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterIndex()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterIndex()) { isAlter_ = TRUE; isIndex_ = TRUE; - if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterIndexHBaseOptions()) + if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterIndexHBaseOptions()) alterHBaseOptions = TRUE; else otherAlters = TRUE; @@ -4030,7 +4034,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLAlterIndex()-> getIndexNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateView()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateView()) { isCreate_ = TRUE; isView_ = TRUE; @@ -4039,7 +4043,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLCreateView()-> getViewNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropView()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropView()) { isDrop_ = TRUE; isView_ = TRUE; @@ -4048,10 +4052,10 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropView()-> getViewNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSequence()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSequence()) { StmtDDLCreateSequence * createSeq = - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSequence(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSequence(); isCreate_ = TRUE; isSeq = TRUE; @@ -4065,10 +4069,10 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLCreateSequence()-> getSeqNameAsQualifiedName(); } // createSequence - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropSequence()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSequence()) { StmtDDLDropSequence * dropSeq = - getExprNode()->castToElemDDLNode()->castToStmtDDLDropSequence(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSequence(); isDrop_ = TRUE; isSeq = TRUE; @@ -4082,55 +4086,55 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropSequence()-> getSeqNameAsQualifiedName(); } // dropSequence - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLRegisterUser()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLRegisterUser()) { isAuth = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLAlterUser()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLAlterUser()) { isAuth = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateRole()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateRole()) { isAuth = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLRoleGrant()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLRoleGrant()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLRegisterComponent()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLRegisterComponent()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateComponentPrivilege()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateComponentPrivilege()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropComponentPrivilege()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropComponentPrivilege()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLGrantComponentPrivilege()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLGrantComponentPrivilege()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLRevokeComponentPrivilege()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLRevokeComponentPrivilege()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLGiveAll()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLGiveAll()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLGiveObject()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLGiveObject()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLGiveSchema()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLGiveSchema()) { isPrivilegeMngt = TRUE; } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLGrant()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLGrant()) { isTable_ = TRUE; isPrivilegeMngt = TRUE; @@ -4138,7 +4142,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLGrant()-> getGrantNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLRevoke()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLRevoke()) { isTable_ = TRUE; isPrivilegeMngt = TRUE; @@ -4146,59 +4150,59 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) getDDLNode()->castToStmtDDLNode()->castToStmtDDLRevoke()-> getRevokeNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropSchema()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()) { isDropSchema = TRUE; qualObjName_ = QualifiedName(NAString("dummy"), - getExprNode()->castToElemDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getSchemaName(), - getExprNode()->castToElemDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getCatalogName()); + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getSchemaName(), + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getCatalogName()); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSchema()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSchema()) { isCreateSchema = TRUE; qualObjName_ = QualifiedName(NAString("dummy"), - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getSchemaName(), - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getCatalogName()); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getSchemaName(), + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getCatalogName()); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateLibrary()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateLibrary()) { isCreate_ = TRUE; isLibrary_ = TRUE; - qualObjName_ = getExprNode()->castToElemDDLNode()-> + qualObjName_ = getExprNode()->castToStmtDDLNode()-> castToStmtDDLCreateLibrary()->getLibraryNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropLibrary()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropLibrary()) { isDrop_ = TRUE; isLibrary_ = TRUE; - qualObjName_ = getExprNode()->castToElemDDLNode()-> + qualObjName_ = getExprNode()->castToStmtDDLNode()-> castToStmtDDLDropLibrary()->getLibraryNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateRoutine()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateRoutine()) { isCreate_ = TRUE; isRoutine_ = TRUE; - qualObjName_ = getExprNode()->castToElemDDLNode()-> + qualObjName_ = getExprNode()->castToStmtDDLNode()-> castToStmtDDLCreateRoutine()->getRoutineNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLDropRoutine()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLDropRoutine()) { isDrop_ = TRUE; isRoutine_ = TRUE; - qualObjName_ = getExprNode()->castToElemDDLNode()-> + qualObjName_ = getExprNode()->castToStmtDDLNode()-> castToStmtDDLDropRoutine()->getRoutineNameAsQualifiedName(); } - else if (getExprNode()->castToElemDDLNode()->castToStmtDDLCleanupObjects()) + else if (getExprNode()->castToStmtDDLNode()->castToStmtDDLCleanupObjects()) { isCleanup_ = TRUE; if (NOT Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)) hbaseDDLNoUserXn_ = TRUE; returnStatus_ = - getExprNode()->castToElemDDLNode()->castToStmtDDLCleanupObjects()->getStatus(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCleanupObjects()->getStatus(); } if ((isCreateSchema || isDropSchema) || @@ -4229,7 +4233,8 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA) // if a user ddl operation, it cannot run under a user transaction. // If an internal ddl request, like a CREATE internally issued onbehalf // of a CREATE LIKE, then allow it to run under a user Xn. - if (NOT Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL)) + if ((NOT getExprNode()->castToStmtDDLNode()->ddlXns()) && + (NOT Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL))) hbaseDDLNoUserXn_ = TRUE; } else if (isAuth || isPrivilegeMngt || isCleanup_) @@ -4320,8 +4325,8 @@ RelExpr * ExeUtilProcessVolatileTable::bindNode(BindWA *bindWA) volTabName_ = QualifiedName(NAString("dummy"), - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getSchemaName(), - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getCatalogName()); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getSchemaName(), + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateSchema()->getSchemaNameAsQualifiedName().getCatalogName()); } else if (getDDLNode()->castToStmtDDLNode() && getDDLNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()) @@ -4331,8 +4336,8 @@ RelExpr * ExeUtilProcessVolatileTable::bindNode(BindWA *bindWA) volTabName_ = QualifiedName(NAString("dummy"), - getExprNode()->castToElemDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getSchemaName(), - getExprNode()->castToElemDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getCatalogName()); + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getSchemaName(), + getExprNode()->castToStmtDDLNode()->castToStmtDDLDropSchema()->getSchemaNameAsQualifiedName().getCatalogName()); } RelExpr * boundExpr = DDLExpr::bindNode(bindWA); @@ -4463,10 +4468,10 @@ RelExpr * ExeUtilCreateTableAs::bindNode(BindWA *bindWA) NAWcharBuf* wcbuf = 0; if ((getExprNode()) && - (getExprNode()->castToElemDDLNode()) && - (getExprNode()->castToElemDDLNode()->castToStmtDDLCreateTable())) + (getExprNode()->castToStmtDDLNode()) && + (getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateTable())) createTableNode = - getExprNode()->castToElemDDLNode()->castToStmtDDLCreateTable(); + getExprNode()->castToStmtDDLNode()->castToStmtDDLCreateTable(); CorrName savedTableName = getTableName(); RelExpr * boundExpr = ExeUtilExpr::bindNode(bindWA);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/optimizer/RelExeUtil.h ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/RelExeUtil.h b/core/sql/optimizer/RelExeUtil.h index 41c8af7..21a771e 100644 --- a/core/sql/optimizer/RelExeUtil.h +++ b/core/sql/optimizer/RelExeUtil.h @@ -99,9 +99,14 @@ public: ValueIdSet &pulledNewInputs); virtual short codeGen(Generator*); + // no return from this method, the atp and atpindex is changed to + // returned atp (= 0) and returned atp index (last entry of returnedDesc). + // If noAtpOrIndexChange flag is set, then they are not changed. short processOutputRow(Generator * generator, - const Int32 work_atp, const Int32 output_row_atp_index, - ex_cri_desc * returnedDesc); + const Int32 work_atp, + const Int32 output_row_atp_index, + ex_cri_desc * returnedDesc, + NABoolean noAtpOrIndexChange = FALSE); // The set of values that I can potentially produce as output. virtual void getPotentialOutputValues(ValueIdSet & vs) const; @@ -197,6 +202,14 @@ public: // ----------------------------------------------------------------------- class DDLExpr : public GenericUtilExpr { + void setDDLXns(NABoolean v) + { + if (v) + ddlXns_ = (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_ON); + else + ddlXns_ = FALSE; + } + public: DDLExpr(ExprNode * ddlNode, char * ddlStmtText, @@ -234,6 +247,8 @@ public: { if (explObjName) explObjName_ = *explObjName; + + setDDLXns(TRUE); }; DDLExpr(NABoolean initHbase, NABoolean dropHbase, @@ -273,6 +288,8 @@ public: if (dropMDviews) setDropMDViews(TRUE); + + setDDLXns(TRUE); }; DDLExpr(NABoolean purgedataHbase, @@ -306,6 +323,8 @@ public: { purgedataTableName_ = purgedataTableName; qualObjName_ = purgedataTableName.getQualifiedNameObj(); + + setDDLXns(TRUE); }; virtual RelExpr * copyTopNode(RelExpr *derivedNode = NULL, @@ -402,6 +421,8 @@ public: {(v ? flags_ |= CLEANUP_AUTH : flags_ &= ~CLEANUP_AUTH); } NABoolean cleanupAuth() { return (flags_ & CLEANUP_AUTH) != 0;} + NABoolean ddlXns() { return ddlXns_; } + protected: enum Flags { @@ -472,6 +493,11 @@ public: NABoolean returnStatus_; UInt32 flags_; + + // if TRUE, ddl transactions are enabled. Actual operation may + // run under one transaction or multiple transactions. + // Details in sqlcomp/CmpSeabaseDDL*.cpp. + NABoolean ddlXns_; }; // ----------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/parser/SqlParserAux.cpp ---------------------------------------------------------------------- diff --git a/core/sql/parser/SqlParserAux.cpp b/core/sql/parser/SqlParserAux.cpp index 6b2ac29..3f8976c 100644 --- a/core/sql/parser/SqlParserAux.cpp +++ b/core/sql/parser/SqlParserAux.cpp @@ -1249,7 +1249,7 @@ ItemExpr *literalOfDate(NAString *strptr, NABoolean noDealloc) ItemExpr *literalOfTime(NAString *strptr) { ItemExpr *returnValue = NULL; - UInt32 fractionPrec; + UInt32 fractionPrec = 0; DatetimeValue dtValue(*strptr, REC_DATE_HOUR, REC_DATE_SECOND, fractionPrec, (CmpCommon::getDefault(USE_OLD_DT_CONSTRUCTOR) == DF_ON)); if ((! dtValue.isValid()) && http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/parser/StmtDDLAlter.cpp ---------------------------------------------------------------------- diff --git a/core/sql/parser/StmtDDLAlter.cpp b/core/sql/parser/StmtDDLAlter.cpp index b599ae7..bab9829 100644 --- a/core/sql/parser/StmtDDLAlter.cpp +++ b/core/sql/parser/StmtDDLAlter.cpp @@ -1971,6 +1971,17 @@ StmtDDLAlterTableAddColumn::synthesize() theColumn->traverseList( this, StmtDDLAlterTableAddColumn_visit); + + ElemDDLColDefArray ColDefArray = getColDefArray(); + ElemDDLColDef *pColDef = ColDefArray[0]; + if (NOT pColDef->getColumnFamily().isNull()) + { + //TEMPTEMP + // Currently, DTM doesnt handle add columns with an explicit + // column family as a transactional operation. + // Do not use ddl xns until that bug is fixed. + setDdlXns(FALSE); + } } } //StmtDDLAlterTableAddColumn::synthesize() http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/parser/StmtDDLNode.cpp ---------------------------------------------------------------------- diff --git a/core/sql/parser/StmtDDLNode.cpp b/core/sql/parser/StmtDDLNode.cpp index fdb0368..eab9ea2 100644 --- a/core/sql/parser/StmtDDLNode.cpp +++ b/core/sql/parser/StmtDDLNode.cpp @@ -60,6 +60,20 @@ StmtDDLInitializeSQL_visitRegisterUserElement(ElemDDLNode * pInitSQLNode, // member functions for class StmtDDLNode // ----------------------------------------------------------------------- +StmtDDLNode::StmtDDLNode(OperatorTypeEnum otype) + : ElemDDLNode(otype), + tableType_(COM_REGULAR_TABLE), + objectClass_(COM_CLASS_USER_TABLE), + isVolatile_(FALSE), + exeUtil_(FALSE), + isGhostObject_(FALSE), + inMemoryObjectDefn_(FALSE), + isExternal_(FALSE), + ddlXns_(FALSE) +{ + ddlXns_ = (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_ON); +} + // virtual destructor // To improve performance, do not use inline with virtual destructor StmtDDLNode::~StmtDDLNode() http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/parser/StmtDDLNode.h ---------------------------------------------------------------------- diff --git a/core/sql/parser/StmtDDLNode.h b/core/sql/parser/StmtDDLNode.h index a2928c1..8a1d479 100644 --- a/core/sql/parser/StmtDDLNode.h +++ b/core/sql/parser/StmtDDLNode.h @@ -62,16 +62,7 @@ class StmtDDLNode : public ElemDDLNode public: // default constructor - StmtDDLNode(OperatorTypeEnum otype = DDL_ANY_STMT) - : ElemDDLNode(otype), - tableType_(COM_REGULAR_TABLE), - objectClass_(COM_CLASS_USER_TABLE), - isVolatile_(FALSE), - exeUtil_(FALSE), - isGhostObject_(FALSE), - inMemoryObjectDefn_(FALSE), - isExternal_(FALSE) - { } + StmtDDLNode(OperatorTypeEnum otype = DDL_ANY_STMT); // virtual destructor virtual ~StmtDDLNode(); @@ -132,6 +123,8 @@ public: virtual NABoolean explainSupported() { return FALSE; } + NABoolean ddlXns() { return ddlXns_; } + void setDdlXns(NABoolean v) { ddlXns_ = v; } private: ComTableType tableType_; @@ -155,6 +148,8 @@ private: // if this DDL operation was specified using EXTERNAL syntax. NABoolean isExternal_; + // if TRUE, this ddl operation will run using DTM transactions + NABoolean ddlXns_; }; // class StmtDDLNode // ----------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/core/DIFF116.KNOWN.SB ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/DIFF116.KNOWN.SB b/core/sql/regress/core/DIFF116.KNOWN.SB new file mode 100644 index 0000000..7db919b --- /dev/null +++ b/core/sql/regress/core/DIFF116.KNOWN.SB @@ -0,0 +1,21 @@ +467c467,469 +< --- SQL operation complete. +--- +> *** ERROR[8606] Transaction subsystem TMF returned error 73 on a commit transaction. +> +> --- SQL operation failed with errors. +470,471c472 +< -- Definition of table #CAT.#SCH.T116T1 +< -- Definition current +--- +> *** ERROR[4254] Object #CAT.#SCH.T116T1 has invalid state and cannot be accessed. Use cleanup command to drop it. +473,475c474 +< ( +< A INT NO DEFAULT NOT NULL NOT DROPPABLE +< ) +--- +> *** ERROR[4082] Object #CAT.#SCH.T116T1 does not exist or is inaccessible. +477c476 +< --- SQL operation complete. +--- +> --- SQL operation failed with errors. http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/core/EXPECTED056.SB ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/EXPECTED056.SB b/core/sql/regress/core/EXPECTED056.SB index 4ddfcd4..a2bd39e 100755 --- a/core/sql/regress/core/EXPECTED056.SB +++ b/core/sql/regress/core/EXPECTED056.SB @@ -1,14 +1,14 @@ >>obey TEST056(tests1); >>showddl T056t10; -CREATE TABLE SEABASE.SCH.T056T10 +CREATE TABLE TRAFODION.SCH.T056T10 ( SWALLOW INT DEFAULT 121 NOT NULL NOT DROPPABLE , BARNOWL INT DEFAULT 1000 NOT NULL NOT DROPPABLE ) ; -CREATE UNIQUE INDEX T056IN5 ON SEABASE.SCH.T056T10 +CREATE UNIQUE INDEX T056IN5 ON TRAFODION.SCH.T056T10 ( BARNOWL ASC ) @@ -22,7 +22,7 @@ CREATE UNIQUE INDEX T056IN5 ON SEABASE.SCH.T056T10 >>--showlabel index T056in5,detail; >>showddl T056t11; -CREATE TABLE SEABASE.SCH.T056T11 +CREATE TABLE TRAFODION.SCH.T056T11 ( WREN INT NO DEFAULT NOT NULL NOT DROPPABLE , JUNCO INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -31,7 +31,7 @@ CREATE TABLE SEABASE.SCH.T056T11 ) ; -CREATE UNIQUE INDEX T056IN6 ON SEABASE.SCH.T056T11 +CREATE UNIQUE INDEX T056IN6 ON TRAFODION.SCH.T056T11 ( BLACKBIRD ASC ) @@ -102,7 +102,7 @@ CREATE UNIQUE INDEX T056IN6 ON SEABASE.SCH.T056T11 >> >>showddl T056t10; -CREATE TABLE SEABASE.SCH.T056T10 +CREATE TABLE TRAFODION.SCH.T056T10 ( SWALLOW INT DEFAULT 121 NOT NULL NOT DROPPABLE , BARNOWL INT DEFAULT 1000 NOT NULL NOT DROPPABLE @@ -135,7 +135,7 @@ ALTER TABLE TRAFODION.SCH.T056T10 ADD CONSTRAINT TRAFODION.SCH.DUCK_PK UNIQUE --- SQL operation complete. >>showddl T056t11; -CREATE TABLE SEABASE.SCH.T056T11 +CREATE TABLE TRAFODION.SCH.T056T11 ( WREN INT NO DEFAULT NOT NULL NOT DROPPABLE , JUNCO INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -185,10 +185,10 @@ ALTER TABLE TRAFODION.SCH.T056T11 ADD CONSTRAINT TRAFODION.SCH.T056T11_CK >>#ifMX >>showddl T056vw12; -CREATE VIEW SEABASE.SCH.T056VW12 AS - SELECT SEABASE.SCH.T056T10.DUCK, SEABASE.SCH.T056T11.RAVEN, - SEABASE.SCH.T056T10.SWALLOW, SEABASE.SCH.T056T11.WREN FROM - SEABASE.SCH.T056T10, SEABASE.SCH.T056T11 ; +CREATE VIEW TRAFODION.SCH.T056VW12 AS + SELECT TRAFODION.SCH.T056T10.DUCK, TRAFODION.SCH.T056T11.RAVEN, + TRAFODION.SCH.T056T10.SWALLOW, TRAFODION.SCH.T056T11.WREN FROM + TRAFODION.SCH.T056T10, TRAFODION.SCH.T056T11 ; --- SQL operation complete. >>#ifMX @@ -1127,7 +1127,6 @@ ORDERS SmallInt VCH1 VCH2 --- 14 row(s) selected. >> ->>--#ifndef SEABASE_REGRESS >>begin work; --- SQL operation complete. @@ -1149,10 +1148,17 @@ ORDERS SmallInt VCH1 VCH2 >> >>alter table T056t34 add vch3 varchar(3) default 'neo'; -*** ERROR[20123] A user-defined transaction has been started. This DDL operation cannot be performed. +--- SQL operation complete. +>> +>>update T056t34 set vch3 = 'new' where vch1 = 'v'; ---- SQL operation failed with errors. +--- 1 row(s) updated. >> +>>rollback; + +--- SQL operation complete. +>> +>>-- this should return error. Col vch3 will be removed as part of rollback. >>update T056t34 set vch3 = 'new' where vch1 = 'v'; *** ERROR[4001] Column VCH3 is not found. Tables in scope: TRAFODION.SCH.T056T34. Default schema: TRAFODION.SCH. @@ -1160,11 +1166,6 @@ ORDERS SmallInt VCH1 VCH2 *** ERROR[8822] The statement was not prepared. >> ->>rollback; - ---- SQL operation complete. ->>--#endif ->> >>delete from T056t34 where orders > 2 and orders < 12 +> or orders = 51; @@ -2030,7 +2031,7 @@ T056T56_COL T056T56_COL2 T056T56_COL3 T056T56_COL4 --- SQL operation complete. >>showddl t056t57; -CREATE TABLE SEABASE.SCH.T056T57 +CREATE TABLE TRAFODION.SCH.T056T57 ( A1 NUMERIC(2, 2) DEFAULT 0 NOT NULL NOT DROPPABLE @@ -2055,7 +2056,7 @@ A1 --- SQL operation complete. >>showddl t056t58; -CREATE TABLE SEABASE.SCH.T056T58 +CREATE TABLE TRAFODION.SCH.T056T58 ( A1 DECIMAL(4, 4) DEFAULT -0.0000 NOT NULL NOT DROPPABLE @@ -2080,7 +2081,7 @@ A1 --- SQL operation complete. >>showddl t056t59; -CREATE TABLE SEABASE.SCH.T056T59 +CREATE TABLE TRAFODION.SCH.T056T59 ( A1 DECIMAL(3, 3) DEFAULT -0000.12 NOT NULL NOT DROPPABLE @@ -2105,7 +2106,7 @@ A1 --- SQL operation complete. >>showddl t056t60; -CREATE TABLE SEABASE.SCH.T056T60 +CREATE TABLE TRAFODION.SCH.T056T60 ( A1 NUMERIC(2, 2) UNSIGNED DEFAULT 0.00 NOT NULL NOT DROPPABLE @@ -2130,7 +2131,7 @@ A1 --- SQL operation complete. >>showddl t056t61; -CREATE TABLE SEABASE.SCH.T056T61 +CREATE TABLE TRAFODION.SCH.T056T61 ( A1 NUMERIC(2, 2) DEFAULT -0.0 NOT NULL NOT DROPPABLE @@ -2918,7 +2919,7 @@ I VCH1 VCH2 VCH3 >>obey test056(test6NullVarchar); >>drop table t056t64; -*** ERROR[1389] Object SEABASE.SCH.T056T64 does not exist in SeaBase. +*** ERROR[1389] Object TRAFODION.SCH.T056T64 does not exist in Trafodion. --- SQL operation failed with errors. >>create table t056t64 http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/core/EXPECTED116 ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116 index ec5d614..5a36506 100644 --- a/core/sql/regress/core/EXPECTED116 +++ b/core/sql/regress/core/EXPECTED116 @@ -1,6 +1,3 @@ ->>set parserflags 131072; - ---- SQL operation complete. >>control query default DDL_TRANSACTIONS 'ON'; --- SQL operation complete. @@ -16,45 +13,26 @@ >>create table t116t2(a2 int, c2 int, b2 char(6)); --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does exist -0 row(s) in 1.2310 seconds +TRAFODION.SCH.T116T1 ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.2080 seconds +TRAFODION.SCH.T116T2 +--- SQL operation complete. +>> >>rollback work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does not exist -0 row(s) in 1.2200 seconds +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does not exist -0 row(s) in 1.2600 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +--- SQL operation complete. >> >>--repeat the same tables again >>------------------------------ @@ -67,45 +45,25 @@ Table TRAFODION.SCH.T116T2 does not exist >>create table t116t2(a2 int, c2 int, b2 char(6)); --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does exist -0 row(s) in 1.2480 seconds +TRAFODION.SCH.T116T1 ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.1770 seconds +TRAFODION.SCH.T116T2 +--- SQL operation complete. >>rollback work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does not exist -0 row(s) in 1.1770 seconds - ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does not exist -0 row(s) in 1.1750 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +--- SQL operation complete. >> >>-- unique constraint >>--------------------- @@ -118,45 +76,25 @@ Table TRAFODION.SCH.T116T2 does not exist >>alter table t116t1 add constraint tc1 unique (c1); --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does exist -0 row(s) in 1.2840 seconds +TRAFODION.SCH.T116T1 ->>sh `echo "exists '$TEST_SCHEMA.TC1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.TC1'; -exists 'TRAFODION.SCH.TC1' -Table TRAFODION.SCH.TC1 does exist -0 row(s) in 1.1420 seconds +TRAFODION.SCH.TC1 +--- SQL operation complete. >>rollback work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does not exist -0 row(s) in 1.2250 seconds - ->>sh `echo "exists '$TEST_SCHEMA.TC1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.TC1' -Table TRAFODION.SCH.TC1 does not exist -0 row(s) in 1.3010 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.TC1'; +--- SQL operation complete. >> >>--setup two tables >>------------------- @@ -181,15 +119,11 @@ Table TRAFODION.SCH.TC1 does not exist >> >>--drop table simple case >>-------------------------- ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does exist -0 row(s) in 1.1350 seconds +TRAFODION.SCH.T116T1 +--- SQL operation complete. >>begin work; --- SQL operation complete. @@ -199,27 +133,18 @@ Table TRAFODION.SCH.T116T1 does exist >>commit work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T1' -Table TRAFODION.SCH.T116T1 does not exist -0 row(s) in 1.1660 seconds +>>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +--- SQL operation complete. >> >>--drop table with rollback >>---------------------------- ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>--sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.2350 seconds +TRAFODION.SCH.T116T2 +--- SQL operation complete. >>begin work; --- SQL operation complete. @@ -250,27 +175,19 @@ A1 C1 B1 *** ERROR[8822] The statement was not prepared. ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.2070 seconds +TRAFODION.SCH.T116T2 +--- SQL operation complete. >>rollback work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.2070 seconds +TRAFODION.SCH.T116T2 +--- SQL operation complete. >>select * from t116t2; A1 C1 B1 @@ -294,24 +211,14 @@ A1 C1 B1 >> >>--create table1 with dml, drop table2 >>------------------------------------- ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.1940 seconds +TRAFODION.SCH.T116T2 ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does not exist -0 row(s) in 1.2370 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +--- SQL operation complete. >>begin work; --- SQL operation complete. @@ -321,69 +228,41 @@ Table TRAFODION.SCH.T116T3 does not exist >>insert into t116t3 values(2,2,'b'); --- 1 row(s) inserted. ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does exist -0 row(s) in 1.2660 seconds +TRAFODION.SCH.T116T2 ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.1690 seconds +TRAFODION.SCH.T116T3 +--- SQL operation complete. >>drop table t116t2; --- SQL operation complete. >>commit work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T2'; -exists 'TRAFODION.SCH.T116T2' -Table TRAFODION.SCH.T116T2 does not exist -0 row(s) in 1.2380 seconds - ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.2930 seconds +TRAFODION.SCH.T116T3 +--- SQL operation complete. >> >>--create table1 with dml , drop table2 and rollback >>--------------------------------------------------- ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.2740 seconds +TRAFODION.SCH.T116T3 ->>sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T4' -Table TRAFODION.SCH.T116T4 does not exist -0 row(s) in 1.1730 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T4'; +--- SQL operation complete. >>begin work; --- SQL operation complete. @@ -393,24 +272,16 @@ Table TRAFODION.SCH.T116T4 does not exist >>insert into t116t4 values(2,2,'b'); --- 1 row(s) inserted. ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.1590 seconds +TRAFODION.SCH.T116T3 ->>sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T4'; -exists 'TRAFODION.SCH.T116T4' -Table TRAFODION.SCH.T116T4 does exist -0 row(s) in 1.2290 seconds +TRAFODION.SCH.T116T4 +--- SQL operation complete. >>select * from t116t3; A1 C1 B1 @@ -428,36 +299,22 @@ A1 C1 B1 *** ERROR[8822] The statement was not prepared. ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.3560 seconds +TRAFODION.SCH.T116T3 +--- SQL operation complete. >>rollback work; --- SQL operation complete. ->>sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 - -exists 'TRAFODION.SCH.T116T3' -Table TRAFODION.SCH.T116T3 does exist -0 row(s) in 1.2320 seconds +>>get user hbase objects, match 'TRAFODION.SCH.T116T3'; ->>sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; -HBase Shell; enter 'help<RETURN>' for list of supported commands. -Type "exit<RETURN>" to leave the HBase Shell -Version 0.98.6-cdh5.3.0, rUnknown, Tue Dec 16 19:18:44 PST 2014 +TRAFODION.SCH.T116T3 -exists 'TRAFODION.SCH.T116T4' -Table TRAFODION.SCH.T116T4 does not exist -0 row(s) in 1.2680 seconds +--- SQL operation complete. +>>get user hbase objects, match 'TRAFODION.SCH.T116T4'; +--- SQL operation complete. >>select * from t116t3; A1 C1 B1 @@ -470,5 +327,242 @@ A1 C1 B1 --- 1 row(s) inserted. >> +>>-- tests to validate ddl definitions are correctly loaded +>>drop table if exists t116t1; + +--- SQL operation complete. +>>create table t116t1(a int not null, b varchar(2), ++> c varchar(4) character set utf8 not null); + +--- SQL operation complete. +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:04:39 2016 + + ( + A INT NO DEFAULT NOT NULL NOT DROPPABLE + , B VARCHAR(2) CHARACTER SET ISO88591 COLLATE + DEFAULT DEFAULT NULL + , C VARCHAR(4 CHARS) CHARACTER SET UTF8 + COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE + ) + +--- SQL operation complete. +>>begin work; + +--- SQL operation complete. +>>alter table t116t1 alter column b varchar(3); + +--- SQL operation complete. +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:04:40 2016 + + ( + A INT NO DEFAULT NOT NULL NOT DROPPABLE + , B VARCHAR(3) CHARACTER SET ISO88591 COLLATE + DEFAULT DEFAULT NULL + , C VARCHAR(4 CHARS) CHARACTER SET UTF8 + COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE + ) + +--- SQL operation complete. +>>commit work; + +--- SQL operation complete. +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:04:51 2016 + + ( + A INT NO DEFAULT NOT NULL NOT DROPPABLE + , B VARCHAR(3) CHARACTER SET ISO88591 COLLATE + DEFAULT DEFAULT NULL + , C VARCHAR(4 CHARS) CHARACTER SET UTF8 + COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE + ) + +--- SQL operation complete. +>> +>>begin work; + +--- SQL operation complete. +>>alter table t116t1 alter column b varchar(4); + +--- SQL operation complete. +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:04:52 2016 + + ( + A INT NO DEFAULT NOT NULL NOT DROPPABLE + , B VARCHAR(4) CHARACTER SET ISO88591 COLLATE + DEFAULT DEFAULT NULL + , C VARCHAR(4 CHARS) CHARACTER SET UTF8 + COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE + ) + +--- SQL operation complete. +>>rollback work; + +--- SQL operation complete. +>> +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:05:01 2016 + + ( + A INT NO DEFAULT NOT NULL NOT DROPPABLE + , B VARCHAR(3) CHARACTER SET ISO88591 COLLATE + DEFAULT DEFAULT NULL + , C VARCHAR(4 CHARS) CHARACTER SET UTF8 + COLLATE DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE + ) + +--- SQL operation complete. +>> +>>-- concurrent ddl operations +>>drop table if exists t116t1; + +--- SQL operation complete. +>>begin work; + +--- SQL operation complete. +>>create table t116t1 (a int); + +--- SQL operation complete. +>> +>>sh sqlci -iTEST116\(concurrent_ddl\) >> LOG116; +Apache Trafodion Conversational Interface 2.0.0 +Copyright (c) 2015 Apache Software Foundation +>>?section concurrent_ddl +>>cqd ddl_transactions 'ON'; + +--- SQL operation complete. +>>begin work; + +--- SQL operation complete. +>> +>>-- should fail +>>create table t116t1 (a int); + +*** ERROR[1431] Object TRAFODION.SCH.T116T1 exists in HBase. This could be due to a concurrent transactional ddl operation in progress on this table. + +*** ERROR[8839] Transaction was aborted. + +--- SQL operation failed with errors. +>>commit work; + +*** ERROR[8605] Committing a transaction which has not started. + +--- SQL operation failed with errors. +>>exit; + +End of MXCI Session + +>> +>>commit work; + +--- SQL operation complete. +>>invoke t116t1; + +-- Definition of Trafodion table TRAFODION.SCH.T116T1 +-- Definition current Mon Feb 15 16:05:22 2016 + + ( + A INT DEFAULT NULL + ) + +--- SQL operation complete. +>>cleanup table t116t1; + +--- SQL operation complete. +>> +>>-- test table/schema drops and get stmts with read uncommitted access +>>create schema if not exists t116sch1; + +--- SQL operation complete. +>>set schema t116sch1; + +--- SQL operation complete. +>>drop table if exists t116t1; + +--- SQL operation complete. +>>drop table if exists t116t2; + +--- SQL operation complete. +>> +>>create table t116t1 (a int); + +--- SQL operation complete. +>>begin work; + +--- SQL operation complete. +>>get tables in schema t116sch1, match 'T116T1'; + +Tables in Schema TRAFODION.T116SCH1 +=================================== + +T116T1 + +--- SQL operation complete. +>>drop table t116t1; + +--- SQL operation complete. +>>get tables in schema t116sch1; + +Tables in Schema TRAFODION.T116SCH1 +=================================== + +SB_HISTOGRAMS +SB_HISTOGRAM_INTERVALS + +--- SQL operation complete. +>>create table t116t2 (a int); + +--- SQL operation complete. +>>get tables in schema t116sch1; + +Tables in Schema TRAFODION.T116SCH1 +=================================== + +SB_HISTOGRAMS +SB_HISTOGRAM_INTERVALS +T116T2 + +--- SQL operation complete. +>>drop schema t116sch1 cascade; + +--- SQL operation complete. +>>get tables in schema t116sch1; + +--- SQL operation complete. +>>select count(*) from "_MD_".objects where schema_name = 'T116SCH1' ++> for read uncommitted access; + +(EXPR) +-------------------- + + 0 + +--- 1 row(s) selected. +>>rollback work; + +--- SQL operation complete. +>>get tables in schema t116sch1; + +Tables in Schema TRAFODION.T116SCH1 +=================================== + +SB_HISTOGRAMS +SB_HISTOGRAM_INTERVALS +T116T1 + +--- SQL operation complete. >> >>log; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/core/TEST056 ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/TEST056 b/core/sql/regress/core/TEST056 index 823f66e..8629a17 100755 --- a/core/sql/regress/core/TEST056 +++ b/core/sql/regress/core/TEST056 @@ -477,7 +477,6 @@ update T056t34 set sma1 = 99 where vch2 like '%vch2'; select orders, sma1, vch1, vch2 from T056t34; ---#ifndef SEABASE_REGRESS begin work; update T056t34 set vch1 = 'v' where num1 > 10; @@ -494,7 +493,9 @@ alter table T056t34 add vch3 varchar(3) default 'neo'; update T056t34 set vch3 = 'new' where vch1 = 'v'; rollback; ---#endif + +-- this should return error. Col vch3 will be removed as part of rollback. +update T056t34 set vch3 = 'new' where vch1 = 'v'; delete from T056t34 where orders > 2 and orders < 12 or orders = 51; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/core/TEST116 ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/TEST116 b/core/sql/regress/core/TEST116 index 4d33130..9d04754 100755 --- a/core/sql/regress/core/TEST116 +++ b/core/sql/regress/core/TEST116 @@ -25,9 +25,6 @@ -- This test requires the ENV variable TM_ENABLE_DDL_TRANS -- is enabled in ms.env and environment restarted. -- Also DDL_TRANSACTIONS CQD must be 'ON'. --- This test is not enabled in the regression test suite --- by default. This test will be enabled default once the --- ENV variable is disabled for good. -- Expected Files: EXPECTED116 @@ -39,7 +36,6 @@ drop table t116t3; log LOG116 clear; -set parserflags 131072; control query default DDL_TRANSACTIONS 'ON'; -- Simple create then rollback @@ -47,33 +43,34 @@ control query default DDL_TRANSACTIONS 'ON'; begin work; create table t116t1(a1 int, c1 int, b1 char(6)); create table t116t2(a2 int, c2 int, b2 char(6)); -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; + rollback work; -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; --repeat the same tables again ------------------------------ begin work; create table t116t1(a1 int, c1 int, b1 char(6)); create table t116t2(a2 int, c2 int, b2 char(6)); -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; rollback work; -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; -- unique constraint --------------------- begin work; create table t116t1(a1 int, c1 int, b1 char(6)); alter table t116t1 add constraint tc1 unique (c1); -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.TC1'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.TC1'; rollback work; -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.TC1'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; +get user hbase objects, match 'TRAFODION.SCH.TC1'; --setup two tables ------------------- @@ -86,60 +83,118 @@ commit work; --drop table simple case -------------------------- -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; begin work; drop table t116t1; commit work; -sh `echo "exists '$TEST_SCHEMA.T116T1'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T1'; --drop table with rollback ---------------------------- -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +--sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; begin work; insert into t116t2 values(3,3,'c'); select * from t116t2; drop table t116t2; insert into t116t2 values(1,1,'a'); select * from t116t2; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; rollback work; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; select * from t116t2; insert into t116t2 values(1,1,'a'); select * from t116t2; --create table1 with dml, drop table2 ------------------------------------- -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; begin work; create table t116t3(a1 int, c1 int, b1 char(6)); insert into t116t3 values(2,2,'b'); -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; drop table t116t2; commit work; -sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T2'; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; --create table1 with dml , drop table2 and rollback --------------------------------------------------- -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; +get user hbase objects, match 'TRAFODION.SCH.T116T4'; begin work; create table t116t4(a1 int, c1 int, b1 char(6)); insert into t116t4 values(2,2,'b'); -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; +get user hbase objects, match 'TRAFODION.SCH.T116T4'; select * from t116t3; drop table t116t3; insert into t116t3 values(2,2,'b'); -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; rollback work; -sh `echo "exists '$TEST_SCHEMA.T116T3'" | regrhbase.ksh >> LOG116`; -sh `echo "exists '$TEST_SCHEMA.T116T4'" | regrhbase.ksh >> LOG116`; +get user hbase objects, match 'TRAFODION.SCH.T116T3'; +get user hbase objects, match 'TRAFODION.SCH.T116T4'; select * from t116t3; insert into t116t3 values(2,2,'b'); +-- tests to validate ddl definitions are correctly loaded +drop table if exists t116t1; +create table t116t1(a int not null, b varchar(2), + c varchar(4) character set utf8 not null); +invoke t116t1; +begin work; +alter table t116t1 alter column b varchar(3); +invoke t116t1; +commit work; +invoke t116t1; + +begin work; +alter table t116t1 alter column b varchar(4); +invoke t116t1; +rollback work; + +invoke t116t1; + +-- concurrent ddl operations +drop table if exists t116t1; +begin work; +create table t116t1 (a int); + +sh sqlci -iTEST116\(concurrent_ddl\) >> LOG116; + +commit work; +invoke t116t1; +cleanup table t116t1; + +-- test table/schema drops and get stmts with read uncommitted access +create schema if not exists t116sch1; +set schema t116sch1; +drop table if exists t116t1; +drop table if exists t116t2; + +create table t116t1 (a int); +begin work; +get tables in schema t116sch1, match 'T116T1'; +drop table t116t1; +get tables in schema t116sch1; +create table t116t2 (a int); +get tables in schema t116sch1; +drop schema t116sch1 cascade; +get tables in schema t116sch1; +select count(*) from "_MD_".objects where schema_name = 'T116SCH1' + for read uncommitted access; +rollback work; +get tables in schema t116sch1; log; +exit; + +?section concurrent_ddl +cqd ddl_transactions 'ON'; +begin work; + +-- should fail +create table t116t1 (a int); +commit work; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/executor/EXPECTED013.SB ---------------------------------------------------------------------- diff --git a/core/sql/regress/executor/EXPECTED013.SB b/core/sql/regress/executor/EXPECTED013.SB index e4faaec..258eee4 100644 --- a/core/sql/regress/executor/EXPECTED013.SB +++ b/core/sql/regress/executor/EXPECTED013.SB @@ -21,7 +21,7 @@ >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:44:37 2016 +-- Definition current Fri Feb 12 07:43:19 2016 ( A INT DEFAULT NULL @@ -49,7 +49,7 @@ A >>invoke t013t1; -- Definition of Trafodion volatile table T013T1 --- Definition current Sat Jan 23 02:44:54 2016 +-- Definition current Fri Feb 12 07:43:35 2016 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -111,7 +111,7 @@ A >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:45:57 2016 +-- Definition current Fri Feb 12 07:44:30 2016 ( A INT DEFAULT NULL @@ -136,7 +136,7 @@ A >>invoke t013t1; -- Definition of Trafodion volatile table T013T1 --- Definition current Sat Jan 23 02:46:10 2016 +-- Definition current Fri Feb 12 07:44:46 2016 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -175,7 +175,7 @@ A B C >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:46:25 2016 +-- Definition current Fri Feb 12 07:44:57 2016 ( A INT DEFAULT NULL @@ -197,7 +197,7 @@ A >>invoke t013t1; -- Definition of Trafodion volatile table T013T1 --- Definition current Sat Jan 23 02:46:32 2016 +-- Definition current Fri Feb 12 07:45:04 2016 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -436,6 +436,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON HBASE_ASYNC_DROP_TABLE OFF POS OFF SCHEMA TRAFODION.T013_SCH @@ -448,7 +449,7 @@ CONTROL QUERY DEFAULT >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:47:38 2016 +-- Definition current Fri Feb 12 07:46:03 2016 ( A INT DEFAULT NULL @@ -468,7 +469,7 @@ CONTROL QUERY DEFAULT >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:47:43 2016 +-- Definition current Fri Feb 12 07:46:09 2016 ( A INT DEFAULT NULL @@ -559,7 +560,7 @@ control query shape nested_join(anything,anything); >>invoke t013t3; -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3 --- Definition current Sat Jan 23 02:48:28 2016 +-- Definition current Fri Feb 12 07:46:43 2016 ( A INT DEFAULT NULL @@ -576,7 +577,7 @@ control query shape nested_join(anything,anything); >>invoke t013t3; -- Definition of Trafodion volatile table T013T3 --- Definition current Sat Jan 23 02:48:35 2016 +-- Definition current Fri Feb 12 07:46:49 2016 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -591,7 +592,7 @@ control query shape nested_join(anything,anything); >>invoke t013t3; -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3 --- Definition current Sat Jan 23 02:48:47 2016 +-- Definition current Fri Feb 12 07:47:01 2016 ( A INT DEFAULT NULL @@ -656,7 +657,7 @@ CREATE VOLATILE TABLE T013T3 >>invoke t013t3; -- Definition of Trafodion table TRAFODION.T013SCH1.T013T3 --- Definition current Sat Jan 23 02:49:31 2016 +-- Definition current Fri Feb 12 07:47:39 2016 ( A INT DEFAULT NULL @@ -1277,7 +1278,7 @@ CREATE VOLATILE TABLE T013T1 >>invoke t013t1; -- Definition of Trafodion table TRAFODION.T013_SCH.T013T1 --- Definition current Sat Jan 23 02:55:57 2016 +-- Definition current Fri Feb 12 07:54:03 2016 ( A INT DEFAULT NULL http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/executor/EXPECTED140 ---------------------------------------------------------------------- diff --git a/core/sql/regress/executor/EXPECTED140 b/core/sql/regress/executor/EXPECTED140 index 1683c92..c82aabd 100644 --- a/core/sql/regress/executor/EXPECTED140 +++ b/core/sql/regress/executor/EXPECTED140 @@ -53,7 +53,7 @@ ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281519143599 +PLAN_ID .................. 212321974183907757 ROWS_OUT ................ 33 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select a from t140 where b>500; @@ -103,9 +103,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.A @@ -153,7 +154,7 @@ A ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281520763784 +PLAN_ID .................. 212321974185251743 ROWS_OUT ................ 33 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an from t140b where b<=200; @@ -203,9 +204,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313847 + ObjectUIDs ............. 7577396214768470287 select_list ............ TRAFODION.SCH.T140B.AN @@ -240,7 +242,7 @@ DESCRIPTION ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281520871425 +PLAN_ID .................. 212321974185404440 ROWS_OUT ................ 33 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an from t140 where b<=200; @@ -290,9 +292,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN @@ -338,7 +341,7 @@ AN ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281520990973 +PLAN_ID .................. 212321974185568983 ROWS_OUT ................ 10 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an from t140 where b=200 and an is not null; @@ -388,9 +391,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN input_variables ........ %(200) @@ -434,7 +438,7 @@ AN ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281521112920 +PLAN_ID .................. 212321974185775205 ROWS_OUT ................ 67 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an, a from t140 where b!=500; @@ -484,9 +488,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN, TRAFODION.SCH.T140.A @@ -566,7 +571,7 @@ AN ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281521342888 +PLAN_ID .................. 212321974185993581 ROWS_OUT ................ 10 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an from t140 where bn=201 and an is not null; @@ -616,9 +621,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN input_variables ........ %(201) @@ -661,7 +667,7 @@ AN ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281521467017 +PLAN_ID .................. 212321974186137176 ROWS_OUT ................ 67 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an, a from t140 where bn!=501; @@ -711,9 +717,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN, TRAFODION.SCH.T140.A @@ -808,7 +815,7 @@ A ------------------------------------------------------------------ PLAN SUMMARY MODULE_NAME .............. DYNAMICALLY COMPILED STATEMENT_NAME ........... NOT NAMED -PLAN_ID .................. 212320281521680638 +PLAN_ID .................. 212321974186325095 ROWS_OUT ................ 11 EST_TOTAL_COST ........... 0.05 STATEMENT ................ select an from t140 where an between 20 and 40; @@ -858,9 +865,10 @@ DESCRIPTION HBASE_FILTER_PREDS ..... 2 TRAF_ALIGNED_ROW_FORMAT OFF TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ....... ON SCHEMA ................. TRAFODION.SCH GENERATE_EXPLAIN ....... ON - ObjectUIDs ............. 5476465295937313773 + ObjectUIDs ............. 7577396214768470203 select_list ............ TRAFODION.SCH.T140.AN http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/fullstack2/EXPECTED062 ---------------------------------------------------------------------- diff --git a/core/sql/regress/fullstack2/EXPECTED062 b/core/sql/regress/fullstack2/EXPECTED062 index ca88f6d..4f2aa1f 100644 --- a/core/sql/regress/fullstack2/EXPECTED062 +++ b/core/sql/regress/fullstack2/EXPECTED062 @@ -501,6 +501,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON SCHEMA AAA.BBB CATALOG CCC @@ -545,6 +546,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON DEF_CHUNK_SIZE 1000 CPUCOST_DM_GET .001 @@ -580,6 +582,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON DEF_CHUNK_SIZE 1000 CPUCOST_DM_GET .001 http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/fullstack2/EXPECTED062.RELEASE ---------------------------------------------------------------------- diff --git a/core/sql/regress/fullstack2/EXPECTED062.RELEASE b/core/sql/regress/fullstack2/EXPECTED062.RELEASE index 4b48a87..d933dc7 100644 --- a/core/sql/regress/fullstack2/EXPECTED062.RELEASE +++ b/core/sql/regress/fullstack2/EXPECTED062.RELEASE @@ -501,6 +501,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON SCHEMA AAA.BBB CATALOG CCC @@ -545,6 +546,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON DEF_CHUNK_SIZE 1000 CPUCOST_DM_GET .001 @@ -580,6 +582,7 @@ CONTROL QUERY DEFAULT HBASE_SMALL_SCANNER SYSTEM HBASE_FILTER_PREDS 2 TRAF_INDEX_CREATE_OPT ON + DDL_TRANSACTIONS ON SHOWCONTROL_SHOW_ALL ON DEF_CHUNK_SIZE 1000 CPUCOST_DM_GET .001
