You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by rm...@apache.org on 2016/02/16 23:11:22 UTC

[3/5] incubator-trafodion git commit: TRAFODION-1789 & TRAFODION-1812

TRAFODION-1789 & TRAFODION-1812

TRAFODION-1789: Create the histogram metadata tables at schema creation time

Added a list of MDTableInfo structs called allMDHistInfo that describes
histogram tables similar to other metadata tables in CmpSeabaseDDLmd.h.
During schema create, this list is traversed and each histogram table created.
This is performed by calling the static function - createHistogramTables.
Similarily, this list is traversed at drop schema time to drop existing
histogram tables.  With this change, you can drop a schema without the
cascade option when only histogram tables remain.

In histogram code (hs_cli.cpp), removed hard coded create statements and
changed code to call the createHistogramTables static function.  With this
change, there is only one place where Histogram tables are defined.  Today,
histogram tables are defined in ../sqlcomp/CmpSeabaseDDLmd.h and
../ustat/hs_cli.cpp

TRAFODION-1812: cleanup schema causes transaction to hang in aborting state

While testing the fix for TRAFODION-1789, some of the regression tests failed.
There is an issue when trying to cleanup a schema that contains histogram
tables. Changes were made to cleanup histogram tables first and to avoid
deleting histogram entries for the histogram table itself.

Added IF EXISTS syntax to routine drops. Also added IF NOT EXISTS syntax to
routine creates. The DROP IF EXISTS was needed to fix an issue when dropping
routines as part of drop schema code.


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

Branch: refs/heads/master
Commit: a22f6853e07ebc917340dc08d2582f8147bae2b1
Parents: 3a1b73c
Author: Roberta Marton <ro...@apache.org>
Authored: Fri Feb 12 16:00:47 2016 +0000
Committer: Roberta Marton <ro...@apache.org>
Committed: Fri Feb 12 16:00:47 2016 +0000

----------------------------------------------------------------------
 core/sql/bin/SqlciErrors.txt              |   4 +-
 core/sql/optimizer/RelExeUtil.cpp         |   7 +
 core/sql/parser/SqlParserAux.cpp          |   4 +
 core/sql/parser/SqlParserAux.h            |   1 +
 core/sql/parser/StmtDDLCreateRoutine.h    |   4 +
 core/sql/parser/StmtDDLDropRoutine.h      |   5 +
 core/sql/parser/sqlparser.y               |  88 +++--
 core/sql/regress/hive/EXPECTED009         |   6 +-
 core/sql/regress/privs1/EXPECTED133       |  12 +-
 core/sql/regress/privs1/EXPECTED141       | Bin 92809 -> 113222 bytes
 core/sql/regress/privs2/EXPECTED138       |  84 +++-
 core/sql/regress/privs2/EXPECTED140       | 324 ++++++++-------
 core/sql/regress/privs2/TEST140           |   2 +-
 core/sql/regress/seabase/EXPECTED002      | 146 +++++--
 core/sql/regress/seabase/EXPECTED026      |  34 +-
 core/sql/regress/seabase/FILTER002        |   1 +
 core/sql/sqlcomp/CmpDDLCatErrorCodes.h    |   4 +-
 core/sql/sqlcomp/CmpSeabaseDDL.h          |   7 +
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp |  33 +-
 core/sql/sqlcomp/CmpSeabaseDDLmd.h        |  11 +
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp  | 521 ++++++++++++++++---------
 core/sql/ustat/hs_cli.cpp                 | 118 +-----
 23 files changed, 890 insertions(+), 536 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index a08db70..163c677 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -57,7 +57,7 @@
 1055 ZZZZZ 99999 BEGINNER MINOR LOGONLY Object $0~TableName already exists.
 1056 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Request: alter view $0~string0 compile failed. Prepare of the view's select statement encountered error  $1~Int1. 
 1057 ZZZZZ 99999 BEGINNER MAJOR DBADMIN SQL objects cannot be created on $0~String0: File system error $1~NSKCode.
