trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sure...@apache.org
Subject [2/8] incubator-trafodion git commit: JIRA TRAFODION-1798 (ddl xns) and few other fixes, details below.
Date Thu, 03 Mar 2016 14:59:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/seabase/EXPECTED011
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED011 b/core/sql/regress/seabase/EXPECTED011
index 012f55f..0b2cafa 100644
--- a/core/sql/regress/seabase/EXPECTED011
+++ b/core/sql/regress/seabase/EXPECTED011
@@ -7,7 +7,7 @@
 >>invoke T011T1;
 
 -- Definition of Trafodion table TRAFODION.SCH.T011T1
--- Definition current  Sat Jan 23 04:06:15 2016
+-- Definition current  Wed Feb 10 17:28:56 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -142,7 +142,7 @@ A            B
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... NOT NAMED
-PLAN_ID .................. 212320281977039065
+PLAN_ID .................. 212321885336541730
 ROWS_OUT ................. 7
 EST_TOTAL_COST ........... 0.01
 STATEMENT ................ select * from t011t1 where a >= 3 and a < 5;
@@ -178,10 +178,11 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.SCH
   QUERY_CACHE ............ 0
   GENERATE_EXPLAIN ....... ON
-  ObjectUIDs ............. 3130652840489752733
+  ObjectUIDs ............. 7276217900832183965
   select_list ............ TRAFODION.SCH.T011T1.A, TRAFODION.SCH.T011T1.B
 
 
@@ -1268,7 +1269,7 @@ METRIC_TEXT_TABLE
 >>invoke trafodion."_REPOS_".metric_query_table;
 
 -- Definition of Trafodion table TRAFODION."_REPOS_".METRIC_QUERY_TABLE
--- Definition current  Sat Jan 23 04:08:38 2016
+-- Definition current  Wed Feb 10 17:31:00 2016
 
   (
     INSTANCE_ID                      INT UNSIGNED NO DEFAULT NOT NULL NOT
@@ -1450,7 +1451,7 @@ METRIC_TEXT_TABLE
 >>-- get qid for the prepared stmt
 >>get qid for statement explstmt;
 
-MXID11000005561212320281953925061000000000206U3333300_1924_EXPLSTMT
+MXID11000029309212321885301727001000000000206U3333300_1921_EXPLSTMT
 
 --- SQL operation complete.
 >>
@@ -1502,7 +1503,7 @@ SEQ_NUM      OPERATOR
 --- SQL command prepared.
 >>get qid for statement explstmt2;
 
-MXID11000005561212320281953925061000000000206U3333300_1935_EXPLSTMT2
+MXID11000029309212321885301727001000000000206U3333300_1932_EXPLSTMT2
 
 --- SQL operation complete.
 >>set qid MXID123456 for explstmt2;
@@ -2075,7 +2076,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 >>invoke t011t7;
 
 -- Definition of Trafodion table TRAFODION.SCH.T011T7
--- Definition current  Sat Jan 23 04:09:41 2016
+-- Definition current  Wed Feb 10 17:32:03 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2092,7 +2093,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 >>invoke t011t7;
 
 -- Definition of Trafodion table TRAFODION.SCH.T011T7
--- Definition current  Sat Jan 23 04:09:45 2016
+-- Definition current  Wed Feb 10 17:32:03 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE
@@ -2109,7 +2110,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 >>invoke t011t7;
 
 -- Definition of Trafodion table TRAFODION.SCH.T011T7
--- Definition current  Sat Jan 23 04:09:49 2016
+-- Definition current  Wed Feb 10 17:32:04 2016
 
   (
     A                                INT NO DEFAULT NOT NULL NOT DROPPABLE

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/seabase/EXPECTED016
----------------------------------------------------------------------
diff --git a/core/sql/regress/seabase/EXPECTED016 b/core/sql/regress/seabase/EXPECTED016
index 6d631b8..2128d94 100644
--- a/core/sql/regress/seabase/EXPECTED016
+++ b/core/sql/regress/seabase/EXPECTED016
@@ -179,7 +179,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282637448134
+PLAN_ID .................. 212321995066139995
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 553.48
 STATEMENT ................ select f,count(f)
@@ -218,13 +218,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151598413
+  ObjectUIDs ............. 6789829250703131337
   select_list ............ TRAFODION.HBASE.MCSTATPART7.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART7.
                              F)))
@@ -327,7 +328,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282637741686
+PLAN_ID .................. 212321995066491810
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 568.59
 STATEMENT ................ select f,count(f)
@@ -366,13 +367,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151600526
+  ObjectUIDs ............. 6789829250703135855
   select_list ............ TRAFODION.HBASE.MCSTATPART5.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART5.
                              F)))
@@ -475,7 +477,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282638023675
+PLAN_ID .................. 212321995066791768
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 553.48
 STATEMENT ................ select f,count(f)
@@ -514,13 +516,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151601389
+  ObjectUIDs ............. 6789829250703137455
   select_list ............ TRAFODION.HBASE.MCSTATPART3.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART3.
                              F)))
@@ -623,7 +626,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282638276314
+PLAN_ID .................. 212321995067094379
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 523.92
 STATEMENT ................ select f,count(f)
@@ -662,13 +665,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151602308
+  ObjectUIDs ............. 6789829250703138642
   select_list ............ TRAFODION.HBASE.MCSTATPART6.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART6.
                              F)))
@@ -771,7 +775,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282638589572
+PLAN_ID .................. 212321995067459222
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 523.92
 STATEMENT ................ select f,count(f)
@@ -810,13 +814,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151603186
+  ObjectUIDs ............. 6789829250703139741
   select_list ............ TRAFODION.HBASE.MCSTATPART2.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART2.
                              F)))
@@ -919,7 +924,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282638883341
+PLAN_ID .................. 212321995067792542
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 538.3
 STATEMENT ................ select f,count(f)
@@ -958,13 +963,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151604056
+  ObjectUIDs ............. 6789829250703141227
   select_list ............ TRAFODION.HBASE.MCSTATPART1.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART1.
                              F)))
@@ -1067,7 +1073,7 @@ LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
 ------------------------------------------------------------------ PLAN SUMMARY
 MODULE_NAME .............. DYNAMICALLY COMPILED
 STATEMENT_NAME ........... ST1
-PLAN_ID .................. 212320282639174313
+PLAN_ID .................. 212321995068129313
 ROWS_OUT ................. 1
 EST_TOTAL_COST ......... 553.48
 STATEMENT ................ select f,count(f)
@@ -1106,13 +1112,14 @@ DESCRIPTION
   HBASE_FILTER_PREDS ..... 2
   TRAF_ALIGNED_ROW_FORMAT  OFF
   TRAF_INDEX_CREATE_OPT    ON
+  DDL_TRANSACTIONS ....... ON
   SCHEMA ................. TRAFODION.HBASE
   QUERY_CACHE ............ 0
   CACHE_HISTOGRAMS ....... OFF
   HBASE_MIN_BYTES_PER_ESP  1
   USTAT_COLLECT_MC_SKEW_V  ON
   PARALLEL_NUM_ESPS ...... 4
-  ObjectUIDs ............. 953725371151604853
+  ObjectUIDs ............. 6789829250703142594
   select_list ............ TRAFODION.HBASE.MCSTATPART8.F,
                              cast(sum(count_nonull(TRAFODION.HBASE.MCSTATPART8.
                              F)))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_catman1.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_catman1.ksh b/core/sql/regress/tools/runregr_catman1.ksh
index ef8a0b3..cf042f9 100755
--- a/core/sql/regress/tools/runregr_catman1.ksh
+++ b/core/sql/regress/tools/runregr_catman1.ksh
@@ -450,7 +450,8 @@ for ix in $testfiles; do
   #  Print date, time, test name and test result in log file. --
   #-------------------------------------------------------------
   echo $logtxt
