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.