-1058 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Lock $0~TableName already exists.
+1058 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Unable to create histogram table $0~TableName.
 1059 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Request failed.  Dependent constraint $0~ConstraintName exists.
 1060 ZZZZZ 99999 BEGINNER MINOR DBADMIN Request failed. View $0~string0 is invalid. 
 1061 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Dropping metadata catalog $0~CatalogName is not allowed.
@@ -72,7 +72,7 @@
 1070 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Object $0~TableName could not be created. File error: $1~Int0.
 1071 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Object $0~TableName could not be accessed. 
 1072 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Unique constraint $0~String0 is disabled, so foreign key constraint $1~ConstraintName could not be created.
-1073 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Only services ID can execute INITIALIZE SQL.
+1073 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Schema $0~SchemaName was partially dropped, call CLEANUP SCHEMA to remove remaining entries.
 1074 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Unable to create synonym: $0~String0, as part of re-compile for view $0~TableName.
 1075 ZZZZZ 99999 BEGINNER MAJOR DBADMIN The catalog must be empty.  It contains at least one schema $0~SchemaName.
 1076 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Unable to grant privilege: $0~String0, as part of re-compile for view $0~TableName.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/optimizer/RelExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelExeUtil.cpp b/core/sql/optimizer/RelExeUtil.cpp
index 8bdde02..88fa66a 100644
--- a/core/sql/optimizer/RelExeUtil.cpp
+++ b/core/sql/optimizer/RelExeUtil.cpp
@@ -3940,6 +3940,13 @@ RelExpr * DDLExpr::bindNode(BindWA *bindWA)
 
       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