-  echo "`date +'%D %T'`	$ix  $logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
 
 done
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_charsets.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_charsets.ksh b/core/sql/regress/tools/runregr_charsets.ksh
index 768ae0b..c0d59fa 100755
--- a/core/sql/regress/tools/runregr_charsets.ksh
+++ b/core/sql/regress/tools/runregr_charsets.ksh
@@ -728,7 +728,8 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_compGeneral.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_compGeneral.ksh b/core/sql/regress/tools/runregr_compGeneral.ksh
index 11b796f..e7e87d7 100755
--- a/core/sql/regress/tools/runregr_compGeneral.ksh
+++ b/core/sql/regress/tools/runregr_compGeneral.ksh
@@ -833,7 +833,8 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 done # for i in $prettyfiles

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_core.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_core.ksh b/core/sql/regress/tools/runregr_core.ksh
index e833f4d..59004ad 100755
--- a/core/sql/regress/tools/runregr_core.ksh
+++ b/core/sql/regress/tools/runregr_core.ksh
@@ -836,7 +836,8 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 done # for i in $prettyfiles

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_executor.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_executor.ksh b/core/sql/regress/tools/runregr_executor.ksh
index d603674..3411009 100755
--- a/core/sql/regress/tools/runregr_executor.ksh
+++ b/core/sql/regress/tools/runregr_executor.ksh
@@ -908,7 +908,8 @@ for i in $prettyfiles; do
     fi
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 done # for i in $prettyfiles

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_fullstack2.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_fullstack2.ksh b/core/sql/regress/tools/runregr_fullstack2.ksh
index bdad2a6..1cbbfca 100755
--- a/core/sql/regress/tools/runregr_fullstack2.ksh
+++ b/core/sql/regress/tools/runregr_fullstack2.ksh
@@ -737,7 +737,8 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 done # for i in $prettyfiles

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_hive.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_hive.ksh b/core/sql/regress/tools/runregr_hive.ksh
index 45b6cb2..1165892 100755
--- a/core/sql/regress/tools/runregr_hive.ksh
+++ b/core/sql/regress/tools/runregr_hive.ksh
@@ -662,10 +662,10 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
-
   # save off the DIFF file for debugging
   if [ $nsk -eq 1 ]; then
     if [ $SQLMX_REGRESS -eq 1 ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_privs1.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_privs1.ksh b/core/sql/regress/tools/runregr_privs1.ksh
index 868aaee..0f3e4a0 100755
--- a/core/sql/regress/tools/runregr_privs1.ksh
+++ b/core/sql/regress/tools/runregr_privs1.ksh
@@ -466,7 +466,8 @@ rm -f $ix.tmp 2>$NULL
   #  Print date, time, test name and test result in log file. --
   #-------------------------------------------------------------
   echo $logtxt
-  echo "`date +'%D %T'`	$ix  $logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $lfile | cut -d'.' -f1`
+  echo "$modtime  $ix  $logtxt" >> $rgrlog
 
 done
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_privs2.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_privs2.ksh b/core/sql/regress/tools/runregr_privs2.ksh
index af75f3b..320295b 100755
--- a/core/sql/regress/tools/runregr_privs2.ksh
+++ b/core/sql/regress/tools/runregr_privs2.ksh
@@ -466,7 +466,8 @@ rm -f $ix.tmp 2>$NULL
   #  Print date, time, test name and test result in log file. --
   #-------------------------------------------------------------
   echo $logtxt
-  echo "`date +'%D %T'`	$ix  $logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $lfile | cut -d'.' -f1`
+  echo "$modtime  $ix  $logtxt" >> $rgrlog
 
 done
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_qat.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_qat.ksh b/core/sql/regress/tools/runregr_qat.ksh
index bb09165..54729c3 100755
--- a/core/sql/regress/tools/runregr_qat.ksh
+++ b/core/sql/regress/tools/runregr_qat.ksh
@@ -361,7 +361,8 @@ for i in $testfiles; do
   fi
 
   echo $logtxt
-  echo "`date +'%D %T'`	$tfile  $logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $afile | cut -d'.' -f1`
+  echo "$modtime  $tfile  $logtxt" >> $rgrlog
 
   # save off the DIFF file for debugging
   if [ $nsk -eq 1 ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_seabase.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_seabase.ksh b/core/sql/regress/tools/runregr_seabase.ksh
index dc3d992..853fc14 100755
--- a/core/sql/regress/tools/runregr_seabase.ksh
+++ b/core/sql/regress/tools/runregr_seabase.ksh
@@ -655,7 +655,9 @@ for i in $prettyfiles; do
     logtxt="### FAIL ($diffsize lines$knownsize)     ###$logtxt"
   fi
   echo $logtxt
-  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+#  echo "`date +'%D %T'`  $test 	$logtxt" >> $rgrlog
+  modtime=`stat --printf=%y $log | cut -d'.' -f1`
+  echo "$modtime  $test  $logtxt" >> $rgrlog
   echo
 
 done # for i in $prettyfiles

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/runregr_udr.ksh
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/runregr_udr.ksh b/core/sql/regress/tools/runregr_udr.ksh
index 5852c15..45904a0 100755
--- a/core/sql/regress/tools/runregr_udr.ksh
+++ b/core/sql/regress/tools/runregr_udr.ksh
@@ -741,9 +741,10 @@ function DO_DIFF
 	fi
     fi
 
-    printf "$RESULT\n"
-    printf "$(date '+%m/%d/%Y %R')    $T\t  $RESULT\n" >> $rgrlog
-
+#    printf "$RESULT\n"
+#    printf "$(date '+%m/%d/%Y %R')    $T\t  $RESULT\n" >> $rgrlog
+    modtime=`stat --printf=%y $LOG | cut -d'.' -f1`
+    printf "$modtime    $T\t  $RESULT\n" >> $rgrlog
 }
 
 function DO_TEST
@@ -895,7 +896,7 @@ do
         fi
     fi
 done
-echo "$(date '+%m/%d/%Y %R')" >> $rgrlog
+#echo "$(date '+%m/%d/%Y %R')" >> $rgrlog
 
 # stop the ODBC server
 if [ $MXODBC_USABLE -eq 1 ]; then

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/regress/tools/sbdefs
----------------------------------------------------------------------
diff --git a/core/sql/regress/tools/sbdefs b/core/sql/regress/tools/sbdefs
index 08088a2..5cb15b6 100644
--- a/core/sql/regress/tools/sbdefs
+++ b/core/sql/regress/tools/sbdefs
@@ -32,6 +32,7 @@ cqd hbase_filter_preds '2';
 cqd traf_aligned_row_format 'OFF';
 --cqd traf_default_col_charset 'UTF8';
 cqd traf_index_create_opt 'ON';
+cqd ddl_transactions 'ON';
 cqd schema '$$TEST_SCHEMA$$';
 set SCHEMA $$TEST_SCHEMA$$;
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index 480853b..3029c75 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -3354,8 +3354,10 @@ short CmpDescribeSequence(
   cn.setSpecialType(ExtendedQualName::SG_TABLE);
 
   // remove NATable for this table so latest values in the seq table could be read.
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn, 
-    NATableDB::REMOVE_MINE_ONLY, COM_SEQUENCE_GENERATOR_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn, 
+     ComQiScope::REMOVE_MINE_ONLY, COM_SEQUENCE_GENERATOR_OBJECT,
+     FALSE, FALSE);
 
   ULng32 savedParserFlags = Get_SqlParser_Flags (0xFFFFFFFF);
   Set_SqlParser_Flags(ALLOW_VOLATILE_SCHEMA_IN_TABLE_NAME);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDL.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDL.h b/core/sql/sqlcomp/CmpSeabaseDDL.h
index 5ab446e..6d441b1 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDL.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDL.h
@@ -408,6 +408,8 @@ class CmpSeabaseDDL
 
   ExpHbaseInterface* allocEHI(NADefaults * defs = NULL);
   
+  short ddlInvalidateNATables();
+
   void deallocEHI(ExpHbaseInterface* &ehi);
   void dropLOBHdfsFiles();
   enum {
@@ -479,7 +481,8 @@ class CmpSeabaseDDL
                          const int numSplits = 0,
                          const int keyLength = 0,
                          char **encodedKeysBuffer = NULL,
-			 NABoolean doRetry = TRUE);
+			 NABoolean doRetry = FALSE,
+                         NABoolean ddlXns = FALSE);
 
   short createHbaseTable(ExpHbaseInterface *ehi, 
 			 HbaseStr *table,
@@ -488,15 +491,18 @@ class CmpSeabaseDDL
                          const int numSplits = 0,
                          const int keyLength = 0,
                          char **encodedKeysBuffer = NULL,
-			 NABoolean doRetry = TRUE);
+			 NABoolean doRetry = TRUE,
+                         NABoolean ddlXns = FALSE);
 
   short alterHbaseTable(ExpHbaseInterface *ehi,
                         HbaseStr *table,
                         NAList<NAString> &allColFams,
-                        NAList<HbaseCreateOption*> * hbaseCreateOptions);
+                        NAList<HbaseCreateOption*> * hbaseCreateOptions,
+                        NABoolean ddlXns);
 
   short dropHbaseTable(ExpHbaseInterface *ehi, 
-		       HbaseStr *table, NABoolean asyncDrop = FALSE);
+		       HbaseStr *table, NABoolean asyncDrop,
+                       NABoolean ddlXns);
 
   short copyHbaseTable(ExpHbaseInterface *ehi, 
 		       HbaseStr *currTable, HbaseStr* oldTable);
