trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [08/11] incubator-trafodion git commit: new COMMENT-ON SQL statement: review change - undo all MD changes
Date Wed, 15 Nov 2017 18:03:05 GMT
new COMMENT-ON SQL statement: review change - undo all MD changes

1. undo all MD changes since we have changed to use TEXT table to store
comments


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

Branch: refs/heads/master
Commit: 96570c43847c8677a103c526e9b5523193cfbd2c
Parents: a448e8f
Author: eedy <cqlcqlc@gmail.com>
Authored: Thu Nov 9 14:46:33 2017 +0800
Committer: eedy <cqlcqlc@gmail.com>
Committed: Thu Nov 9 14:46:33 2017 +0800

----------------------------------------------------------------------
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 11 +++++------
 core/sql/sqlcomp/CmpSeabaseDDLmd.h       |  6 ++----
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp |  2 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp  |  8 ++++----
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.h  | 23 ++++++++---------------
 5 files changed, 20 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96570c43/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 299b6c2..70ae917 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -4563,7 +4563,7 @@ short CmpSeabaseDDL::updateSeabaseMDObjectsTable(
   NAString quotedObjName;
   ToQuotedString(quotedObjName, NAString(objName), FALSE);
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, %ld, '')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, %ld )",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catName, quotedSchName.data(), quotedObjName.data(),
               objectTypeLit,
@@ -4754,7 +4754,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
       ExeCliInterface cqdCliInterface;
       cliRC = cqdCliInterface.holdAndSetCQD("ODBC_PROCESS", "ON");
 
-      str_sprintf(buf, "upsert using rowset (max rowset size %d, input rowset size ?, input
row max length ?, rowset buffer ?) into %s.\"%s\".%s values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
+      str_sprintf(buf, "upsert using rowset (max rowset size %d, input rowset size ?, input
row max length ?, rowset buffer ?) into %s.\"%s\".%s values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
                   numCols,
                   getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS);
       cliRC = rwrsCliInterface.rwrsPrepare(buf, numCols);
@@ -4887,7 +4887,6 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
           AssignColEntry(&rwrsCliInterface, entry++, inputRow, colInfo->paramDirection,
firstColOffset);
           AssignColEntry(&rwrsCliInterface, entry++, inputRow, (colInfo->isOptional
? COM_YES_LIT : COM_NO_LIT), firstColOffset);
           AssignColEntry(&rwrsCliInterface, entry++, inputRow, (char*)&colInfo->colFlags,
firstColOffset);
-          AssignColEntry(&rwrsCliInterface, entry++, inputRow, (char*)"", firstColOffset);
 
           cliRC = rwrsCliInterface.rwrsExec(inputRow, inputRowLen, &rowsAffected);
           if (cliRC < 0)
@@ -4899,7 +4898,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
         }
       else
         {
-          str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', %d, '%s', %d, '%s',
%d, %d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %ld, '')",
+          str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', %d, '%s', %d, '%s',
%d, %d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %ld)",
                       getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
                       objUID,
                       colInfo->colName, 
@@ -5122,7 +5121,7 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
   NAString quotedLibObjName;
   ToQuotedString(quotedLibObjName, NAString(libName), FALSE);
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0, '')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0 )",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catName, quotedSchName.data(), quotedLibObjName.data(),
               COM_LIBRARY_OBJECT_LIT,
@@ -7797,7 +7796,7 @@ void  CmpSeabaseDDL::createSeabaseSequence(StmtDDLCreateSequence  *
createSequen
   ToQuotedString(quotedSeqObjName, seqNamePart, FALSE);
 
   Int32 objOwner = ComUser::getCurrentUser();
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0, '')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0)",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catalogNamePart.data(), quotedSchName.data(), quotedSeqObjName.data(),
               COM_SEQUENCE_GENERATOR_OBJECT_LIT,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96570c43/core/sql/sqlcomp/CmpSeabaseDDLmd.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLmd.h b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
index 49a5246..9a1e91d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLmd.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLmd.h
@@ -115,8 +115,7 @@ static const QString seabaseColumnsDDL[] =
   {"   hbase_col_qualifier varchar(40) character set iso88591 not null not serialized, "},
   {"   direction char(2) character set iso88591 not null not serialized, "},
   {"   is_optional char(2) character set iso88591 not null not serialized, "},
-  {"   flags largeint not null not serialized, "},
-  {"   comment VARCHAR(1000) CHARACTER SET UTF8 NOT NULL  NOT SERIALIZED "},
+  {"   flags largeint not null not serialized "},
   {" ) "},
   {" primary key (object_uid, column_name) "},
   {" attribute hbase format "},
