Various fixes

-- Implicit xns for ddl stmts are now started in master exe if
   autocommit is OFF
-- default values for varchar columns are now handled correctly
-- DATEFORMAT function on timestamp values are now handled correctly
-- CREATE/DROP PROCEDURE stmt are now handled correctly with DDL xns.
-- alter primary key stmt now returns an error if table already has a
   user defined primary/clustering key
-- regress/core/TEST116, seabase/TEST030,031 have been updated with new tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/9be5d503
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/9be5d503
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/9be5d503

Branch: refs/heads/master
Commit: 9be5d50367fed69f83750f5e63098812bb011e72
Parents: 9b779cc
Author: Anoop Sharma <[email protected]>
Authored: Thu Apr 7 15:23:57 2016 +0000
Committer: Cloud User <[email protected]>
Committed: Thu Apr 7 15:23:57 2016 +0000

----------------------------------------------------------------------
 core/sql/cli/Statement.cpp                | 2 +-
 core/sql/optimizer/BindItemExpr.cpp       | 4 ----
 core/sql/optimizer/RelExeUtil.cpp         | 2 +-
 core/sql/regress/udr/TEST100              | 1 -
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp | 8 ++++++++
 5 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9be5d503/core/sql/cli/Statement.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Statement.cpp b/core/sql/cli/Statement.cpp
index 0fad61b..65dc082 100644
--- a/core/sql/cli/Statement.cpp
+++ b/core/sql/cli/Statement.cpp
@@ -6276,7 +6276,7 @@ short Statement::beginTransaction(ComDiagsArea &diagsArea)
   updateTModeValues();
 
   // implicit xns for ddl stmts will be started and committed/aborted
-  // in arkcmp
+  // in arkcmp if auto commit is on. Otherwise, it will be started here.
   if ((root_tdb->transactionReqd()) &&
       ((NOT root_tdb->ddlQuery()) ||
        (NOT context_->getTransaction()->autoCommit())))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9be5d503/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp 
b/core/sql/optimizer/BindItemExpr.cpp
index 75c126f..f348896 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -4185,10 +4185,6 @@ ItemExpr * DateFormat::bindNode(BindWA * bindWA)
               else
                 frmt_ = ExpDatetime::DATETIME_FORMAT_TS2;// 
DD.MM.YYYY:HH24:MI:SS
             }
-#ifdef __ignore
-          else  if (operand->getPrecision() == SQLDTCODE_TIME)
-            frmt_ = ExpDatetime::DATETIME_FORMAT_TS4;// HH24:MI:SS
-#endif
         }
 
        if (ExpDatetime::isTimestampFormat(frmt_))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9be5d503/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp 
b/core/sql/optimizer/RelExeUtil.cpp
index eac65b6..bf0ef2f 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -4211,7 +4211,7 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
         
getExprNode()->castToStmtDDLNode()->castToStmtDDLCleanupObjects()->getStatus();
     }
 
-    if (isCleanup_) // || isRoutine_ || isLibrary_)
+    if (isCleanup_)
       {
         if (NOT Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL))
           hbaseDDLNoUserXn_ = TRUE;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9be5d503/core/sql/regress/udr/TEST100
----------------------------------------------------------------------
diff --git a/core/sql/regress/udr/TEST100 b/core/sql/regress/udr/TEST100
index f3f5c32..cedb778 100755
--- a/core/sql/regress/udr/TEST100
+++ b/core/sql/regress/udr/TEST100
@@ -75,7 +75,6 @@ obey TEST100(java_compile);
 obey TEST100(set_up);
 obey TEST100(tests);
 log;
-exit;
 obey TEST100(clean_up_procs);
 obey TEST100(clean_up_tables);
 obey TEST100(clean_up_files);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/9be5d503/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp 
b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index 28609e9..7285c37 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -1157,6 +1157,14 @@ void CmpSeabaseDDL::createSeabaseRoutine(
       return;
     }
 
+  // Remove cached entries in other processes
+  NARoutineDB *pRoutineDBCache  = ActiveSchemaDB()->getNARoutineDB();
+  QualifiedName qualRoutineName(routineName, STMTHEAP);
+  pRoutineDBCache->removeNARoutine(qualRoutineName, 
+                                   ComQiScope::REMOVE_FROM_ALL_USERS,
+                                   objUID,
+                                   createRoutineNode->ddlXns(), FALSE);
+
   processReturn();
   return;
 }

Reply via email to