@@ -515,6 +521,7 @@ class CmpSeabaseDDL
 			  const NAString &objName,
 			  NAString &currCatName, NAString &currSchName,
 			  const ComObjectType objType,
+                          NABoolean ddlXns,
 			  NABoolean dropFromMD = TRUE,
 			  NABoolean dropFromHbase = TRUE);
   
@@ -896,7 +903,8 @@ class CmpSeabaseDDL
                                const NAString &catName, 
                                const NAString &schName,
                                const NAString &objName,
-                               const ComObjectType objectType);
+                               const ComObjectType objectType,
+                               NABoolean ddlXns);
   
   short createSeabaseTable2(
                             ExeCliInterface &cliInterface,
@@ -959,6 +967,7 @@ class CmpSeabaseDDL
        ComObjectName &tableName,
        ComAnsiNamePart &currCatAnsiName,
        ComAnsiNamePart &currSchAnsiName,
+       StmtDDLNode * ddlNode,
        StmtDDLAddConstraintPK * pkConstr,
        StmtDDLAddConstraintUniqueArray &uniqueConstrArr,
        StmtDDLAddConstraintRIArray &riConstrArr,
@@ -979,7 +988,8 @@ class CmpSeabaseDDL
        const NAString &catalogNamePart,
        const NAString &schemaNamePart,
        const NAString &objectNamePart,
-       char * colName, const NAColumn * nacol);
+       char * colName, const NAColumn * nacol,
+       NABoolean ddlXns);
   
   short recreateViews(ExeCliInterface &cliInterface,
                       NAList<NAString> &viewNameList,
@@ -1111,18 +1121,19 @@ class CmpSeabaseDDL
 			     StmtDDLDropHbaseTable                  * createTableNode,
 			     NAString &currCatName, NAString &currSchName);
   
-  void initSeabaseMD();
-  void dropSeabaseMD();
+  void initSeabaseMD(NABoolean ddlXns);
+  void dropSeabaseMD(NABoolean ddlXns);
   void createSeabaseMDviews();
   void dropSeabaseMDviews();
   void createSeabaseSeqTable();
   void createSeabaseSchemaObjects();
   void updateVersion();
 
-  short createPrivMgrRepos(ExeCliInterface *cliInterface);
+  short createPrivMgrRepos(ExeCliInterface *cliInterface, NABoolean ddlXns);
   short initSeabaseAuthorization(ExeCliInterface *cliInterface,
-                                std::vector<std::string> &tablesCreated,
-                                std::vector<std::string> &tablesUpgraded);
+                                 NABoolean ddlXns,
+                                 std::vector<std::string> &tablesCreated,
+                                 std::vector<std::string> &tablesUpgraded);
 
   void dropSeabaseAuthorization(ExeCliInterface *cliInterface, 
                                 NABoolean doCleanup = FALSE);
@@ -1139,7 +1150,7 @@ class CmpSeabaseDDL
                               const ComObjectType objType);
 
 
-  short dropSeabaseObjectsFromHbase(const char * pattern);
+  short dropSeabaseObjectsFromHbase(const char * pattern, NABoolean ddlXns);
   short updateSeabaseAuths(ExeCliInterface * cliInterface, const char * sysCat);
 
   void purgedataHbaseTable(DDLExpr * ddlExpr,
@@ -1287,7 +1298,7 @@ class CmpSeabaseDDL
                          NAString& hco); // out
   
 
-    private:
+private:
   enum
   {
     NUM_MAX_PARAMS = 20

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
index 3fa0b16..f51c6ce 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
@@ -493,7 +493,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
   // fail to delete the base table row. Right now OBJECTS is the only metadata
   // table with an index, so this is the only place we need to take this precaution.
 
-  cliRC = cliInterface->holdAndSetCQD("HIDE_INDEXES","ALL",CmpCommon::diags());
+  cliRC = cliInterface->holdAndSetCQD("HIDE_INDEXES","ALL", NULL);
   if (cliRC < 0)
     {
       if (processCleanupErrors(cliInterface, errorSeen))
@@ -514,7 +514,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
  
   // Restore previous setting of CQD HIDE_INDEXES
 
-  cliRC = cliInterface->restoreCQD("HIDE_INDEXES",CmpCommon::diags());
+  cliRC = cliInterface->restoreCQD("HIDE_INDEXES", NULL);
   if (cliRC < 0)
     {
       if (processCleanupErrors(cliInterface, errorSeen))
@@ -928,10 +928,13 @@ void CmpSeabaseMDcleanup::cleanupSchemaObjects(ExeCliInterface *cliInterface)
               return;
           }      
         CorrName cn(objName_, STMTHEAP, schName_, catName_);
-        ActiveSchemaDB()->getNATableDB()->removeNATable(
-                                                        cn,
-                                                        NATableDB::REMOVE_FROM_ALL_USERS,
-                                                        COM_BASE_TABLE_OBJECT);
+        ActiveSchemaDB()->getNATableDB()->removeNATable
+          (
+               cn,
+               ComQiScope::REMOVE_FROM_ALL_USERS,
+               COM_BASE_TABLE_OBJECT,
+               FALSE, FALSE
+           );
       }
    }
 