@@ -221,8 +220,7 @@ static const QString seabaseObjectsDDL[] =
   {"   droppable char(2) character set iso88591 not null not serialized, "},
   {"   object_owner int not null not serialized, "},
   {"   schema_owner int not null not serialized, "},
-  {"   flags largeint not null not serialized, "},
-  {"   comment VARCHAR(1000) CHARACTER SET UTF8 NOT NULL  NOT SERIALIZED "},
+  {"   flags largeint not null not serialized "},
   {" ) "},
   {" primary key (catalog_name, schema_name, object_name, object_type) "},
   {" attribute hbase format "},

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96570c43/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index 27d2840..4ff11d0 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -188,7 +188,7 @@ char schemaObjectLit[3] = {0};
       } 
    }
 
-   str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0, '')",
+   str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0)",
                getSystemCatalog(),SEABASE_MD_SCHEMA,SEABASE_OBJECTS,
                catalogName.data(), quotedSchName.data(), quotedObjName.data(),
                schemaObjectLit,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96570c43/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index ee20ae2..fcc8df1 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -909,7 +909,7 @@ short CmpSeabaseDDL::updatePKeyInfo(
   NAString quotedObjName;
   ToQuotedString(quotedObjName, NAString(objectNamePart), FALSE);
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0, '')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0)",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catalogNamePart.data(), quotedSchName.data(), quotedObjName.data(),
               COM_PRIMARY_KEY_CONSTRAINT_OBJECT_LIT,
@@ -1315,7 +1315,7 @@ short CmpSeabaseDDL::updateConstraintMD(
   NAString quotedObjName;
   ToQuotedString(quotedObjName, NAString(objectNamePart), FALSE);
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0, '')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld,
'%s', '%s', %d, %d, 0)",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
               catalogNamePart.data(), quotedSchName.data(), quotedObjName.data(),
               ((ct == COM_UNIQUE_CONSTRAINT) ? COM_UNIQUE_CONSTRAINT_OBJECT_LIT :
@@ -5646,7 +5646,7 @@ void CmpSeabaseDDL::alterSeabaseTableAddColumn(
         }
     }
 