+      // 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())
+        hbaseDDLNoUserXn_ = TRUE;
+
       // Drops of Hive and HBase external tables are allowed 
       if (qualObjName_.isHive() || (qualObjName_.isHbase()))
         {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/parser/SqlParserAux.cpp
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.cpp b/core/sql/parser/SqlParserAux.cpp
index 94bbc85..6b2ac29 100644
--- a/core/sql/parser/SqlParserAux.cpp
+++ b/core/sql/parser/SqlParserAux.cpp
@@ -3180,6 +3180,7 @@ SqlParserAux_buildDropRoutine ( ComRoutineType  drop_routine_type_tokens  // in
                               , ComDropBehavior optional_drop_behavior    // in
                               , NABoolean       optional_validate         // in
                               , NAString      * optional_logfile          // in - deep copy
+                              , NABoolean       optional_if_exists        // in
                               )
 {
   // If CLEANUP, VALIDATE, or LOG option specified,
@@ -3230,6 +3231,9 @@ SqlParserAux_buildDropRoutine ( ComRoutineType  drop_routine_type_tokens  // in
     , pLogFile                       // in - NAString *      - shallow copy
     , PARSERHEAP()
     );
+
+  pNode99->castToStmtDDLDropRoutine()->setDropIfExists(optional_if_exists);
+
   // Do not delete pLogFile because we did a shallow copy
   return pNode99;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/parser/SqlParserAux.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/SqlParserAux.h b/core/sql/parser/SqlParserAux.h
index d7ac3dd..f669785 100644
--- a/core/sql/parser/SqlParserAux.h
+++ b/core/sql/parser/SqlParserAux.h
@@ -859,6 +859,7 @@ SqlParserAux_buildDropRoutine ( ComRoutineType  drop_routine_type_tokens  // in
                               , ComDropBehavior optional_drop_behavior    // in
                               , NABoolean       optional_validate         // in
                               , NAString      * optional_logfile          // in - deep copy
+                              , NABoolean       optional_if_exists        // in
                               );
 
 ElemDDLNode *

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/parser/StmtDDLCreateRoutine.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLCreateRoutine.h b/core/sql/parser/StmtDDLCreateRoutine.h
index 8eb287b..55a5976 100644
--- a/core/sql/parser/StmtDDLCreateRoutine.h
+++ b/core/sql/parser/StmtDDLCreateRoutine.h
@@ -178,6 +178,9 @@ public:
   inline ElemDDLNode * getPassThroughInputsParseTree(void);
   inline ElemDDLNode * getRoutineAttributesParseTree(void);
 
+  NABoolean createIfNotExists() { return createIfNotExists_; }
+  void setCreateIfNotExists(NABoolean v) { createIfNotExists_ = v; }
+
   //
   // mutators
   //
@@ -373,6 +376,7 @@ protected:
 
   ElemDDLGrantee      *pOwner_;
 
+  NABoolean           createIfNotExists_;
   //
   // pointers to child parse nodes
   //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/parser/StmtDDLDropRoutine.h
----------------------------------------------------------------------
diff --git a/core/sql/parser/StmtDDLDropRoutine.h b/core/sql/parser/StmtDDLDropRoutine.h
index 673911a..5005b4c 100644
--- a/core/sql/parser/StmtDDLDropRoutine.h
+++ b/core/sql/parser/StmtDDLDropRoutine.h
@@ -90,6 +90,9 @@ public:
   inline const NABoolean isLogFileSpecified() const;
   inline const NAString & getLogFile() const;
 
+  const NABoolean dropIfExists() const { return dropIfExists_; }
+  void setDropIfExists(NABoolean v) { dropIfExists_ = v; }
+
   // for binding
   ExprNode * bindNode(BindWA *bindWAPtr);
 
@@ -108,6 +111,8 @@ private:
   NABoolean isCleanupSpec_;
   NABoolean isValidateSpec_;
   NAString  *pLogFile_;
+  NABoolean dropIfExists_;
+
 
 
 }; // class StmtDDLDropRoutine

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/parser/sqlparser.y
----------------------------------------------------------------------
diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y
index b158446..4e8033d 100755
--- a/core/sql/parser/sqlparser.y
+++ b/core/sql/parser/sqlparser.y
@@ -2905,6 +2905,7 @@ static void enableMakeQuotedStringISO88591Mechanism()
 %type <boolean>   	       optional_validate_clause
 %type <extractType>            extract_type
 %type <boolean>                optional_if_not_exists_clause
+%type <boolean>                optional_if_exists_clause
 
 %type <uint>                    merge_stmt_start_tokens
 %type <relx>                   merge_stmt_using_clause
@@ -23458,7 +23459,7 @@ external_user_identifier : identifier
 
 /* type pStmtDDL */
 
-routine_definition : TOK_CREATE TOK_PROCEDURE ddl_qualified_name
+routine_definition : TOK_CREATE TOK_PROCEDURE optional_if_not_exists_clause ddl_qualified_name
                         routine_params_list_clause
                         optional_create_routine_attribute_list
                         optional_by_auth_identifier
@@ -23466,22 +23467,23 @@ routine_definition : TOK_CREATE TOK_PROCEDURE ddl_qualified_name
                                   QualifiedName noActionQualName(PARSERHEAP());
                                   StmtDDLCreateRoutine *pNode =
                                     new (PARSERHEAP()) StmtDDLCreateRoutine
-                                    ( *$3  // ddl_qualified_name of SPJs
+                                    ( *$4  // ddl_qualified_name of SPJs
                                     , noActionQualName
-                                    , $4   // ElemDDLNode *  routine_params_list_clause
+                                    , $5   // ElemDDLNode *  routine_params_list_clause
                                     , NULL // ElemDDLNode *  optional_routine_returns_clause
                                     , NULL // ElemDDLNode *  optional_passthrough_inputs_clause
-                                    , $5   // ElemDDLNode *  optional_create_routine_attribute_list
+                                    , $6   // ElemDDLNode *  optional_create_routine_attribute_list
                                     , COM_PROCEDURE_TYPE // ComRoutineType
                                     , PARSERHEAP()
                                     );
-                                  pNode->setOwner($6/*optional_by_auth_identifier*/);
+                                  pNode->setCreateIfNotExists($3);
+                                  pNode->setOwner($7/*optional_by_auth_identifier*/);
                                   pNode->synthesize();
                                   $$ = pNode;
-                                  delete $3;  // ddl_qualified_name of routine
+                                  delete $4;  // ddl_qualified_name of routine
                                 }
 
-  | TOK_CREATE create_scalar_function_tokens ddl_qualified_name
+  | TOK_CREATE create_scalar_function_tokens optional_if_not_exists_clause ddl_qualified_name
     routine_params_list_clause
     optional_routine_returns_clause
     optional_passthrough_inputs_clause
@@ -23490,21 +23492,23 @@ routine_definition : TOK_CREATE TOK_PROCEDURE ddl_qualified_name
       QualifiedName noActionQualName(PARSERHEAP());
       StmtDDLCreateRoutine *pNode =
         new (PARSERHEAP()) StmtDDLCreateRoutine
-        ( *$3 // ddl_qualified_name of scalar function
+        ( *$4 // ddl_qualified_name of scalar function
           , noActionQualName
-          , $4  // ElemDDLNode *  routine_params_list_clause
-          , $5  // ElemDDLNode *  optional_routine_returns_clause
-          , $6  // ElemDDLNode *  optional_passthrough_inputs_clause
-          , $7  // ElemDDLNode *  optional_create_function_attribute_list
+          , $5  // ElemDDLNode *  routine_params_list_clause
+          , $6  // ElemDDLNode *  optional_routine_returns_clause
+          , $7  // ElemDDLNode *  optional_passthrough_inputs_clause
+          , $8  // ElemDDLNode *  optional_create_function_attribute_list
           , COM_SCALAR_UDF_TYPE // ComRoutineType create_scalar_function_tokens
           , PARSERHEAP()
           );
+      pNode->setCreateIfNotExists($3); 
       pNode->synthesize();
       $$ = pNode;
-      delete $3;  // ddl_qualified_name of routine
+      delete $4;  // ddl_qualified_name of routine
     }
 
-  | TOK_CREATE table_mapping_function_tokens ddl_qualified_name
+  | TOK_CREATE table_mapping_function_tokens optional_if_not_exists_clause 
+    ddl_qualified_name
     routine_params_list_clause
     optional_routine_returns_clause
     optional_passthrough_inputs_clause
@@ -23514,41 +23518,44 @@ routine_definition : TOK_CREATE TOK_PROCEDURE ddl_qualified_name
       QualifiedName noActionQualName(PARSERHEAP());
       StmtDDLCreateRoutine *pNode =
         new (PARSERHEAP()) StmtDDLCreateRoutine
-        ( *$3 // ddl_qualified_name of scalar function
+        ( *$4 // ddl_qualified_name of scalar function
           , noActionQualName
-          , $4  // ElemDDLNode *  routine_params_list_clause
-          , $5  // ElemDDLNode *  optional_routine_returns_clause
-          , $6  // ElemDDLNode *  optional_passthrough_inputs_clause
-          , $7  // ElemDDLNode *  optional_create_function_attribute_list
+          , $5  // ElemDDLNode *  routine_params_list_clause
+          , $6  // ElemDDLNode *  optional_routine_returns_clause
+          , $7  // ElemDDLNode *  optional_passthrough_inputs_clause
+          , $8  // ElemDDLNode *  optional_create_function_attribute_list
           , COM_TABLE_UDF_TYPE // ComRoutineType table_mapping_function_tokens
           , PARSERHEAP()
           );
-      pNode->setOwner($8/*optional_by_auth_identifier*/);
+      pNode->setCreateIfNotExists($3);
+      pNode->setOwner($9/*optional_by_auth_identifier*/);
       pNode->synthesize();
       $$ = pNode;
-      delete $3;  // ddl_qualified_name of routine
+      delete $4;  // ddl_qualified_name of routine
     }
 
-  | TOK_CREATE universal_function_tokens ddl_qualified_name
+  | TOK_CREATE universal_function_tokens optional_if_not_exists_clause 
+    ddl_qualified_name
     universal_function_param_clause
     optional_create_function_attribute_list
     {
       QualifiedName noActionQualName(PARSERHEAP());
       StmtDDLCreateRoutine *pNode =
         new (PARSERHEAP()) StmtDDLCreateRoutine
-        ( *$3  // ddl_qualified_name of universal function
+        ( *$4  // ddl_qualified_name of universal function
           , noActionQualName
           , NULL // ElemDDLNode * optional_routine_params_list
           , NULL // ElemDDLNode * optional_routine_returns_clause
           , NULL // ElemDDLNode * optional_passthrough_inputs_clause
-          , $5   // ElemDDLNode * optional_create_function_attribute_list
+          , $6   // ElemDDLNode * optional_create_function_attribute_list
           , COM_UNIVERSAL_UDF_TYPE // ComRoutineType universal_function_tokens
           , PARSERHEAP()
           );
-      pNode->setUudfParamKindList($4); // universal_function_param_clause
+      pNode->setCreateIfNotExists($3);
+      pNode->setUudfParamKindList($5); // universal_function_param_clause
       pNode->synthesize();
       $$ = pNode;
-      delete $3;  // ddl_qualified_name of routine
+      delete $4;  // ddl_qualified_name of routine
     }
 
 /* type routineTypeEnum */
@@ -24753,6 +24760,17 @@ optional_if_not_exists_clause :
                     $$ = TRUE;
                   }
 
+/* type boolean */
+optional_if_exists_clause :
+          empty
+            {
+               $$ = FALSE;
+             }
+          | TOK_IF TOK_EXISTS
+             {
+               $$ = TRUE;
+             }
+
 
 create_table_as_attr_list_start: empty
 	           {
@@ -31882,20 +31900,22 @@ drop_routine_type_tokens : TOK_FUNCTION { $$ = COM_UNKNOWN_ROUTINE_TYPE; }
                          | TOK_PROCEDURE { $$ = COM_PROCEDURE_TYPE; }
 
 /* type pStmtDDL */
-drop_routine_statement : TOK_DROP drop_routine_type_tokens ddl_qualified_name
+drop_routine_statement : TOK_DROP drop_routine_type_tokens optional_if_exists_clause
+                         ddl_qualified_name
                          optional_cleanup  optional_drop_behavior
                          optional_validate optional_logfile
                 {
                   $$ = SqlParserAux_buildDropRoutine
                     ( $2  // in - ComRoutineType drop_routine_type_tokens
-                    , $3  // in - QualifiedName * ddl_qualified_name of routine - deep copy
-                    , $4  // in - NABoolean       optional_cleanup
-                    , $5  // in - ComDropBehavior optional_drop_behavior
-                    , $6  // in - NABoolean       optional_validate
-                    , $7  // in - NAString      * optional_logfile              - deep copy
+                    , $4  // in - QualifiedName * ddl_qualified_name of routine - deep copy
+                    , $5  // in - NABoolean       optional_cleanup
+                    , $6  // in - ComDropBehavior optional_drop_behavior
+                    , $7  // in - NABoolean       optional_validate
+                    , $8  // in - NAString      * optional_logfile              - deep copy
+                    , $3  // in - NABoolean       optional_if_exists_clause
                     );
-                  delete $3; // ddl_qualified_name of routine
-                  if ($7) delete $7; // optional_logfile
+                  delete $4; // ddl_qualified_name of routine
+                  if ($8) delete $8; // optional_logfile
                   if ($$ EQU NULL) { yyerror(""); YYERROR; } // Error: internal syntax only!
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/regress/hive/EXPECTED009
----------------------------------------------------------------------
diff --git a/core/sql/regress/hive/EXPECTED009 b/core/sql/regress/hive/EXPECTED009
index 489dc77..0f4be9e 100644
--- a/core/sql/regress/hive/EXPECTED009
+++ b/core/sql/regress/hive/EXPECTED009
@@ -363,6 +363,8 @@ PROMOTION
 Tables in Schema TRAFODION.HIVE_T009
 ====================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 T009T1
 
 --- SQL operation complete.
@@ -442,8 +444,6 @@ End of MXCI Session
 CATALOG_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      SCHEMA_NAME                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                OBJECT_NAME
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----------------------------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
-HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                CUSTOMER                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
-HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                ITEM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
 HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                PROMOTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
 HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                T009T1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
 HIVE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              SCH_T009                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
                                T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
@@ -451,7 +451,7 @@ TRAFODION
 TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _HV_SCH_T009_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                T009T2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
 TRAFODION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         _MD_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                OBJECTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
 
---- 8 row(s) selected.
+--- 6 row(s) selected.
 >>drop external table t009t1 for hive.sch_t009.t009t1;
 
 *** ERROR[1389] Object TRAFODION."_HV_SCH_T009_".T009T1 does not exist in Trafodion.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/regress/privs1/EXPECTED133
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/EXPECTED133 b/core/sql/regress/privs1/EXPECTED133
index 4bd4913..6edbc65 100644
--- a/core/sql/regress/privs1/EXPECTED133
+++ b/core/sql/regress/privs1/EXPECTED133
@@ -276,11 +276,13 @@ TRAFODION.T133SCH.GAMES_BY_PLAYER
 TRAFODION.T133SCH.HOME_TEAMS_GAMES                                                                                                                                VI    DB__ROOT                      33                    33
 TRAFODION.T133SCH.PLAYERS                                                                                                                                         BT    DB__ROOT                      47                    47
 TRAFODION.T133SCH.PLAYERS_ON_TEAM                                                                                                                                 VI    DB__ROOT                      33                    33
+TRAFODION.T133SCH.SB_HISTOGRAMS                                                                                                                                   BT    DB__ROOT                      47                    47
+TRAFODION.T133SCH.SB_HISTOGRAM_INTERVALS                                                                                                                          BT    DB__ROOT                      47                    47
 TRAFODION.T133SCH.STANDINGS                                                                                                                                       BT    DB__ROOT                      47                    47
 TRAFODION.T133SCH.TEAMS                                                                                                                                           BT    DB__ROOT                      47                    47
 TRAFODION.T133SCH.TEAM_STATISTICS                                                                                                                                 BT    DB__ROOT                      47                    47
 
---- 15 row(s) selected.
+--- 17 row(s) selected.
 >>
 >>initialize authorization, drop;
 
@@ -339,6 +341,8 @@ TRAFODION."T133SCH"."GAMES_BY_PLAYER"
 TRAFODION."T133SCH"."HOME_TEAMS_GAMES"                                                                                                                            VI    DB__ROOT                       1                     0
 TRAFODION."T133SCH"."PLAYERS"                                                                                                                                     BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."PLAYERS_ON_TEAM"                                                                                                                             VI    DB__ROOT                       1                     0
+TRAFODION."T133SCH"."SB_HISTOGRAMS"                                                                                                                               BT    DB__ROOT                      47                    47
+TRAFODION."T133SCH"."SB_HISTOGRAM_INTERV                                                                                                                          BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."STANDINGS"                                                                                                                                   BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."TEAMS"                                                                                                                                       BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."TEAM_STATISTICS"                                                                                                                             BT    DB__ROOT                      47                    47
@@ -350,7 +354,7 @@ TRAFODION."_PRIVMGR_MD_"."OBJECT_PRIVILE
 TRAFODION."_PRIVMGR_MD_"."ROLE_USAGE"                                                                                                                             BT    DB__ROOT                      47                    47
 TRAFODION."_PRIVMGR_MD_"."SCHEMA_PRIVILE                                                                                                                          BT    DB__ROOT                      47                    47
 
---- 15 row(s) selected.
+--- 17 row(s) selected.
 >>set parserflags 131072;
 
 --- SQL operation complete.
@@ -398,6 +402,8 @@ TRAFODION."T133SCH"."GAMES_BY_PLAYER"
 TRAFODION."T133SCH"."HOME_TEAMS_GAMES"                                                                                                                            VI    DB__ROOT                       1                     0
 TRAFODION."T133SCH"."PLAYERS"                                                                                                                                     BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."PLAYERS_ON_TEAM"                                                                                                                             VI    DB__ROOT                       1                     0
+TRAFODION."T133SCH"."SB_HISTOGRAMS"                                                                                                                               BT    DB__ROOT                      47                    47
+TRAFODION."T133SCH"."SB_HISTOGRAM_INTERV                                                                                                                          BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."STANDINGS"                                                                                                                                   BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."TEAMS"                                                                                                                                       BT    DB__ROOT                      47                    47
 TRAFODION."T133SCH"."TEAM_STATISTICS"                                                                                                                             BT    DB__ROOT                      47                    47
@@ -409,7 +415,7 @@ TRAFODION."_PRIVMGR_MD_"."OBJECT_PRIVILE
 TRAFODION."_PRIVMGR_MD_"."SCHEMA_PRIVILE                                                                                                                          BT    DB__ROOT                      47                    47
 TRAFODION._PRIVMGR_MD_.ROLE_USAGE                                                                                                                                 BT    DB__ROOT                      47                    47
 
---- 15 row(s) selected.
+--- 17 row(s) selected.
 >>
 >>drop table components;
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/regress/privs1/EXPECTED141
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs1/EXPECTED141 b/core/sql/regress/privs1/EXPECTED141
index 528f189..49eca21 100644
Binary files a/core/sql/regress/privs1/EXPECTED141 and b/core/sql/regress/privs1/EXPECTED141 differ

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a22f6853/core/sql/regress/privs2/EXPECTED138
----------------------------------------------------------------------
diff --git a/core/sql/regress/privs2/EXPECTED138 b/core/sql/regress/privs2/EXPECTED138
index 4134ad2..a67e390 100644
--- a/core/sql/regress/privs2/EXPECTED138
+++ b/core/sql/regress/privs2/EXPECTED138
@@ -14,6 +14,12 @@
 --- SQL operation complete.
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>-- Verify sql_user1 does not have CREATE or CREATE_TABLE privilege
@@ -23,6 +29,12 @@
 >>sh sqlci -i "TEST138(create_tbl)" -u sql_user1;
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>create table user1_t1 (c1 int not null primary key, c2 int);
 
@@ -101,6 +113,12 @@ CREATE_TABLE
 >>sh sqlci -i "TEST138(create_tbl)" -u sql_user1;
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>create table user1_t1 (c1 int not null primary key, c2 int);
 
@@ -178,6 +196,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -364,6 +384,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -383,6 +405,8 @@ USER1_T2
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -398,6 +422,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -416,6 +442,8 @@ USER1_T2
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -428,11 +456,23 @@ USER1_T2
 --- SQL operation complete.
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>obey TEST138(test_alter);
@@ -448,6 +488,12 @@ USER1_T2
 --- SQL operation complete.
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>-- Verify sql_user2 does not have ALTER or ALTER_TABLE privilege
@@ -462,6 +508,12 @@ USER1_T2
 >>sh sqlci -i "TEST138(create_tbl)" -u sql_user1;
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>create table user1_t1 (c1 int not null primary key, c2 int);
 
@@ -543,6 +595,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -734,6 +788,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -941,6 +997,8 @@ ALTER_VIEW
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -1141,6 +1199,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -1153,6 +1213,12 @@ USER1_T2
 --- SQL operation complete.
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>
@@ -1201,6 +1267,12 @@ SHOW
 >>sh sqlci -i "TEST138(create_tbl)" -u sql_user1;
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>create table user1_t1 (c1 int not null primary key, c2 int);
 
@@ -1437,6 +1509,8 @@ End of MXCI Session
 Tables in Schema TRAFODION.T138SCH
 ==================================
 
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
 USER1_T1
 USER1_T2
 
@@ -1449,6 +1523,12 @@ USER1_T2
 --- SQL operation complete.
 >>get tables;
 
+Tables in Schema TRAFODION.T138SCH
+==================================
+
+SB_HISTOGRAMS
+SB_HISTOGRAM_INTERVALS
+
 --- SQL operation complete.
 >>
 >>
@@ -1659,7 +1739,7 @@ End of MXCI Session
 (EXPR)              
 --------------------
 
-                   7
+                  11
 
 --- 1 row(s) selected.
 >>
@@ -1673,7 +1753,7 @@ End of MXCI Session
 (EXPR)              
 --------------------
 
-                   7
+                  11
 
 --- 1 row(s) selected.
 >>