@@ -1089,7 +1092,7 @@ short CmpSeabaseMDcleanup::cleanupOrphanObjectsEntries(ExeCliInterface *cliInter
   NABoolean errorSeen = FALSE;
 
   // find out all entries which do not have corresponsing hbase objects
-  str_sprintf(query, "select object_uid, trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from %s.\"%s\".%s where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', 'PRIVMGR_MD') and (object_type = 'BT' or object_type = 'IX') ",
+  str_sprintf(query, "select object_uid, trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from %s.\"%s\".%s where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', '_PRIVMGR_MD_') and schema_name not like '|_HV|_%%' escape '|'  and schema_name not like '|_HB|_%%' escape '|' and (object_type = 'BT' or object_type = 'IX') ",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               getSystemCatalog());
   cliRC = cliInterface->fetchRowsPrologue(query);
@@ -1269,7 +1272,7 @@ short CmpSeabaseMDcleanup::cleanupInconsistentObjectsEntries(ExeCliInterface *cl
     }      
 
   // find out all entries that exist in OBJECTS but not in OBJECTS_UNIQ_IDX
-  str_sprintf(query, "select object_uid, trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from %s.\"%s\".%s  where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', 'PRIVMGR_MD') and object_uid not in (select \"OBJECT_UID@\"  from table(index_table %s.\"%s\".%s))",
+  str_sprintf(query, "select object_uid, trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from %s.\"%s\".%s  where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', '_PRIVMGR_MD_') and object_uid not in (select \"OBJECT_UID@\"  from table(index_table %s.\"%s\".%s))",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               getSystemCatalog(),
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS_UNIQ_IDX);
@@ -1300,7 +1303,7 @@ short CmpSeabaseMDcleanup::cleanupInconsistentObjectsEntries(ExeCliInterface *cl
         return -1;
     }      
 
-  str_sprintf(query, "select \"OBJECT_UID@\", trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from table(index_table %s.\"%s\".%s)  where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', 'PRIVMGR_MD') and \"OBJECT_UID@\" not in (select object_uid from %s.\"%s\".%s)",
+  str_sprintf(query, "select \"OBJECT_UID@\", trim(catalog_name) || '.'  || trim(schema_name) || '.' || trim(object_name)  from table(index_table %s.\"%s\".%s)  where catalog_name = '%s' and schema_name not in ( '_MD_', '_REPOS_', '_PRIVMGR_MD_') and \"OBJECT_UID@\" not in (select object_uid from %s.\"%s\".%s)",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS_UNIQ_IDX,
               getSystemCatalog(),
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS);
@@ -1833,7 +1836,7 @@ void CmpSeabaseMDcleanup::cleanupObjects(StmtDDLCleanupObjects * stmtCleanupNode
       hbaseObject.len = extNameForHbase_.length();
       
       // drop this object from hbase
-      cliRC = dropHbaseTable(ehi, &hbaseObject, FALSE);
+      cliRC = dropHbaseTable(ehi, &hbaseObject, FALSE, FALSE);
       if (cliRC)
           if (stopOnError_)
             goto label_return;
@@ -1869,10 +1872,12 @@ void CmpSeabaseMDcleanup::cleanupObjects(StmtDDLCleanupObjects * stmtCleanupNode
   if (NOT (catName_.isNull() || schName_.isNull() || objName_.isNull()))
     {
       CorrName cn(objName_, STMTHEAP, schName_, catName_);
-      ActiveSchemaDB()->getNATableDB()->removeNATable(
-                                                      cn,
-                                                      NATableDB::REMOVE_FROM_ALL_USERS, 
-                                                      COM_BASE_TABLE_OBJECT);
+      ActiveSchemaDB()->getNATableDB()->removeNATable
+        (
+             cn,
+             ComQiScope::REMOVE_FROM_ALL_USERS, 
+             COM_BASE_TABLE_OBJECT,
+             FALSE, FALSE);
     }
 
   return;
@@ -1882,10 +1887,11 @@ void CmpSeabaseMDcleanup::cleanupObjects(StmtDDLCleanupObjects * stmtCleanupNode
       (NOT extNameForHbase_.isNull()))
     {
       CorrName cn(objName_, STMTHEAP, schName_, catName_);
-      ActiveSchemaDB()->getNATableDB()->removeNATable(
-                                                      cn,
-                                                      NATableDB::REMOVE_FROM_ALL_USERS, 
-                                                      COM_BASE_TABLE_OBJECT);
+      ActiveSchemaDB()->getNATableDB()->removeNATable
+        (cn,
+         ComQiScope::REMOVE_FROM_ALL_USERS, 
+         COM_BASE_TABLE_OBJECT,
+         FALSE, FALSE);
     }
 
  label_return:

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 8f53cc9..69ed4c8 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -2014,6 +2014,9 @@ short CmpSeabaseDDL::beginXnIfNotInProgress(ExeCliInterface *cliInterface,
           return -1;
         }
       
+      CmpContext* cmpContext = CmpCommon::context();
+      cmpContext->ddlObjsList().clear();
+
       xnWasStartedHere = TRUE;
     }
 
@@ -2046,12 +2049,47 @@ short CmpSeabaseDDL::endXnIfStartedHere(ExeCliInterface *cliInterface,
               cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
               return cliRC;
             }
+
+          ddlInvalidateNATables();
         }
+
+      CmpContext* cmpContext = CmpCommon::context();
+      cmpContext->ddlObjsList().clear();
     }
 
   return cliRC;
 }
 
+// Invalidate NATables for ddl objects that were affected in
+// this transaction.
+// DDL objects have already been set in ddlObjsList.
+short CmpSeabaseDDL::ddlInvalidateNATables()
+{
+  CmpContext* cmpContext = CmpCommon::context();
+  for (Lng32 i = 0; i < cmpContext->ddlObjsList().entries(); i++)
+    {
+      CmpContext::DDLObjInfo &ddlObj = cmpContext->ddlObjsList()[i];
+      NAString &ddlObjName = ddlObj.ddlObjName;
+      ComQiScope &qiScope = ddlObj.qiScope;
+      ComObjectType &ot = ddlObj.ot;
+
+      ComObjectName tableName(ddlObjName);
+      
+      const NAString catalogNamePart = 
+        tableName.getCatalogNamePartAsAnsiString();
+      const NAString schemaNamePart =
+        tableName.getSchemaNamePartAsAnsiString(TRUE);
+      const NAString objectNamePart = 
+        tableName.getObjectNamePartAsAnsiString(TRUE);
+      
+      CorrName cn(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
+      
+      ActiveSchemaDB()->getNATableDB()->removeNATable(cn, qiScope, ot, TRUE, TRUE);
+    }
+
+  return 0;
+}
+
 short CmpSeabaseDDL::populateKeyInfo(ComTdbVirtTableKeyInfo &keyInfo,
                                      OutputInfo * oi, NABoolean isIndex)
 {
@@ -2327,7 +2365,8 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface *ehi,
                                       const int numSplits,
                                       const int keyLength,
                                       char** encodedKeysBuffer,
-                                      NABoolean doRetry)
+                                      NABoolean doRetry,
+                                      NABoolean ddlXns)
 {
   // this method is called after validating that the table doesn't exist in seabase
   // metadata. It creates the corresponding hbase table.
@@ -2361,7 +2400,7 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface *ehi,
     
   if (retcode == -1)
     {
-      *CmpCommon::diags() << DgSqlCode(-1390)
+      *CmpCommon::diags() << DgSqlCode(-1431)
                           << DgString0(table->val);
       return -1;
     } 
@@ -2410,13 +2449,18 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface *ehi,
 
   hbaseCreateOptionsArray[HBASE_NAME] = colFamNames.data();
 
-  NABoolean noXn =
-    (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_OFF) ?  true : false;
-  
+  // TEMPTEMP 
+  //  Currently DTM crashes if number of column families goes beyond 5.
+  //  Do not use ddl xns if number of explicitly specified column fams
+  //  exceed 5. This is not a common case as recommendation from HBase
+  //  for good performance is to keep num of col fams small (3 or 4).
+  //  Once dtm bug is fixed, this check will be removed.
+  if (colFamVec.size() > 5)
+    ddlXns = FALSE;
   retcode = ehi->create(*table, hbaseCreateOptionsArray,
                         numSplits, keyLength,
                         (const char **)encodedKeysBuffer,
-                        noXn,
+                        (NOT ddlXns),
                         isMVCC);
 
   if (retcode < 0)
@@ -2440,7 +2484,8 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface *ehi,
                                       const int numSplits,
                                       const int keyLength,
                                       char** encodedKeysBuffer,
-                                      NABoolean doRetry)
+                                      NABoolean doRetry, 
+                                      NABoolean ddlXns)
 {
   if (! cf1)
     return -1;
@@ -2457,13 +2502,14 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface *ehi,
 
   return createHbaseTable(ehi, table, colFamVec, hbaseCreateOptions,
                           numSplits, keyLength,
-                          encodedKeysBuffer, doRetry);
+                          encodedKeysBuffer, doRetry, ddlXns);
 }
 
 short CmpSeabaseDDL::alterHbaseTable(ExpHbaseInterface *ehi,
                                      HbaseStr *table,
                                      NAList<NAString> &allColFams,
-                                     NAList<HbaseCreateOption*> * hbaseCreateOptions)
+                                     NAList<HbaseCreateOption*> * hbaseCreateOptions,
+                                     NABoolean ddlXns)
 {
   short retcode = 0;
   NAText hbaseCreateOptionsArray[HBASE_MAX_OPTIONS];
@@ -2476,8 +2522,7 @@ short CmpSeabaseDDL::alterHbaseTable(ExpHbaseInterface *ehi,
     } 
   else  
     {
-      NABoolean noXn =
-        (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_OFF) ?  true : false;
+      NABoolean noXn = (NOT ddlXns);
          
       retcode = 0;
 
@@ -2513,22 +2558,19 @@ short CmpSeabaseDDL::alterHbaseTable(ExpHbaseInterface *ehi,
 }
 
 short CmpSeabaseDDL::dropHbaseTable(ExpHbaseInterface *ehi, 
-                                    HbaseStr *table, NABoolean asyncDrop)
+                                    HbaseStr *table, NABoolean asyncDrop,
+                                    NABoolean ddlXns)
 {
   short retcode = 0;
 
   retcode = ehi->exists(*table);
   if (retcode == -1) // exists
     {    
-      
-      NABoolean noXn =
-           (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_OFF) ?  true : false;
-                
       if ((CmpCommon::getDefault(HBASE_ASYNC_DROP_TABLE) == DF_ON) ||
           (asyncDrop))
-        retcode = ehi->drop(*table, TRUE, noXn);
+        retcode = ehi->drop(*table, TRUE, (NOT ddlXns));
       else
-        retcode = ehi->drop(*table, FALSE, noXn);
+        retcode = ehi->drop(*table, FALSE, (NOT ddlXns));
       if (retcode < 0)
         {
           *CmpCommon::diags() << DgSqlCode(-8448)
@@ -5265,13 +5307,13 @@ void CmpSeabaseDDL::cleanupObjectAfterError(
                                             const NAString &catName, 
                                             const NAString &schName,
                                             const NAString &objName,
-                                            const ComObjectType objectType)
+                                            const ComObjectType objectType,
+                                            NABoolean ddlXns)
 {
 
-  //if DDL_TRANSACTIONS is ON, no need of additional cleanup.
-  //This check is temporary and will be removed once full functionality 
-  //is in.
-  if(CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_ON)
+  //if ddlXns are being used, no need of additional cleanup.
+  //transactional rollback will take care of cleanup.
+  if (ddlXns)
     return;
     
   Lng32 cliRC = 0;
@@ -6304,6 +6346,7 @@ short CmpSeabaseDDL::dropSeabaseObject(ExpHbaseInterface * ehi,
                                        const NAString &objName,
                                        NAString &currCatName, NAString &currSchName,
                                        const ComObjectType objType,
+                                       NABoolean ddlXns,
                                        NABoolean dropFromMD,
                                        NABoolean dropFromHbase)
 {
@@ -6361,7 +6404,8 @@ short CmpSeabaseDDL::dropSeabaseObject(ExpHbaseInterface * ehi,
           HbaseStr hbaseTable;
           hbaseTable.val = (char*)extNameForHbase.data();
           hbaseTable.len = extNameForHbase.length();
-          retcode = dropHbaseTable(ehi, &hbaseTable);
+
+          retcode = dropHbaseTable(ehi, &hbaseTable, FALSE, ddlXns);
           if (retcode < 0)
             {
               return -1;
@@ -6478,7 +6522,7 @@ short CmpSeabaseDDL::updateSeabaseAuths(
   return 0;
 }
 
-void CmpSeabaseDDL::initSeabaseMD()
+void CmpSeabaseDDL::initSeabaseMD(NABoolean ddlXns)
 {
   Lng32 retcode = 0;
   Lng32 cliRC = 0;
@@ -6536,7 +6580,23 @@ void CmpSeabaseDDL::initSeabaseMD()
       deallocEHI(ehi); 
       return;
     }
-    
+
+  // drop and recreate DTM table TDDL.
+  // Do not do this drop/recreate operation under a dtm transaction.
+  // See file core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TmDDL.java
+  // Keep the name TRAFODION._DTM_.TDDL and col fam "tddlcf" in sync with
+  // that file.
+  HbaseStr tddlTable;
+  const NAString tddlNAS("TRAFODION._DTM_.TDDL");
+  tddlTable.val = (char*)tddlNAS.data();
+  tddlTable.len = tddlNAS.length();
+  if (ehi->exists(tddlTable) == -1) // exists
+    {
+      dropHbaseTable(ehi, &tddlTable, FALSE, FALSE);
+      createHbaseTable(ehi, &tddlTable, "tddlcf", 
+                       NULL, 0, 0, NULL, FALSE, FALSE);
+    }
+
   // create hbase physical objects
   for (Lng32 i = 0; i < numTables; i++)
     {
@@ -6550,7 +6610,9 @@ void CmpSeabaseDDL::initSeabaseMD()
       hbaseObjectStr += mdti.newName;
       hbaseObject.val = (char*)hbaseObjectStr.data();
       hbaseObject.len = hbaseObjectStr.length();
-      if (createHbaseTable(ehi, &hbaseObject, SEABASE_DEFAULT_COL_FAMILY, NULL) == -1)
+      if (createHbaseTable(ehi, &hbaseObject, SEABASE_DEFAULT_COL_FAMILY, NULL,
+                           0, 0, NULL,
+                           FALSE, ddlXns) == -1)
         {
           deallocEHI(ehi); 
           return;
@@ -6701,7 +6763,7 @@ void CmpSeabaseDDL::initSeabaseMD()
      goto label_error;
    }
 
- if (createPrivMgrRepos(&cliInterface))
+ if (createPrivMgrRepos(&cliInterface, ddlXns))
    {
      goto label_error;
    }
@@ -6908,7 +6970,8 @@ short CmpSeabaseDDL::createSchemaObjects(ExeCliInterface *cliInterface)
 //
 //  The diags area is populated with any unexpected errors
 // ---------------------------------------------------------------------------- 
-short CmpSeabaseDDL::createPrivMgrRepos(ExeCliInterface *cliInterface)
+short CmpSeabaseDDL::createPrivMgrRepos(ExeCliInterface *cliInterface,
+                                        NABoolean ddlXns)
 {
   // During install, the customer can choose to enable security features through 
   // an installation option which sets the the environment variable 
@@ -6921,7 +6984,8 @@ short CmpSeabaseDDL::createPrivMgrRepos(ExeCliInterface *cliInterface)
   std::vector<std::string> tablesCreated;
   std::vector<std::string> tablesUpgraded;
 
-  if (initSeabaseAuthorization(cliInterface, tablesCreated, tablesUpgraded) < 0)
+  if (initSeabaseAuthorization(cliInterface, ddlXns,
+                               tablesCreated, tablesUpgraded) < 0)
     return -1;
 
   return 0;
@@ -7285,8 +7349,10 @@ void  CmpSeabaseDDL::alterSeabaseSequence(StmtDDLCreateSequence  * alterSequence
 
   CorrName cn(seqNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
   cn.setSpecialType(ExtendedQualName::SG_TABLE);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn, 
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_SEQUENCE_GENERATOR_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn, 
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_SEQUENCE_GENERATOR_OBJECT,
+     alterSequenceNode->ddlXns(), FALSE);
 
   return;
 }
@@ -7386,19 +7452,22 @@ void  CmpSeabaseDDL::dropSeabaseSequence(StmtDDLDropSequence  * dropSequenceNode
 
   CorrName cn(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
   cn.setSpecialType(ExtendedQualName::SG_TABLE);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_SEQUENCE_GENERATOR_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_SEQUENCE_GENERATOR_OBJECT,
+     dropSequenceNode->ddlXns(), FALSE);
  
   return;
 }
 
-short CmpSeabaseDDL::dropSeabaseObjectsFromHbase(const char * pattern)
+short CmpSeabaseDDL::dropSeabaseObjectsFromHbase(const char * pattern,
+                                                 NABoolean ddlXns)
 {
   ExpHbaseInterface * ehi = allocEHI();
   if (ehi == NULL)
     return -1;
 
-  short retcode = ehi->dropAll(pattern, FALSE);
+  short retcode = ehi->dropAll(pattern, FALSE, (NOT ddlXns));
 
   if (retcode < 0)
     {
@@ -7414,7 +7483,7 @@ short CmpSeabaseDDL::dropSeabaseObjectsFromHbase(const char * pattern)
   return 0;
 }
 
-void CmpSeabaseDDL::dropSeabaseMD()
+void CmpSeabaseDDL::dropSeabaseMD(NABoolean ddlXns)
 {
   Lng32 cliRC;
   Lng32 retcode = 0;
@@ -7428,7 +7497,7 @@ void CmpSeabaseDDL::dropSeabaseMD()
     }
 
   // drop all objects that match the pattern "TRAFODION.*"
-  dropSeabaseObjectsFromHbase("TRAFODION\\..*");
+  dropSeabaseObjectsFromHbase("TRAFODION\\..*", ddlXns);
 
   SQL_EXEC_DeleteHbaseJNI();
   
@@ -7480,6 +7549,7 @@ void CmpSeabaseDDL::dropLOBHdfsFiles()
 // ----------------------------------------------------------------------------
 short CmpSeabaseDDL::initSeabaseAuthorization(
   ExeCliInterface *cliInterface,
+  NABoolean ddlXns,
   std::vector<std::string> &tablesCreated,
   std::vector<std::string> &tablesUpgraded)
 { 
@@ -7529,7 +7599,7 @@ short CmpSeabaseDDL::initSeabaseAuthorization(
     
     // If any tables were created, go drop them now.
     // Ignore any returned errors
-    if (CmpCommon::getDefault(DDL_TRANSACTIONS) == DF_OFF)
+    if (NOT ddlXns)
     {
       bool doCleanup = true;
       retcode = privInterface.dropAuthorizationMetadata(doCleanup);
@@ -7750,7 +7820,7 @@ short CmpSeabaseDDL::dropMDTable(ExpHbaseInterface *ehi, const char * tab)
   retcode = existsInHbase(hbaseObject, ehi);
   if (retcode == 1) // exists
     {
-      retcode = dropHbaseTable(ehi, &hbaseObjStr, FALSE);
+      retcode = dropHbaseTable(ehi, &hbaseObjStr, FALSE, FALSE);
       return retcode;
     }
 
@@ -7972,7 +8042,8 @@ void CmpSeabaseDDL::purgedataHbaseTable(DDLExpr * ddlExpr,
   hbaseTable.len = extNameForHbase.length();
 
   // drop this table from hbase
-  retcode = dropHbaseTable(ehi, &hbaseTable, FALSE);
+  NABoolean ddlXns = ddlExpr->ddlXns();
+  retcode = dropHbaseTable(ehi, &hbaseTable, FALSE, ddlXns);
   if (retcode)
     {
       deallocEHI(ehi); 
@@ -8026,7 +8097,8 @@ void CmpSeabaseDDL::purgedataHbaseTable(DDLExpr * ddlExpr,
   retcode = createHbaseTable(ehi, &hbaseTable, trafColFamVec,
                              hbaseCreateOptions,
                              numSplits, keyLength, 
-                             encodedKeysBuffer);
+                             encodedKeysBuffer,
+                             TRUE, ddlXns);
   if (retcode == -1)
     {
       deallocEHI(ehi); 
@@ -8059,7 +8131,7 @@ void CmpSeabaseDDL::purgedataHbaseTable(DDLExpr * ddlExpr,
           hbaseIndex.len = extNameForIndex.length();
           
           // drop this table from hbase
-          retcode = dropHbaseTable(ehi, &hbaseIndex, FALSE);
+          retcode = dropHbaseTable(ehi, &hbaseIndex, FALSE, ddlXns);
           if (retcode)
             {
               deallocEHI(ehi); 
@@ -8167,35 +8239,71 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
     }
 
   NABoolean startXn = TRUE;
-  if ((ddlExpr->dropHbase()) ||
-      (ddlExpr->purgedataHbase()) ||
-      (ddlExpr->initHbase()) ||
-      (ddlExpr->createMDViews()) ||
-      (ddlExpr->dropMDViews()) ||
-      (ddlExpr->initAuthorization()) ||
-      (ddlExpr->dropAuthorization()) ||
-      (ddlExpr->addSeqTable()) ||
-      (ddlExpr->createRepos()) ||
-      (ddlExpr->dropRepos()) ||
-      (ddlExpr->upgradeRepos()) ||
-      (ddlExpr->addSchemaObjects()) ||
-      (ddlExpr->updateVersion()) ||
-      ((ddlNode) &&
-      // TODO: When making ALTER TABLE/INDEX transactional, add cases here for them
-       ((ddlNode->getOperatorType() == DDL_DROP_SCHEMA) ||
-        (ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
-        (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY) ||
-        (ddlNode->getOperatorType() ==  DDL_ALTER_TABLE_ALTER_COLUMN_SET_SG_OPTION) ||
-        (ddlNode->getOperatorType() == DDL_CREATE_INDEX) ||
-        (ddlNode->getOperatorType() == DDL_POPULATE_INDEX) ||
-        (ddlNode->getOperatorType() == DDL_CREATE_TABLE) ||
-        (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
-        (ddlNode->getOperatorType() == DDL_DROP_TABLE))))
+
+  // no DDL transactions.
+  if ((NOT ddlExpr->ddlXns()) &&
+      ((ddlExpr->dropHbase()) ||
+       (ddlExpr->purgedataHbase()) ||
+       (ddlExpr->initHbase()) ||
+       (ddlExpr->createMDViews()) ||
+       (ddlExpr->dropMDViews()) ||
+       (ddlExpr->initAuthorization()) ||
+       (ddlExpr->dropAuthorization()) ||
+       (ddlExpr->addSeqTable()) ||
+       (ddlExpr->createRepos()) ||
+       (ddlExpr->dropRepos()) ||
+       (ddlExpr->upgradeRepos()) ||
+       (ddlExpr->addSchemaObjects()) ||
+       (ddlExpr->updateVersion())))
+    {
+      // transaction will be started and commited in called methods.
+      startXn = FALSE;
+    }
+  
+  // no DDL transactions
+  if (((ddlNode) && (ddlNode->castToStmtDDLNode()) &&
+       (NOT ddlNode->castToStmtDDLNode()->ddlXns())) &&
+      ((ddlNode->getOperatorType() == DDL_DROP_SCHEMA) ||
+       (ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
+       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY) ||
+       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_ALTER_COLUMN_SET_SG_OPTION) ||
+       (ddlNode->getOperatorType() == DDL_CREATE_INDEX) ||
+       (ddlNode->getOperatorType() == DDL_POPULATE_INDEX) ||
+       (ddlNode->getOperatorType() == DDL_CREATE_TABLE) ||
+       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
+       (ddlNode->getOperatorType() == DDL_DROP_TABLE)))
+    {
+      // transaction will be started and commited in called methods.
+      startXn = FALSE;
+    }
+  
+  // ddl transactions are on.
+  // Following commands currently require transactions be started and
+  // committed in the called methods.
+  if ((ddlExpr->ddlXns()) &&
+      (
+           (ddlExpr->purgedataHbase()) ||
+           (ddlExpr->initAuthorization()) ||
+           (ddlExpr->dropAuthorization()) ||
+           (ddlExpr->upgradeRepos())
+       )
+      )
     {
       // transaction will be started and commited in called methods.
       startXn = FALSE;
     }
 
+  // ddl transactions are on.
+  // Cleanup command requires transactions to be started and commited
+  // in the called method.
+  if ((ddlNode && ddlNode->castToStmtDDLNode() &&
+       ddlNode->castToStmtDDLNode()->ddlXns()) &&
+      (ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS))
+    {
+      // transaction will be started and commited in called methods.
+      startXn = FALSE;
+    }
+  
   if (startXn)
     {
       if (beginXnIfNotInProgress(&cliInterface, xnWasStartedHere))
@@ -8204,11 +8312,11 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
 
   if (ddlExpr->initHbase()) 
     {
-      initSeabaseMD();
+      initSeabaseMD(ddlExpr->ddlXns());
     }
   else if (ddlExpr->dropHbase())
     {
-      dropSeabaseMD();
+      dropSeabaseMD(ddlExpr->ddlXns());
     }
   else if (ddlExpr->createMDViews())
     {
@@ -8224,7 +8332,8 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
       std::vector<std::string> tablesUpgraded;
 
       // Can ignore status returned, diags area contains any unexpected errors
-      initSeabaseAuthorization(&cliInterface, tablesCreated, tablesUpgraded);
+      initSeabaseAuthorization(&cliInterface, ddlExpr->ddlXns(),
+                               tablesCreated, tablesUpgraded);
 
 #ifdef _DEBUG
       // Do we want to display this information?  Base it on a cqd or envvar?
@@ -8706,6 +8815,7 @@ short CmpSeabaseDDL::executeSeabaseDDL(DDLExpr * ddlExpr, ExprNode * ddlNode,
     } // else
   
 label_return:
+
   restoreAllControlsAndFlags();
 
   if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_))

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
index ca4f0be..89c00bc 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLindex.cpp
@@ -686,8 +686,11 @@ void CmpSeabaseDDL::createSeabaseIndex(
       extNameForHbase = catalogNamePart + "." + schemaNamePart + "." + objectNamePart;
     }
   
-  retcode = existsInSeabaseMDTable(&cliInterface, 
-				   catalogNamePart, schemaNamePart, objectNamePart);
+  retcode = existsInSeabaseMDTable
+    (&cliInterface, 
+     catalogNamePart, schemaNamePart, objectNamePart,
+     COM_INDEX_OBJECT, 
+     FALSE/*valid or invalid object*/);
   if (retcode < 0)
     {
       deallocEHI(ehi); 
@@ -696,7 +699,24 @@ void CmpSeabaseDDL::createSeabaseIndex(
 
       return;
     }
-  
+
+  if (retcode == 0) // doesn't exist
+    {
+      retcode = existsInSeabaseMDTable
+        (&cliInterface, 
+         catalogNamePart, schemaNamePart, objectNamePart,
+         COM_UNKNOWN_OBJECT/*check for any object with this name*/, 
+         TRUE/*valid object*/);
+      if (retcode < 0)
+        {
+          deallocEHI(ehi); 
+          
+          processReturn();
+          
+          return;
+        }
+    }
+
   if (retcode == 1) // already exists
     {
       if (1) //NOT createIndexNode->createIfNotExists())
@@ -806,6 +826,8 @@ void CmpSeabaseDDL::createSeabaseIndex(
         }
     }
 
+  NABoolean ddlXns = FALSE;
+
   Lng32 keyColCount = 0;
   Lng32 nonKeyColCount = 0;
   Lng32 totalColCount = 0;
@@ -936,10 +958,12 @@ void CmpSeabaseDDL::createSeabaseIndex(
 
   endXnIfStartedHere(&cliInterface, xnWasStartedHere, 0);
 
+  ddlXns = createIndexNode->ddlXns();
   if (createHbaseTable(ehi, &hbaseIndex, trafColFam.data(),
                        &hbaseCreateOptions,
                        numSplits, keyLength, 
-                       encodedKeysBuffer) == -1)
+                       encodedKeysBuffer,
+                       FALSE, ddlXns) == -1)
     {
       goto label_error_drop_index;
     }
@@ -954,7 +978,8 @@ void CmpSeabaseDDL::createSeabaseIndex(
 
       if (indexOpt)
         {
-          // validate that table is empty
+          // validate that table is empty.
+          // If table is empty, no need to load data into the index.
           HbaseStr tblName;
           tblName.val = (char*)extTableNameForHbase.data();
           tblName.len = extNameForHbase.length();
@@ -981,10 +1006,6 @@ void CmpSeabaseDDL::createSeabaseIndex(
               goto label_error_drop_index;
             }
         }
-      else
-        {
-          // TBD. Validate that table is empty.
-        }
 
       if (updateObjectAuditAttr(&cliInterface, 
 			       catalogNamePart, schemaNamePart, objectNamePart,
@@ -1013,9 +1034,11 @@ void CmpSeabaseDDL::createSeabaseIndex(
 
   if (!Get_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL))
     {
-      ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-                                                      NATableDB::REMOVE_FROM_ALL_USERS, 
-                                                      COM_BASE_TABLE_OBJECT);
+      ActiveSchemaDB()->getNATableDB()->removeNATable
+        (cn,
+         ComQiScope::REMOVE_FROM_ALL_USERS, 
+         COM_BASE_TABLE_OBJECT,
+         createIndexNode->ddlXns(), FALSE);
     }
 
   return;
@@ -1031,7 +1054,8 @@ void CmpSeabaseDDL::createSeabaseIndex(
 
   cleanupObjectAfterError(cliInterface, 
                           catalogNamePart, schemaNamePart, objectNamePart,
-                          COM_INDEX_OBJECT);
+                          COM_INDEX_OBJECT,
+                          createIndexNode->ddlXns());
 
   deallocEHI(ehi);
 
@@ -1659,7 +1683,8 @@ void CmpSeabaseDDL::dropSeabaseIndex(
      }
 
   if (dropSeabaseObject(ehi, idxName,
-			currCatName, currSchName, COM_INDEX_OBJECT))
+			currCatName, currSchName, COM_INDEX_OBJECT,
+                        dropIndexNode->ddlXns()))
     {
       processReturn();
 
@@ -1681,17 +1706,23 @@ void CmpSeabaseDDL::dropSeabaseIndex(
 
   // remove NATable for the base table of this index
   CorrName cn(btObjName, STMTHEAP, btSchName, btCatName);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     dropIndexNode->ddlXns(), FALSE);
 
   // remove NATable for this index in its real form as well as in its index_table
   // standalone format
   CorrName cni(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cni,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_INDEX_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cni,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_INDEX_OBJECT,
+     dropIndexNode->ddlXns(), FALSE);
   cni.setSpecialType(ExtendedQualName::INDEX_TABLE);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cni,
-    NATableDB::REMOVE_MINE_ONLY, COM_INDEX_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cni,
+     ComQiScope::REMOVE_MINE_ONLY, COM_INDEX_OBJECT,
+     dropIndexNode->ddlXns(), FALSE);
   
   //  processReturn();
 
@@ -1818,12 +1849,16 @@ void CmpSeabaseDDL::alterSeabaseTableDisableOrEnableIndex(
 
   // remove NATable for the base table of this index
   CorrName cn(btObjName, STMTHEAP, btSchName, btCatName);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     ddlNode->castToStmtDDLNode()->ddlXns(), FALSE);
   // Also, remove index.
   CorrName cni(objectNamePart, STMTHEAP, schemaNamePart, catalogNamePart);
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cni,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_INDEX_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cni,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_INDEX_OBJECT,
+     ddlNode->castToStmtDDLNode()->ddlXns(), FALSE);
 
   //  processReturn();
 
@@ -1946,8 +1981,10 @@ void CmpSeabaseDDL::alterSeabaseTableDisableOrEnableAllIndexes(
         return;
     }
     CorrName cn( objectNamePart, STMTHEAP, NAString(schName), NAString(catName));
-    ActiveSchemaDB()->getNATableDB()->removeNATable(cn, 
-      NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT);
+    ActiveSchemaDB()->getNATableDB()->removeNATable
+      (cn, 
+       ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+       ddlNode->castToStmtDDLNode()->ddlXns(), FALSE);
   }
 
   return ;
@@ -2105,7 +2142,8 @@ void CmpSeabaseDDL::alterSeabaseIndexHBaseOptions(
   result = alterHbaseTable(ehi,
                            &hbaseTable,
                            nal,
-                           &(edhbo->getHbaseOptions()));
+                           &(edhbo->getHbaseOptions()),
+                           hbaseOptionsNode->ddlXns());
   if (result < 0)
     {
       deallocEHI(ehi);
@@ -2115,8 +2153,10 @@ void CmpSeabaseDDL::alterSeabaseIndexHBaseOptions(
 
   // invalidate cached NATable info on this table for all users
 
-  ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-    NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT);
+  ActiveSchemaDB()->getNATableDB()->removeNATable
+    (cn,
+     ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+     hbaseOptionsNode->ddlXns(), FALSE);
 
   deallocEHI(ehi); 
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
index 5868ebc..43fd8d3 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp
@@ -206,7 +206,7 @@ short CmpSeabaseMDupgrade::dropReposTables(ExpHbaseInterface *ehi,
       hbaseTable.val = (char*)extNameForHbase.data();
       hbaseTable.len = extNameForHbase.length();
       
-      retcode = dropHbaseTable(ehi, &hbaseTable);
+      retcode = dropHbaseTable(ehi, &hbaseTable, FALSE, FALSE);
       if (retcode < 0)
 	{
 	  errcode = -1;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index 975375e..85a3f26 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -521,6 +521,7 @@ void CmpSeabaseDDL::dropSeabaseLibrary(StmtDDLDropLibrary * dropLibraryNode,
 
      if (dropSeabaseObject(ehi, routineName,
                            currCatName, currSchName, objectType,
+                           dropLibraryNode->ddlXns(),
                            TRUE, FALSE))
      {
        deallocEHI(ehi); 
@@ -532,6 +533,7 @@ void CmpSeabaseDDL::dropSeabaseLibrary(StmtDDLDropLibrary * dropLibraryNode,
   // can get a slight perf. gain if we pass in objUID
   if (dropSeabaseObject(ehi, objName,
                         currCatName, currSchName, COM_LIBRARY_OBJECT,
+                        dropLibraryNode->ddlXns(),
                         TRUE, FALSE))
     {
       deallocEHI(ehi); 
@@ -1293,7 +1295,9 @@ void CmpSeabaseDDL::dropSeabaseRoutine(StmtDDLDropRoutine * dropRoutineNode,
   
   // Removed routine from metadata 
   if (dropSeabaseObject(ehi, dropRoutineNode->getRoutineName(),
-                        currCatName, currSchName, COM_USER_DEFINED_ROUTINE_OBJECT,
+                        currCatName, currSchName, 
+                        COM_USER_DEFINED_ROUTINE_OBJECT,
+                        dropRoutineNode->ddlXns(),
                         TRUE, FALSE))
     {
       deallocEHI(ehi); 
@@ -1303,7 +1307,7 @@ void CmpSeabaseDDL::dropSeabaseRoutine(StmtDDLDropRoutine * dropRoutineNode,
 
   // Remove cached entries in other processes
   pRoutineDBCache->removeNARoutine(qualRoutineName, 
-                                   NARoutineDB::REMOVE_FROM_ALL_USERS,
+                                   ComQiScope::REMOVE_FROM_ALL_USERS,
                                    objUID);
 
   deallocEHI(ehi);      

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/cd9f7a1a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 0e0bf64..34a8cf0 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -60,7 +60,8 @@ static bool dropOneTable(
    const char * catalogName, 
    const char * schemaName, 
    const char * objectName,
-   bool isVolatile);
+   bool isVolatile,
+   bool ddlXns);
    
 static bool transferObjectPrivs(
    const char * systemCatalogName, 
@@ -98,8 +99,10 @@ static bool transferObjectPrivs(
 // *                                                                           *
 // * Returns: status
 // *                                                                           *
-// *   0: Schema was added                                                      *
+// *   0: Schema was added                                                     *
 // *  -1: Schema was not added.  A CLI error is put into the diags area.       *
+// *   1: Schema already exists and ignoreIfExists is specified.               *
+// *      No error is added to the diags area.                                 *
 // *                                                                           *
 // *****************************************************************************
 int CmpSeabaseDDL::addSchemaObject(
@@ -136,7 +139,7 @@ Lng32 retcode = existsInSeabaseMDTable(&cliInterface,catalogName,schemaNamePart,
    if (retcode == 1 ) // already exists
    {
       if (ignoreIfExists)
-        return 0;
+        return 1;
       else
         *CmpCommon::diags() << DgSqlCode(-CAT_SCHEMA_ALREADY_EXISTS)
                             << DgSchemaName(schemaName.getExternalName().data());
@@ -545,7 +548,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
        dirtiedMetadata = TRUE;
        if (dropOneTable(cliInterface,(char*)catName.data(),
                         (char*)schName.data(),(char*)objName.data(),
-                         isVolatile))
+                        isVolatile, dropSchemaNode->ddlXns()))
           someObjectsCouldNotBeDropped = true;
      }
    }
@@ -650,7 +653,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
             dirtiedMetadata = TRUE;
             if (dropOneTable(cliInterface,(char*)catName.data(), 
                              (char*)schName.data(),(char*)objName.data(),
-                             isVolatile))
+                             isVolatile, dropSchemaNode->ddlXns()))
                someObjectsCouldNotBeDropped = true;
          }
       } 
@@ -743,7 +746,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
    if (dropSchemaNode->dropObjectsOnly())
       return;
 
-   // Verify all objects in the schema have been dropped.   
+  // Verify all objects in the schema have been dropped. 
    str_sprintf(query,"SELECT COUNT(*) "
                      "FROM %s.\"%s\".%s "
                      "WHERE catalog_name = '%s' AND schema_name = '%s' AND "
@@ -762,7 +765,7 @@ void CmpSeabaseDDL::dropSeabaseSchema(StmtDDLDropSchema * dropSchemaNode)
    
    if (rowCount > 0)
    {
-      CmpCommon::diags()->clear();
+     CmpCommon::diags()->clear();
       
       *CmpCommon::diags() << DgSqlCode(-CAT_UNABLE_TO_DROP_SCHEMA)
                           << DgSchemaName(catName + "." + schName);
@@ -1147,7 +1150,8 @@ static bool dropOneTable(
    const char * catalogName, 
    const char * schemaName, 
    const char * objectName,
-   bool isVolatile)
+   bool isVolatile,
+   bool ddlXns)
    
 {
 
@@ -1193,8 +1197,10 @@ ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF);
 // remove NATable entry for this table
    CorrName cn(objectName,STMTHEAP,schemaName,catalogName);
 
-   ActiveSchemaDB()->getNATableDB()->removeNATable(cn,
-     NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT);
+   ActiveSchemaDB()->getNATableDB()->removeNATable
+     (cn,
+      ComQiScope::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT,
+      ddlXns, FALSE);
 
    return someObjectsCouldNotBeDropped;
    


Mime
View raw message