-  str_sprintf(query, "insert into %s.\"%s\".%s values (%ld, '%s', %d, '%s', %d, '%s', %d,
%d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%u', '%s', '%s', %ld, '' )",
+  str_sprintf(query, "insert into %s.\"%s\".%s values (%ld, '%s', %d, '%s', %d, '%s', %d,
%d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%u', '%s', '%s', %ld )",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
               objUID,
               col_name,
@@ -7186,7 +7186,7 @@ short CmpSeabaseDDL::hbaseFormatTableAlterColumnAttr(
       goto label_error1;
     }
 
-  str_sprintf(buf, "insert into %s.\"%s\".%s select object_uid, '%s', %d, '%s', fs_data_type,
sql_data_type, column_size, column_precision, column_scale, datetime_start_field, datetime_end_field,
is_upshifted, column_flags, nullable, character_set, default_class, default_value, column_heading,
'%s', '%s', direction, is_optional, flags, comment from %s.\"%s\".%s where object_uid = %ld
and column_number = (select column_number from %s.\"%s\".%s where object_uid = %ld and column_name
= '%s')",
+  str_sprintf(buf, "insert into %s.\"%s\".%s select object_uid, '%s', %d, '%s', fs_data_type,
sql_data_type, column_size, column_precision, column_scale, datetime_start_field, datetime_end_field,
is_upshifted, column_flags, nullable, character_set, default_class, default_value, column_heading,
'%s', '%s', direction, is_optional, flags from %s.\"%s\".%s where object_uid = %ld and column_number
= (select column_number from %s.\"%s\".%s where object_uid = %ld and column_name = '%s')",
               getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
               naCol->getColName().data(),              
               altColNum,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/96570c43/core/sql/sqlcomp/CmpSeabaseDDLupgrade.h
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLupgrade.h b/core/sql/sqlcomp/CmpSeabaseDDLupgrade.h
index 7e963e0..1c3b2ee 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLupgrade.h
+++ b/core/sql/sqlcomp/CmpSeabaseDDLupgrade.h
@@ -226,14 +226,7 @@ static const MDUpgradeInfo allMDupgradeInfo[] = {
    seabaseColumnsDDL, sizeof(seabaseColumnsDDL),
    NULL, 0,
    NULL, 0,
-   TRUE, 
-   "object_uid,column_name,column_number,column_class,fs_data_type,sql_data_type,column_size,column_precision,"
-   "column_scale,datetime_start_field,datetime_end_field,is_upshifted,column_flags,nullable,character_set,"
-   "default_class,default_value,column_heading,hbase_col_family,hbase_col_qualifier,direction,is_optional,flags,comment"
, 
-   "object_uid,column_name,column_number,column_class,fs_data_type,sql_data_type,column_size,column_precision,"
-   "column_scale,datetime_start_field,datetime_end_field,is_upshifted,column_flags,nullable,character_set,"
-   "default_class,default_value,column_heading,hbase_col_family,hbase_col_qualifier,direction,is_optional,flags,''"
, 
-   NULL, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE},
+   FALSE, NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
 
   {SEABASE_DEFAULTS, SEABASE_DEFAULTS_OLD_MD,
    seabaseDefaultsDDL, sizeof(seabaseDefaultsDDL),
@@ -286,13 +279,13 @@ static const MDUpgradeInfo allMDupgradeInfo[] = {
    "object_name,"
    "object_type,object_uid,"
    "create_time,redef_time,valid_def,droppable,object_owner,schema_owner,"
-   "flags,comment",
+   "flags",
    "catalog_name,schema_name,"
    "case when schema_name = '_MD_' then object_name || '_OLD_MD' else object_name end,"
    "object_type,object_uid,"
    "create_time,redef_time,valid_def,droppable,object_owner,schema_owner,"
-   "flags,''",
-   NULL, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE},
+   "flags",
+   NULL, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
 
   {SEABASE_OBJECTS_UNIQ_IDX, SEABASE_OBJECTS_UNIQ_IDX_OLD_MD,
    seabaseObjectsUniqIdxDDL, sizeof(seabaseObjectsUniqIdxDDL),
@@ -410,8 +403,8 @@ static const MDUpgradeInfo allMDv23tov30TablesInfo[] = {
    seabaseOldMDv23ColumnsDDL, sizeof(seabaseOldMDv23ColumnsDDL),
    NULL, 0,
    TRUE,
-   "object_uid, column_name, column_number, column_class, fs_data_type, sql_data_type, column_size,
column_precision, column_scale, datetime_start_field, datetime_end_field, is_upshifted, column_flags,
nullable, character_set, default_class, default_value, column_heading, hbase_col_family, hbase_col_qualifier,
direction, is_optional, flags, comment",
-   "object_uid, column_name, column_number, column_class, fs_data_type, '', column_size,
column_precision, column_scale, datetime_start_field, datetime_end_field, is_upshifted, column_flags,
nullable, character_set, default_class, default_value, column_heading, hbase_col_family, hbase_col_qualifier,
direction, is_optional, 0, '' ",
+   "object_uid, column_name, column_number, column_class, fs_data_type, sql_data_type, column_size,
column_precision, column_scale, datetime_start_field, datetime_end_field, is_upshifted, column_flags,
nullable, character_set, default_class, default_value, column_heading, hbase_col_family, hbase_col_qualifier,
direction, is_optional, flags",
+   "object_uid, column_name, column_number, column_class, fs_data_type, '', column_size,
column_precision, column_scale, datetime_start_field, datetime_end_field, is_upshifted, column_flags,
nullable, character_set, default_class, default_value, column_heading, hbase_col_family, hbase_col_qualifier,
direction, is_optional, 0",
    NULL, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE},
 
   {SEABASE_DEFAULTS, SEABASE_DEFAULTS_OLD_MD,
@@ -455,8 +448,8 @@ static const MDUpgradeInfo allMDv23tov30TablesInfo[] = {
    seabaseOldMDv23ObjectsDDL, sizeof(seabaseOldMDv23ObjectsDDL),
    NULL, 0,
    TRUE,
-   "catalog_name, schema_name, object_name, object_type, object_uid, create_time, redef_time,
valid_def, droppable, object_owner, schema_owner, flags, comment",
-   "catalog_name, schema_name, case when schema_name = '_MD_' then object_name || '_OLD_MD'
else object_name end, object_type, object_uid, create_time, redef_time, valid_def, 'N', object_owner,
" SUPER_USER_LIT", 0, ''",
+   "catalog_name, schema_name, object_name, object_type, object_uid, create_time, redef_time,
valid_def, droppable, object_owner, schema_owner, flags",
+   "catalog_name, schema_name, case when schema_name = '_MD_' then object_name || '_OLD_MD'
else object_name end, object_type, object_uid, create_time, redef_time, valid_def, 'N', object_owner,
" SUPER_USER_LIT", 0",
    NULL, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE},
 
   {SEABASE_OBJECTS_UNIQ_IDX, SEABASE_OBJECTS_UNIQ_IDX_OLD_MD,


Mime
View raw message