TRAFODION-1573: Additional GET commands for privileges TRAFODION-3074: Failed to register/unregister user when security disabled
TRAFODION-1573 changes: - Added support for the following commands: get privileges on <object> <object>: [LIBRARY | PROCEDURE | FUNCTION | TABLE_MAPPING FUNCTION | SEQUENCE] - Added support for the FOR CLAUSE on all supported objects Removed the need to specify keyword 'USER" before username. If USER is included, then it is ignored. get privileges on <object> FOR [USER] <user or role name> <objects>: [TABLES, VIEWS, LIBRARIES, PROCEDURES, FUNCTIONS, TABLE_MAPPING FUNCTIONS, SEQUENCES] - The following get command can only be run by DB__ROOT or a user that has been granted the DB__ROOTROLE or DB__HIVEROLE role get <objects> in schema hive.xx.xx; <objects>: [TABLES, OBJECTS, VIEWS] - The following get command can only be run by DB__ROOT or a user that has been granted the DB__ROOTROLE or DB__HBASEROLE role get external hbase objects; - The following get commands retrieve privilege details from Trafodion metadata; users can only see objects where they have been granted at least one privilege get hive registered tables in catalog trafodion; get hbase registered tables in catalog trafodion; - get privileges commands now return owner's privileges in output - Cleaned up code in the parser. TRAFODION-3074 changes - register user - fixed query to find next available authID - unregister user - added checks to not read privilege metadata if authorization is not enabled Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/88e2a742 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/88e2a742 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/88e2a742 Branch: refs/heads/master Commit: 88e2a742b019dd8d22c22c79d1b64048395cfdb1 Parents: 609d7a4 Author: Roberta Marton <roberta.mar...@apache.org> Authored: Fri May 18 16:45:06 2018 +0000 Committer: Roberta Marton <roberta.mar...@apache.org> Committed: Fri May 18 16:45:06 2018 +0000 ---------------------------------------------------------------------- core/sql/comexe/ComTdbExeUtil.h | 4 + core/sql/executor/ExExeUtilGet.cpp | 244 ++++++--- core/sql/generator/GenRelExeUtil.cpp | 14 +- core/sql/parser/ParKeyWords.cpp | 2 - core/sql/parser/sqlparser.y | 353 +++--------- core/sql/regress/compGeneral/EXPECTEDTOK | 3 +- core/sql/regress/compGeneral/EXPECTEDTOK2 | 3 +- core/sql/regress/core/EXPECTED116 | 197 +++++-- core/sql/regress/privs1/EXPECTED125 | 729 +++++++++++++++++++++++++ core/sql/regress/privs1/TEST125 | 51 ++ core/sql/regress/privs2/EXPECTED144 | 301 +++++++++- core/sql/regress/privs2/EXPECTED146 | 125 ++++- core/sql/regress/privs2/TEST144 | 39 +- core/sql/regress/privs2/TEST146 | 7 + core/sql/sqlci/sqlci_lex.ll | 2 - core/sql/sqlci/sqlci_yacc.y | 11 - core/sql/sqlcomp/CmpSeabaseDDLauth.cpp | 69 ++- core/sql/sqlcomp/CmpSeabaseDDLtable.cpp | 2 + 18 files changed, 1708 insertions(+), 448 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/comexe/ComTdbExeUtil.h ---------------------------------------------------------------------- diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h index 4716460..ef48954 100644 --- a/core/sql/comexe/ComTdbExeUtil.h +++ b/core/sql/comexe/ComTdbExeUtil.h @@ -2522,6 +2522,7 @@ public: PRIVILEGES_ON_TABLE_, PRIVILEGES_ON_MV_, PRIVILEGES_ON_VIEW_, + PRIVILEGES_ON_SEQUENCE_, SYNONYMS_ON_TABLE_, OBJECTS_ON_TABLE_, @@ -2559,6 +2560,9 @@ public: PROCEDURES_FOR_LIBRARY_, FUNCTIONS_FOR_LIBRARY_, TABLE_FUNCTIONS_FOR_LIBRARY_, + PRIVILEGES_ON_LIBRARY_, + PRIVILEGES_ON_PROCEDURE_, + PRIVILEGES_ON_ROUTINE_, COMPONENTS_, COMPONENT_OPERATIONS_, http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/executor/ExExeUtilGet.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExExeUtilGet.cpp b/core/sql/executor/ExExeUtilGet.cpp index 33865fa..163b190 100644 --- a/core/sql/executor/ExExeUtilGet.cpp +++ b/core/sql/executor/ExExeUtilGet.cpp @@ -558,8 +558,7 @@ static const QueryString getTrafPrivsOnObject[] = {" case when bitextract(privileges_bitmap,58,1) = 1 then 'R' else '-' end || "}, {" case when bitextract(privileges_bitmap,57,1) = 1 then 'E' else '-' end as privs "}, {" from %s.\"%s\".%s "}, - {" where grantor_id <> -2 "}, - {" and object_uid = "}, + {" where object_uid = "}, {" (select object_uid from %s.\"%s\".%s "}, {" where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' "}, {" and object_type = '%s') %s "}, @@ -573,11 +572,11 @@ static const QueryString getTrafPrivsOnObject[] = {" case when bitextract(privileges_bitmap,58,1) = 1 then 'R' else '-' end || "}, {" case when bitextract(privileges_bitmap,57,1) = 1 then 'E' else '-' end as privs "}, {" from %s.\"%s\".%s "}, - {" where grantor_id <> -2 "}, - {" and object_uid = "}, + {" where object_uid = "}, {" (select object_uid from %s.\"%s\".%s "}, {" where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' "}, {" and object_type = '%s') %s )"}, + {" order by 1 "}, {" ; "} }; @@ -599,9 +598,9 @@ static const QueryString getHiveRegObjectsInCatalogQuery[] = {" (select object_type, case when object_type = 'SS' " }, {" then lower(trim(catalog_name) || '.' || trim(schema_name)) "}, {" else lower(trim(catalog_name) || '.' || " }, - {" trim(schema_name) || '.' || trim(object_name)) end " }, + {" trim(schema_name) || '.' || trim(object_name)) end " }, {" from %s.\"%s\".%s where catalog_name = 'HIVE' and " }, - {" %s) O(t, a) " }, + {" %s %s) O(t, a) " }, {" left join " }, {" (select '%s' || '.' || trim(y) from " }, {" (get %s in catalog %s, no header) x(y)) G(b)" }, @@ -617,7 +616,7 @@ static const QueryString getHBaseRegTablesInCatalogQuery[] = {" from " }, {" (select trim(schema_name), trim(object_name) "}, {" from %s.\"%s\".%s where catalog_name = 'HBASE' " }, - {" and object_type = 'BT') O(s, o) " }, + {" and object_type = 'BT' %s) O(s, o) " }, {" left join " }, {" (select trim(y) from " }, {" (get external hbase objects) x(y)) G(b)" }, @@ -636,7 +635,7 @@ static const QueryString getHiveExtTablesInCatalogQuery[] = {" char_length(schema_name)-5))) " }, {" || '.' || lower(trim(object_name)) " }, {" from %s.\"%s\".%s where object_type = '%s' " }, - {" and schema_name like '|_HV|_%%|_' escape '|') O(a) " }, + {" and schema_name like '|_HV|_%%|_' escape '|' %s) O(a)" }, {" left join " }, {" (select '%s' || '.' || trim(y) from " }, {" (get %s in catalog %s, no header) x(y)) G(b) " }, @@ -1013,6 +1012,12 @@ short ExExeUtilGetMetadataInfoTcb::displayHeading() } break; + case ComTdbExeUtilGetMetadataInfo::HBASE_OBJECTS_: + { + str_sprintf(headingBuf_, "External HBase objects"); + } + break; + case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_: { str_sprintf(headingBuf_, "Hive Registered Views in Catalog %s", @@ -1160,6 +1165,27 @@ short ExExeUtilGetMetadataInfoTcb::displayHeading() } break; + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_: + { + str_sprintf(headingBuf_, "Privileges on Sequence %s.%s", + getMItdb().getSch(), getMItdb().getObj()); + } + break; + + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_: + { + str_sprintf(headingBuf_, "Privileges on Sequence %s.%s", + getMItdb().getSch(), getMItdb().getObj()); + } + break; + + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_: + { + str_sprintf(headingBuf_, "Privileges on Routine %s.%s", + getMItdb().getSch(), getMItdb().getObj()); + } + break; + case ComTdbExeUtilGetMetadataInfo::SYNONYMS_ON_TABLE_: { str_sprintf(headingBuf_, "Synonyms on Table %s.%s", @@ -1954,7 +1980,9 @@ short ExExeUtilGetMetadataInfoTcb::work() ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_ROLE_ ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_USER_ ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_ - ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_) + ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_ + ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_ + ||getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_) { if (!CmpCommon::context()->isAuthorizationEnabled()) { @@ -2028,22 +2056,22 @@ short ExExeUtilGetMetadataInfoTcb::work() } break; - case ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_: - case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_: - case ComTdbExeUtilGetMetadataInfo::HIVE_REG_SCHEMAS_IN_CATALOG_: - case ComTdbExeUtilGetMetadataInfo::HIVE_REG_OBJECTS_IN_CATALOG_: - { - qs = getHiveRegObjectsInCatalogQuery; - sizeOfqs = sizeof(getHiveRegObjectsInCatalogQuery); + case ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_: + case ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_: + case ComTdbExeUtilGetMetadataInfo::HIVE_REG_SCHEMAS_IN_CATALOG_: + case ComTdbExeUtilGetMetadataInfo::HIVE_REG_OBJECTS_IN_CATALOG_: + { + qs = getHiveRegObjectsInCatalogQuery; + sizeOfqs = sizeof(getHiveRegObjectsInCatalogQuery); - if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_) - { - strcpy(hiveGetType, "tables"); - str_sprintf(hiveObjType, " (object_type = '%s') ", - COM_BASE_TABLE_OBJECT_LIT); + if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_TABLES_IN_CATALOG_) + { + strcpy(hiveGetType, "tables"); + str_sprintf(hiveObjType, " (object_type = '%s') ", + COM_BASE_TABLE_OBJECT_LIT); } else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::HIVE_REG_VIEWS_IN_CATALOG_) - { + { strcpy(hiveGetType, "views"); str_sprintf(hiveObjType, " (object_type = '%s') ", COM_VIEW_OBJECT_LIT); @@ -2063,46 +2091,57 @@ short ExExeUtilGetMetadataInfoTcb::work() COM_SHARED_SCHEMA_OBJECT_LIT); } - param_[0] = cat; - param_[1] = sch; - param_[2] = tab; - param_[3] = hiveObjType; - param_[4] = hiveSysCat; - param_[5] = hiveGetType, - param_[6] = hiveSysCat; + if (doPrivCheck) + privWhereClause = getGrantedPrivCmd(authList, cat); + + param_[0] = cat; + param_[1] = sch; + param_[2] = tab; + param_[3] = hiveObjType; + param_[4] = (char *)privWhereClause.data(); + param_[5] = hiveSysCat; + param_[6] = hiveGetType, + param_[7] = hiveSysCat; } break; - case ComTdbExeUtilGetMetadataInfo::HBASE_REG_TABLES_IN_CATALOG_: - { - qs = getHBaseRegTablesInCatalogQuery; - sizeOfqs = sizeof(getHBaseRegTablesInCatalogQuery); + case ComTdbExeUtilGetMetadataInfo::HBASE_REG_TABLES_IN_CATALOG_: + { + qs = getHBaseRegTablesInCatalogQuery; + sizeOfqs = sizeof(getHBaseRegTablesInCatalogQuery); - param_[0] = cat; - param_[1] = sch; - param_[2] = tab; - } + if (doPrivCheck) + privWhereClause = getGrantedPrivCmd(authList, cat); + + param_[0] = cat; + param_[1] = sch; + param_[2] = tab; + param_[3] = (char *)privWhereClause.data(); + } break; - case ComTdbExeUtilGetMetadataInfo::HIVE_EXT_TABLES_IN_CATALOG_: - { - qs = getHiveExtTablesInCatalogQuery; - sizeOfqs = sizeof(getHiveExtTablesInCatalogQuery); + case ComTdbExeUtilGetMetadataInfo::HIVE_EXT_TABLES_IN_CATALOG_: + { + qs = getHiveExtTablesInCatalogQuery; + sizeOfqs = sizeof(getHiveExtTablesInCatalogQuery); + + if (doPrivCheck) + privWhereClause = getGrantedPrivCmd(authList, cat); strcpy(hiveObjType, COM_BASE_TABLE_OBJECT_LIT); strcpy(hiveGetType, "tables"); - param_[0] = hiveSysCat; - param_[1] = cat; - param_[2] = sch; - param_[3] = tab; - param_[4] = hiveObjType; - param_[5] = hiveSysCat; - param_[6] = hiveGetType, - param_[7] = hiveSysCat; - - } - break; + param_[0] = hiveSysCat; + param_[1] = cat; + param_[2] = sch; + param_[3] = tab; + param_[4] = hiveObjType; + param_[5] = (char *)privWhereClause.data(); + param_[6] = hiveSysCat; + param_[7] = hiveGetType, + param_[8] = hiveSysCat; + } + break; case ComTdbExeUtilGetMetadataInfo::VIEWS_IN_SCHEMA_: { @@ -2560,22 +2599,58 @@ short ExExeUtilGetMetadataInfoTcb::work() case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_: case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_: + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_: + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_: + case ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_: { qs = getTrafPrivsOnObject; sizeOfqs = sizeof(getTrafPrivsOnObject); + // Determine the type of object NAString objType; if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_) objType = COM_BASE_TABLE_OBJECT_LIT; - else + else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_) objType = COM_VIEW_OBJECT_LIT; + else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_) + objType = COM_SEQUENCE_GENERATOR_OBJECT_LIT; + else if (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_) + objType = COM_LIBRARY_OBJECT_LIT; + else + objType = COM_USER_DEFINED_ROUTINE_OBJECT_LIT; + char buf[authList.length() + 100]; if (doPrivCheck) - { - char buf[authList.length() + 100]; - str_sprintf(buf, "and grantee_id in %s ", authList.data()); - privWhereClause = buf; - } + { + if (getMItdb().getParam1() && + (strcmp(getMItdb().getParam1(), currContext->getDatabaseUserName()) != 0)) + str_sprintf(buf, "and grantee_id = -2 "); + else + str_sprintf(buf, " and grantee_id in %s ", authList.data()); + privWhereClause = buf; + } + else + { + if (getMItdb().getParam1()) + { + if (strcmp(getMItdb().getParam1(), currContext->getDatabaseUserName()) == 0) + str_sprintf(buf, " and grantee_id in %s ", authList.data()); + else + { + Int32 authID = getAuthID(getMItdb().getParam1(), cat, sch, auths); + char *userRoleList = getRoleList(authID, cat, pmsch, role_usage); + if (userRoleList) + { + str_sprintf(buf, " and grantee_id in %s ", userRoleList); + NADELETEBASIC(userRoleList, getHeap()); + } + else + str_sprintf(buf, " = %d ", authID); + } + privWhereClause = buf; + } + } + param_[0] = cat; param_[1] = pmsch; param_[2] = objPrivs; @@ -2956,7 +3031,7 @@ short ExExeUtilGetMetadataInfoTcb::work() step_ = HANDLE_ERROR_; break; } - + if (fetchAllRows(infoList_, queryBuf_, numOutputEntries_, FALSE, retcode) < 0) { @@ -2992,7 +3067,10 @@ short ExExeUtilGetMetadataInfoTcb::work() if ((getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_USER_) || (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_FOR_ROLE_) || (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_) || - (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_)) + (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_) || + (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_) || + (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_) || + (getMItdb().queryType_ == ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_)) { // output: privileges<4spaces>object name @@ -3909,6 +3987,16 @@ short ExExeUtilGetHbaseObjectsTcb::work() case SETUP_HBASE_QUERY_: { + // Since HBase tables are native and Trafodion does not manage them + // limit who can view these objects + if (((currContext->getSqlParserFlags() & 0x20000) == 0) && + !ComUser::isRootUserID() && + !ComUser::currentUserHasRole(ROOT_ROLE_ID) && + !ComUser::currentUserHasRole(HBASE_ROLE_ID)) + { + step_ = DONE_; + break; + } hbaseTables_ = ehi_->listAll(""); if (! hbaseTables_) { @@ -3918,10 +4006,33 @@ short ExExeUtilGetHbaseObjectsTcb::work() currIndex_ = 0; - step_ = PROCESS_NEXT_ROW_; + if (currIndex_ == hbaseTables_->entries()) + { + step_ = DONE_; + break; + } + + step_ = DISPLAY_HEADING_; } break; + case DISPLAY_HEADING_: + { + retcode = displayHeading(); + if (retcode == 1) + return WORK_OK; + else if (retcode < 0) + { + step_ = HANDLE_ERROR_; + break; + } + + headingReturned_ = TRUE; + + step_ = PROCESS_NEXT_ROW_; + } + break; + case PROCESS_NEXT_ROW_: { if (currIndex_ == hbaseTables_->entries()) @@ -4545,6 +4656,17 @@ short ExExeUtilGetHiveMetadataInfoTcb::work() break; } + // Since Hive tables are native and Trafodion does not manage them + // limit the users that can see the data. + if (((currContext->getSqlParserFlags() & 0x20000) == 0) && + !ComUser::isRootUserID() && + !ComUser::currentUserHasRole(ROOT_ROLE_ID) && + !ComUser::currentUserHasRole(HIVE_ROLE_ID)) + { + step_ = DONE_; + break; + } + short rc = 0; retcode = fetchAllHiveRows(infoList_, 1, rc); if (retcode < 0) http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/generator/GenRelExeUtil.cpp ---------------------------------------------------------------------- diff --git a/core/sql/generator/GenRelExeUtil.cpp b/core/sql/generator/GenRelExeUtil.cpp index 570c3e5..1b0adb4 100644 --- a/core/sql/generator/GenRelExeUtil.cpp +++ b/core/sql/generator/GenRelExeUtil.cpp @@ -1615,8 +1615,10 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator) { "SYSTEM", "TABLES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLES_IN_SCHEMA_ }, { "ALL", "TABLES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLES_IN_SCHEMA_ }, - { "ALL", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ }, - { "USER", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ }, + { "ALL", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ }, + { "ALL", "PRIVILEGES", "ON", "SEQUENCE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_ }, + { "USER", "SEQUENCES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SEQUENCES_IN_SCHEMA_ }, + { "USER", "PRIVILEGES", "ON", "SEQUENCE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_SEQUENCE_ }, { "USER", "OBJECTS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_IN_SCHEMA_ }, { "SYSTEM", "OBJECTS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_IN_SCHEMA_ }, @@ -1639,7 +1641,10 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator) { "ALL", "LIBRARIES", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::LIBRARIES_IN_SCHEMA_ }, { "ALL", "PROCEDURES","IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::PROCEDURES_IN_SCHEMA_ }, { "ALL", "FUNCTIONS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::FUNCTIONS_IN_SCHEMA_ }, - { "ALL", "TABLE_FUNCTIONS", "IN","SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLE_FUNCTIONS_IN_SCHEMA_ }, + { "ALL", "TABLE_FUNCTIONS", "IN","SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::TABLE_FUNCTIONS_IN_SCHEMA_ }, + { "ALL", "PRIVILEGES", "ON", "LIBRARY", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_LIBRARY_ }, + { "ALL", "PRIVILEGES", "ON", "PROCEDURE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_ }, + { "ALL", "PRIVILEGES", "ON", "ROUTINE", 1, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_ROUTINE_ }, // { "ALL", "MVS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::MVS_IN_SCHEMA_ }, // { "ALL", "MVGROUPS", "IN", "SCHEMA", 0, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::MVGROUPS_IN_SCHEMA_ }, // { "ALL", "SYNONYMS", "IN", "SCHEMA", 1, 2, 0, 0, ComTdbExeUtilGetMetadataInfo::SYNONYMS_IN_SCHEMA_ }, @@ -1650,12 +1655,9 @@ short ExeUtilGetMetadataInfo::codeGen(Generator * generator) { "USER", "INDEXES", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_TABLE_ }, { "USER", "VIEWS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::VIEWS_ON_TABLE_ }, { "USER", "OBJECTS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::OBJECTS_ON_TABLE_ }, - { "USER", "PRIVILEGES","ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_TABLE_ }, - { "USER", "PRIVILEGES","ON", "VIEW", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_VIEW_ }, // { "USER", "INDEXES", "ON", "MV", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_MV_ }, // { "USER", "MVS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::MVS_ON_TABLE_ }, // { "USER", "MVGROUPS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::MVGROUPS_ON_TABLE_ }, -// { "USER", "PRIVILEGES","ON", "MV", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::PRIVILEGES_ON_MV_ }, // { "USER", "SYNONYMS", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::SYNONYMS_ON_TABLE_ }, { "ALL", "INDEXES", "ON", "TABLE", 0, 3, 0, 0, ComTdbExeUtilGetMetadataInfo::INDEXES_ON_TABLE_ }, http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/parser/ParKeyWords.cpp ---------------------------------------------------------------------- diff --git a/core/sql/parser/ParKeyWords.cpp b/core/sql/parser/ParKeyWords.cpp index a213458..0a152ce 100644 --- a/core/sql/parser/ParKeyWords.cpp +++ b/core/sql/parser/ParKeyWords.cpp @@ -988,8 +988,6 @@ ParKeyWord ParKeyWords::keyWords_[] = { ParKeyWord("SHOW", TOK_SHOW, NONRESTOKEN_), ParKeyWord("SHOWCONTROL", TOK_SHOWCONTROL, NONRESTOKEN_), ParKeyWord("SHOWDDL", TOK_SHOWDDL, NONRESTOKEN_|FIRST_), - ParKeyWord("SHOWLABEL", TOK_SHOWLABEL, NONRESTOKEN_), - ParKeyWord("SHOWLEAKS", TOK_SHOWLEAKS, NONRESTOKEN_), ParKeyWord("SHOWPLAN", TOK_SHOWPLAN, NONRESTOKEN_), ParKeyWord("SHOWSET", TOK_SHOWSET, NONRESTOKEN_), ParKeyWord("SHOWSHAPE", TOK_SHOWSHAPE, NONRESTOKEN_), http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/parser/sqlparser.y ---------------------------------------------------------------------- diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y index 455447e..7e32e8a 100755 --- a/core/sql/parser/sqlparser.y +++ b/core/sql/parser/sqlparser.y @@ -1046,8 +1046,6 @@ static void enableMakeQuotedStringISO88591Mechanism() %token <tokval> TOK_SHOWDDL_LIBRARY %token <tokval> TOK_SHOWDDL_SEQUENCE %token <tokval> TOK_SHOWDDL /* Tandem extension non-reserved word */ -%token <tokval> TOK_SHOWLABEL /* Tandem extension reserved word */ -%token <tokval> TOK_SHOWLEAKS /* Tandem extension non-reserved word*/ %token <tokval> TOK_SYSDATE %token <tokval> TOK_SYSTIMESTAMP %token <tokval> TOK_TARGET @@ -1908,8 +1906,6 @@ static void enableMakeQuotedStringISO88591Mechanism() %type <tokval> sign %type <corrName> table_name %type <corrName> special_table_name -%type <corrName> label_name -%type <corrName> extended_label_name %type <corrName> actual_table_name %type <corrName> actual_table_name2 %type <corrName> exception_table_name @@ -2223,10 +2219,7 @@ static void enableMakeQuotedStringISO88591Mechanism() %type <corrName> optional_showddl_action_name_clause %type <longint> showddl_options_list %type <longint> showddl_options -%type <longint> showlabel_options %type <describeType> showcontrol_type -%type <uint> showleaks_process -%type <uint> showleaks_session //%type <uint> returning_clause %type <item> input_hostvar_expression %type <item> hostvar_expression @@ -5533,34 +5526,6 @@ actual_routine_action_name : routine_action_name $$->getQualifiedNameObj().setObjectNameSpace(COM_UUDF_ACTION_NAME); } -/* type corrName */ -label_name : qualified_name - { - // - // note that corrNameFromStrings() - // contains code that deletes $1 - // - $$ = corrNameFromStrings($1); - if ($$ == NULL) YYABORT; - } - | guardian_location_name - { - ComLocationName locName(*$1, - ComLocationName::GUARDIAN_LOCATION_NAME_FORMAT); - if (NOT locName.isValid()) - { - // The format of the specified location name - // $0~string0 is invalid. - *SqlParser_Diags << DgSqlCode(-3061) - << DgString0($1->data()); - } - delete $1; - CorrName *result = new (PARSERHEAP()) CorrName(); - result->setLocationName(locName. - getGuardianFullyQualifiedName()); - $$ = result; - } - /* 100% identical to "actual_table_name", actual_table_name2 is provided only * for use in the "select_list_item" productions. By doing so, it * provides a way to get around a reduce/reduce problem that would @@ -15448,68 +15413,82 @@ exe_util_get_metadata_info : $$ = gmi; } -user_or_role : TOK_USER | TOK_ROLE - -exe_util_get_metadata_info : - TOK_GET get_info_aus_clause - TOK_PRIVILEGES TOK_ON object_identifier table_name - optional_for_user_clause + | TOK_GET get_info_aus_clause TOK_PRIVILEGES TOK_ON object_identifier + table_name optional_for_user_clause optional_no_header_and_match_pattern_clause { - if ((*$5 != "TABLE") && (*$5 != "SCHEMA") && - (*$5 != "VIEW" ) && (*$5 != "MV") && - (*$5 != "USER" ) && (*$5 != "ROLE")) - { - YYERROR; - } + NAString aus("ALL"); - NAString aus(*$2); - if (*$2 == "ALL") - aus = "ALL"; - else if (*$2 == "USER") - aus = "USER"; - else if (*$2 == "NONE") - aus = "USER"; - else - YYERROR; - - NAString infoType("PRIVILEGES"); - NABoolean getVersion = FALSE; - PtrPlaceHolder * pph = $8; - NAString * noHeader = - (NAString *)pph->ptr1_; - NAString * pattern = - (NAString *)pph->ptr2_; - NAString * fullyQualNames = - (NAString *)pph->ptr3_; - - NAString iof("ON"); - NAString nas(""); - ExeUtilGetMetadataInfo * gmi = - new (PARSERHEAP ()) ExeUtilGetMetadataInfo - (aus, infoType, iof, *$5, - *$6, pattern, - (fullyQualNames ? TRUE : FALSE), - getVersion, - $7, - PARSERHEAP ()); - - if (noHeader) - gmi->setNoHeader(TRUE); - else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) || - (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON))) - { - gmi->setNoHeader(TRUE); - } + NAString infoType("PRIVILEGES"); + NABoolean getVersion = FALSE; + PtrPlaceHolder * pph = $8; + NAString * noHeader = (NAString *)pph->ptr1_; + NAString * pattern = (NAString *)pph->ptr2_; + NAString * fullyQualNames = (NAString *)pph->ptr3_; + + NAString iof("ON"); + NAString nas(""); + ExeUtilGetMetadataInfo * gmi = + new (PARSERHEAP ()) ExeUtilGetMetadataInfo + (aus, infoType, iof, *$5, + *$6, pattern, + (fullyQualNames ? TRUE : FALSE), + getVersion, + $7, + PARSERHEAP ()); + + if (noHeader) + gmi->setNoHeader(TRUE); + else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) || + (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON))) + { + gmi->setNoHeader(TRUE); + } + + $$ = gmi; + } + + // Created a special production for getting privileges on procedures + // TOK_PROCEDURE as an object_identifier causes lots of parser conflicts + | TOK_GET get_info_aus_clause TOK_PRIVILEGES TOK_ON TOK_PROCEDURE + table_name optional_for_user_clause + optional_no_header_and_match_pattern_clause + { + NAString aus("ALL"); + NAString infoType("PRIVILEGES"); + NABoolean getVersion = FALSE; + PtrPlaceHolder * pph = $8; + NAString * noHeader = (NAString *)pph->ptr1_; + NAString * pattern = (NAString *)pph->ptr2_; + NAString * fullyQualNames = (NAString *)pph->ptr3_; + + NAString iof("ON"); + NAString nas(""); + NAString ptype("PROCEDURE"); + ExeUtilGetMetadataInfo * gmi = + new (PARSERHEAP ()) ExeUtilGetMetadataInfo + (aus, infoType, iof, ptype, + *$6, pattern, + (fullyQualNames ? TRUE : FALSE), + getVersion, + $7, + PARSERHEAP ()); + + if (noHeader) + gmi->setNoHeader(TRUE); + else if (NOT ((CmpCommon::getDefault(IS_SQLCI) == DF_ON) || + (CmpCommon::getDefault(NVCI_PROCESS) == DF_ON))) + { + gmi->setNoHeader(TRUE); + } + + $$ = gmi; + } - $$ = gmi; - } - | TOK_GET get_info_aus_clause TOK_COMPONENTS optional_no_header_and_match_pattern_clause // GET COMPONENTS { - // exe_util_get_metadata_info ::= TOK_GET TOK_COMPONENTS NAString aus(*$2); if (*$2 == "ALL") aus = "ALL"; @@ -15551,8 +15530,6 @@ exe_util_get_metadata_info : | TOK_GET get_info_aus_clause TOK_COMPONENT TOK_PRIVILEGES TOK_ON component_name optional_authid_clause optional_drop_behavior optional_no_header_and_match_pattern_clause - // GET [CURRENT_USER] COMPONENT PRIVILEGES ON <name> or - // GET [CURRENT_USER] COMPONENT PRIVILEGES ON <name> FOR <authid> { NAString aus(*$2); if (*$2 == "ALL") @@ -15711,10 +15688,16 @@ exe_util_get_metadata_info : $$ = gmi; } +user_or_role : TOK_USER | TOK_ROLE + optional_for_user_clause : empty { $$ = NULL; } + | TOK_FOR authorization_identifier + { + $$ = new(PARSERHEAP()) NAString(*$2); + } | TOK_FOR TOK_USER authorization_identifier { - $$ = new(PARSERHEAP()) NAString(*$3); + $$ = new(PARSERHEAP()) NAString(*$3); } optional_authid_clause : empty { $$ = NULL; } @@ -15732,16 +15715,14 @@ get_info_aus_clause : empty { $$ = new (PARSERHEAP()) NAString("NONE"); } | TOK_TEMP_TABLE { $$ = new (PARSERHEAP()) NAString("TRIGTEMP");} | TOK_SYSTEM { $$ = new (PARSERHEAP()) NAString("SYSTEM"); } | TOK_EXTERNAL { $$ = new (PARSERHEAP()) NAString("EXTERNAL"); } - | TOK_VERSION TOK_OF { $$ = new (PARSERHEAP()) NAString("VERSION_USER"); } - | TOK_VERSION TOK_OF TOK_ALL { $$ = new (PARSERHEAP()) NAString("VERSION_ALL"); } - | TOK_VERSION TOK_OF TOK_USER { $$ = new (PARSERHEAP()) NAString("VERSION_USER"); } - | TOK_VERSION TOK_OF TOK_SYSTEM { $$ = new (PARSERHEAP()) NAString("VERSION_SYSTEM"); } object_identifier : TOK_CATALOG { $$ = new (PARSERHEAP()) NAString("CATALOG"); } | TOK_CONSTRAINT{ $$ = new (PARSERHEAP()) NAString("CONSTRAINT"); } | TOK_INDEX { $$ = new (PARSERHEAP()) NAString("INDEX"); } | TOK_LIBRARY { $$ = new (PARSERHEAP()) NAString("LIBRARY"); } + | TOK_TABLE_MAPPING TOK_FUNCTION { $$ = new (PARSERHEAP()) NAString("ROUTINE"); } + | TOK_FUNCTION { $$ = new (PARSERHEAP()) NAString("ROUTINE"); } | TOK_MV { $$ = new (PARSERHEAP()) NAString("MV"); } | TOK_SCHEMA { $$ = new (PARSERHEAP()) NAString("SCHEMA"); } | TOK_SYNONYM { $$ = new (PARSERHEAP()) NAString("SYNONYM"); } @@ -22559,19 +22540,6 @@ showcontrol_type: | TOK_TABLE { $$ = Describe::CONTROL_TABLE_; } | TOK_SESSION { $$ = Describe::CONTROL_SESSION_; } -/*showleaks process*/ -showleaks_process: - TOK_ARKCMP { $$ = LeakDescribe::FLAG_ARKCMP; } - | TOK_BOTH { $$ = LeakDescribe::FLAG_BOTH; } - | { $$ = LeakDescribe::FLAG_SQLCI; } - -/*session control*/ -showleaks_session: - TOK_CONTINUE { $$ = LeakDescribe::FLAG_CONTINUE; } - | TOK_OFF { $$ = LeakDescribe::FLAG_OFF; } - | TOK_PROMPT { $$ = LeakDescribe::FLAG_PROMPT; } - | { $$ = 0; } - /* type relx */ show_statement: TOK_SHOWCONTROL showcontrol_type @@ -22831,72 +22799,6 @@ show_statement: delete $3; // CorrName * actual_routine_name of UDF or UUDF delete $4; // CorrName * actual_routine_name of routine action } - | TOK_SHOWLABEL extended_label_name showlabel_options - { - // Determine the ANSI namespace. - ExtendedQualName::SpecialTableType stt = $2->getSpecialType(); - ComAnsiNameSpace labelAnsiNameSpace = COM_UNKNOWN_NAME; - switch (stt) - { - case ExtendedQualName::NORMAL_TABLE: - labelAnsiNameSpace = COM_TABLE_NAME; - break; - case ExtendedQualName::INDEX_TABLE: - labelAnsiNameSpace = COM_INDEX_NAME; - break; - case ExtendedQualName::GHOST_TABLE: - labelAnsiNameSpace = COM_GHOST_TABLE_NAME; - break; - case ExtendedQualName::GHOST_INDEX_TABLE: - labelAnsiNameSpace = COM_GHOST_INDEX_NAME; - break; - case ExtendedQualName::ISP_TABLE: - labelAnsiNameSpace = COM_TABLE_NAME; - break; - case ExtendedQualName::IUD_LOG_TABLE: - labelAnsiNameSpace = COM_IUD_LOG_TABLE_NAME; - break; - case ExtendedQualName::RANGE_LOG_TABLE: - labelAnsiNameSpace = COM_RANGE_LOG_TABLE_NAME; - break; - case ExtendedQualName::TRIGTEMP_TABLE: - labelAnsiNameSpace = COM_TRIGTEMP_TABLE_NAME; - break; - default : - // There should be a case for every special type that - // is specified by the production extended_label_name. - ABORT("internal logic error"); - break; - } - - $$ = new (PARSERHEAP()) - RelRoot(new (PARSERHEAP()) - Describe(SQLTEXT(), - *$2/*label_name*/, - Describe::LABEL_, - labelAnsiNameSpace, - $3 /*showlabel_options*/), - REL_ROOT, - new (PARSERHEAP()) - ColReference(new (PARSERHEAP()) ColRefName(TRUE, PARSERHEAP()))); - } - //ACH TOK_SHOWLIBRARY label_name - - | TOK_SHOWLEAKS showleaks_process showleaks_session - { - HEAPLOG_CONTROL(LOG_DELETE_ONLY); - CorrName c; - $$ = new (PARSERHEAP()) - RelRoot(new (PARSERHEAP()) - Describe(SQLTEXT(), - c, - Describe::LEAKS_, - COM_TABLE_NAME, - ($2 | $3)), - REL_ROOT, - new (PARSERHEAP()) - ColReference(new (PARSERHEAP()) ColRefName(TRUE, PARSERHEAP()))); - } | TOK_INVOKE table_name { $$ = new (PARSERHEAP()) @@ -23845,105 +23747,6 @@ optional_showddl_role_option : empty $$ = 16; } -/* type longint */ -showlabel_options : empty - { - $$ = 0; - } - | ',' TOK_DETAIL - { - $$ = 1; - } - | ',' TOK_DETAIL ',' TOK_PRIVILEGES - { - $$ = 17; - } - | ',' TOK_PRIVILEGES ',' TOK_DETAIL - { - $$ = 17; - } - | ',' TOK_PRIVILEGES - { - $$ = 16; - } - -/* type corrName */ -// With the introduction of ghost objects we now use extended_label_name -// where we used to use two productions: optional_ansi_name_space label_name -// Two productions is neater, but we do this to avoid introducing a -// shift/reduce conflict. -extended_label_name : label_name - { - $$ = $1 /* label_name */; - $$->setSpecialType(ExtendedQualName::NORMAL_TABLE); - } - - | TOK_INDEX label_name - { - $$ = $2 /* label_name */; - $$->setSpecialType(ExtendedQualName::INDEX_TABLE); - } - - | TOK_TABLE label_name - { - $$ = $2 /* label_name */; - $$->setSpecialType(ExtendedQualName::NORMAL_TABLE); - } - - | ghost TOK_INDEX label_name - { - $$ = $3 /* label_name */; - $$->setSpecialType(ExtendedQualName::GHOST_INDEX_TABLE); - } - - | ghost TOK_TABLE label_name - { - $$ = $3 /* label_name */; - $$->setSpecialType(ExtendedQualName::GHOST_TABLE); - } - - | TOK_PROCEDURE label_name - { - $$ = $2 /* label_name */; - $$->setSpecialType(ExtendedQualName::ISP_TABLE); - } - | TOK_IUDLOG TOK_TABLE label_name - { - if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE)) - { - $$ = $3 /* label_name */; - $$->setSpecialType(ExtendedQualName::IUD_LOG_TABLE); - } - else - { - yyerror(""); YYERROR; /*internal syntax only!*/ - } - } - | TOK_RANGELOG TOK_TABLE label_name - { - if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE)) - { - $$ = $3 /* label_name */; - $$->setSpecialType(ExtendedQualName::RANGE_LOG_TABLE); - } - else - { - yyerror(""); YYERROR; /*internal syntax only!*/ - } - } - | TOK_TEMP_TABLE TOK_TABLE label_name - { - if (Get_SqlParser_Flags(ALLOW_SPECIALTABLETYPE)) - { - $$ = $3 /* label_name */; - $$->setSpecialType(ExtendedQualName::TRIGTEMP_TABLE); - } - else - { - yyerror(""); YYERROR; /*internal syntax only!*/ - } - } - /* type pStmtDDL */ schema_definition : TOK_CREATE schema_class TOK_SCHEMA schema_name_clause char_set collation_option @@ -34046,7 +33849,6 @@ nonreserved_word : TOK_ABORT | TOK_SHAPE | TOK_SHARE | TOK_SHARED - | TOK_SHOWLEAKS | TOK_SIGNED | TOK_SINGLEDELTA // MV // | TOK_SIZE @@ -34132,7 +33934,6 @@ nonreserved_word : TOK_ABORT | TOK_INVOKE | TOK_SHOWCONTROL | TOK_SHOWDDL - | TOK_SHOWLABEL | TOK_SHOWPLAN | TOK_SHOWSHAPE | TOK_SHOWSET http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/compGeneral/EXPECTEDTOK ---------------------------------------------------------------------- diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK b/core/sql/regress/compGeneral/EXPECTEDTOK index 87d8497..9c3aa03 100644 --- a/core/sql/regress/compGeneral/EXPECTEDTOK +++ b/core/sql/regress/compGeneral/EXPECTEDTOK @@ -1,4 +1,4 @@ -sqlparser.y: warning: 62 shift/reduce conflicts [-Wconflicts-sr] +sqlparser.y: warning: 61 shift/reduce conflicts [-Wconflicts-sr] sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr] nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')' @@ -9,7 +9,6 @@ nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')' nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery . nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN . nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause -nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream . nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')' nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR . http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/compGeneral/EXPECTEDTOK2 ---------------------------------------------------------------------- diff --git a/core/sql/regress/compGeneral/EXPECTEDTOK2 b/core/sql/regress/compGeneral/EXPECTEDTOK2 index 87d8497..9c3aa03 100644 --- a/core/sql/regress/compGeneral/EXPECTEDTOK2 +++ b/core/sql/regress/compGeneral/EXPECTEDTOK2 @@ -1,4 +1,4 @@ -sqlparser.y: warning: 62 shift/reduce conflicts [-Wconflicts-sr] +sqlparser.y: warning: 61 shift/reduce conflicts [-Wconflicts-sr] sqlparser.y: warning: 12 reduce/reduce conflicts [-Wconflicts-rr] nnnn conflicts: 1 shift/reduce nnnn olap_sequence_function: set_function_specification . TOK_OVER '(' opt_olap_part_clause opt_olap_order_clause ')' @@ -9,7 +9,6 @@ nnnn conflicts: 9 shift/reduce nnnn row_subquery: '(' row_subquery . ')' nnnn conflicts: 1 reduce/reduce nnnn row_subquery: rel_subquery . nnnn conflicts: 1 reduce/reduce nnnn transaction_statement: TOK_BEGIN . nnnn conflicts: 1 shift/reduce nnnn show_statement: TOK_SHOWCONTROL showcontrol_type . optional_control_identifier optional_comma_match_clause -nnnn conflicts: 1 shift/reduce nnnn extended_label_name: TOK_INDEX . label_name nnnn conflicts: 1 shift/reduce nnnn table_as_stream_any: table_as_stream . nnnn conflicts: 1 shift/reduce nnnn row_subquery: '(' row_subquery . ')' nnnn conflicts: 1 shift/reduce nnnn input_hostvar_expression: HOSTVAR . http://git-wip-us.apache.org/repos/asf/trafodion/blob/88e2a742/core/sql/regress/core/EXPECTED116 ---------------------------------------------------------------------- diff --git a/core/sql/regress/core/EXPECTED116 b/core/sql/regress/core/EXPECTED116 index 0d65c19..a67e957 100644 --- a/core/sql/regress/core/EXPECTED116 +++ b/core/sql/regress/core/EXPECTED116 @@ -15,11 +15,17 @@ --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + TRAFODION.SCH.T116T1 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. @@ -29,9 +35,17 @@ TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + + --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + + --- SQL operation complete. >> >>--repeat the same tables again @@ -47,11 +61,17 @@ TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + TRAFODION.SCH.T116T1 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. @@ -60,9 +80,17 @@ TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + + --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + + --- SQL operation complete. >> >>-- unique constraint @@ -78,11 +106,17 @@ TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + TRAFODION.SCH.T116T1 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.TC1'; +External HBase objects +====================== + TRAFODION.SCH.TC1 --- SQL operation complete. @@ -91,9 +125,17 @@ TRAFODION.SCH.TC1 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + + --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.TC1'; +External HBase objects +====================== + + --- SQL operation complete. >> >>--setup two tables @@ -121,6 +163,9 @@ TRAFODION.SCH.TC1 >>-------------------------- >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + TRAFODION.SCH.T116T1 --- SQL operation complete. @@ -135,6 +180,10 @@ TRAFODION.SCH.T116T1 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T1'; +External HBase objects +====================== + + --- SQL operation complete. >> >>--drop table with rollback @@ -142,6 +191,9 @@ TRAFODION.SCH.T116T1 >>--sh `echo "exists '$TEST_SCHEMA.T116T2'" | regrhbase.ksh >> LOG116`; >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. @@ -177,6 +229,9 @@ A1 C1 B1 >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. @@ -185,6 +240,9 @@ TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. @@ -213,11 +271,18 @@ A1 C1 B1 >>------------------------------------- >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + + --- SQL operation complete. >>begin work; @@ -230,11 +295,17 @@ TRAFODION.SCH.T116T2 --- 1 row(s) inserted. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + TRAFODION.SCH.T116T2 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. @@ -246,9 +317,16 @@ TRAFODION.SCH.T116T3 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T2'; +External HBase objects +====================== + + --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. @@ -257,11 +335,18 @@ TRAFODION.SCH.T116T3 >>--------------------------------------------------- >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T4'; +External HBase objects +====================== + + --- SQL operation complete. >>begin work; @@ -274,11 +359,17 @@ TRAFODION.SCH.T116T3 --- 1 row(s) inserted. >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T4'; +External HBase objects +====================== + TRAFODION.SCH.T116T4 --- SQL operation complete. @@ -301,6 +392,9 @@ A1 C1 B1 >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. @@ -309,11 +403,18 @@ TRAFODION.SCH.T116T3 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T3'; +External HBase objects +====================== + TRAFODION.SCH.T116T3 --- SQL operation complete. >>get user hbase objects, match 'TRAFODION.SCH.T116T4'; +External HBase objects +====================== + + --- SQL operation complete. >>select * from t116t3; @@ -341,7 +442,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:00:30 2016 +-- Definition current Wed May 16 06:17:20 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -359,7 +460,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:00:30 2016 +-- Definition current Wed May 16 06:17:20 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -374,7 +475,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:00:31 2016 +-- Definition current Wed May 16 06:17:22 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -391,7 +492,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:00:43 2016 +-- Definition current Wed May 16 06:17:36 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -406,7 +507,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:00:44 2016 +-- Definition current Wed May 16 06:17:37 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -423,7 +524,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:00:47 2016 +-- Definition current Wed May 16 06:17:42 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -438,7 +539,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:00:48 2016 +-- Definition current Wed May 16 06:17:43 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -456,7 +557,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:00:48 2016 +-- Definition current Wed May 16 06:17:43 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -471,7 +572,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:00:48 2016 +-- Definition current Wed May 16 06:17:43 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -488,7 +589,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:01:00 2016 +-- Definition current Wed May 16 06:17:58 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -503,7 +604,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:01:01 2016 +-- Definition current Wed May 16 06:17:59 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -521,7 +622,7 @@ A1 C1 B1 >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:01:07 2016 +-- Definition current Wed May 16 06:18:04 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -536,7 +637,7 @@ A1 C1 B1 >>invoke t116v1; -- Definition of Trafodion view TRAFODION.SCH.T116V1 --- Definition current Wed Dec 21 21:01:08 2016 +-- Definition current Wed May 16 06:18:05 2018 ( A INT NO DEFAULT NOT NULL NOT DROPPABLE @@ -560,8 +661,8 @@ A1 C1 B1 --- SQL operation complete. >> >>sh sqlci -iTEST116\(concurrent_ddl\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_ddl >>cqd ddl_transactions 'ON'; @@ -595,7 +696,7 @@ End of MXCI Session >>invoke t116t1; -- Definition of Trafodion table TRAFODION.SCH.T116T1 --- Definition current Wed Dec 21 21:01:31 2016 +-- Definition current Wed May 16 06:18:30 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -718,7 +819,7 @@ T116T1 >>invoke t116t2; -- Definition of Trafodion table TRAFODION.SCH.T116T2 --- Definition current Wed Dec 21 21:02:32 2016 +-- Definition current Wed May 16 06:19:38 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -744,7 +845,7 @@ T116T1 >>invoke t116t2; -- Definition of Trafodion table TRAFODION.SCH.T116T2 --- Definition current Wed Dec 21 21:02:51 2016 +-- Definition current Wed May 16 06:19:49 2018 ( SYSKEY LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE @@ -872,8 +973,8 @@ T116T1 >> >>-- insert a row using a concurrent hbase xn >>sh sqlci -iTEST116\(concurrent_hbase_xn_ins\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_hbase_xn_ins >>cqd traf_use_region_xn 'OFF'; @@ -925,8 +1026,8 @@ A B >> >>-- insert a row using a concurrent region xn >>sh sqlci -iTEST116\(concurrent_region_xn_ins\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_region_xn_ins >>cqd traf_use_region_xn 'ON'; @@ -955,8 +1056,8 @@ End of MXCI Session >>-- should show conflict >>commit work; -*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16975 regionTX: false status: PENDING scan Size: 2 write Size: 1 startSQ: 2]] has scan which conflicts with [[transactionId: 1554361158723058 regionTX: true status: COMMITED scan Size: 2 write Size: 1 startSQ: 2 commitedSQ:2]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01] -org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513) +*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4642 regionTX: false status: PENDING neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 2 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600654243836 regionTX: true status: COMMITED neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 2 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:2]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.] +org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525) --- SQL operation failed with errors. >>select * from t116t6; @@ -981,8 +1082,8 @@ A B >> >>-- upsert a row using a concurrent hbase xn >>sh sqlci -iTEST116\(concurrent_hbase_xn_ups\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_hbase_xn_ups >>cqd traf_use_region_xn 'OFF'; @@ -1034,8 +1135,8 @@ A B >> >>-- insert a row using a concurrent region xn >>sh sqlci -iTEST116\(concurrent_region_xn_ups\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_region_xn_ups >>cqd traf_use_region_xn 'ON'; @@ -1064,8 +1165,8 @@ End of MXCI Session >>-- should show conflict >>commit work; -*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16979 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 6]] has scan which conflicts with [[transactionId: 1554361174452391 regionTX: true status: COMMITED scan Size: 1 write Size: 1 startSQ: 6 commitedSQ:6]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01] -org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)iona +*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4646 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 6 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600673118601 regionTX: true status: COMMITED neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 6 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:6]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.] +org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525) --- SQL operation failed with errors. >>select * from t116t6; @@ -1093,8 +1194,8 @@ A B >> >>-- delete a row using a concurrent hbase xn >>sh sqlci -iTEST116\(concurrent_hbase_xn_del\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_hbase_xn_del >>cqd traf_use_region_xn 'OFF'; @@ -1144,8 +1245,8 @@ End of MXCI Session >> >>-- delete a row using a concurrent region xn >>sh sqlci -iTEST116\(concurrent_region_xn_del\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_region_xn_del >>cqd traf_use_region_xn 'ON'; @@ -1174,8 +1275,8 @@ End of MXCI Session >>-- should show conflict >>commit work; -*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16985 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 11]] has scan which conflicts with [[transactionId: 1554361190181566 regionTX: true status: COMMITED scan Size: 0 write Size: 1 startSQ: 11 commitedSQ:11]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], deleted row[\x80\x00\x00\x01] -org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513) +*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4652 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 11 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600691993433 regionTX: true status: COMMITED neverReadOnly: false scan Size: 0 write Size: 1 startSQ: 11 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:11]] which , deleted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.] +org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525) --- SQL operation failed with errors. >>select * from t116t6; @@ -1198,8 +1299,8 @@ org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513) >> >>-- delete a row using a concurrent hbase xn >>sh sqlci -iTEST116\(concurrent_hbase_xn_checkanddel\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_hbase_xn_checkanddel >>cqd traf_use_region_xn 'OFF'; @@ -1249,8 +1350,8 @@ End of MXCI Session >> >>-- delete a row using a concurrent region xn >>sh sqlci -iTEST116\(concurrent_region_xn_checkanddel\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_region_xn_checkanddel >>cqd traf_use_region_xn 'ON'; @@ -1279,8 +1380,8 @@ End of MXCI Session >>-- should show conflict >>commit work; -*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16991 regionTX: false status: PENDING scan Size: 1 write Size: 1 startSQ: 15]] has scan which conflicts with [[transactionId: 1554361202764668 regionTX: true status: COMMITED scan Size: 0 write Size: 1 startSQ: 15 commitedSQ:15]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], deleted row[\x80\x00\x00\x01] -org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)Za +*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4658 regionTX: false status: PENDING neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 15 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600710868339 regionTX: true status: COMMITED neverReadOnly: false scan Size: 0 write Size: 1 startSQ: 15 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:15]] which , deleted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.] +org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525) --- SQL operation failed with errors. >>select * from t116t6; @@ -1303,8 +1404,8 @@ org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)Za >> >>-- update row using a concurrent hbase xn >>sh sqlci -iTEST116\(concurrent_hbase_xn_checkandupd\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_hbase_xn_checkandupd >>cqd traf_use_region_xn 'OFF'; @@ -1359,8 +1460,8 @@ A B >> >>-- update row using a concurrent region xn >>sh sqlci -iTEST116\(concurrent_region_xn_checkandupd\) >> LOG116; -Apache Trafodion Conversational Interface 2.1.0 -Copyright (c) 2015-2016 Apache Software Foundation +Apache Trafodion Conversational Interface 2.3.0 +Copyright (c) 2015-2017 Apache Software Foundation >>?section concurrent_region_xn_checkandupd >>cqd traf_use_region_xn 'ON'; @@ -1389,8 +1490,8 @@ End of MXCI Session >>-- should show conflict >>commit work; -*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: Transaction [[transactionId: 16997 regionTX: false status: PENDING scan Size: 2 write Size: 1 startSQ: 20]] has scan which conflicts with [[transactionId: 1554361218493621 regionTX: true status: COMMITED scan Size: 1 write Size: 1 startSQ: 20 commitedSQ:20]]: region [TRAFODION.SCH.T116T6,,1482354300713.03a05b08f387a4eb4ef6323976d73e36.], scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01], inserted row[\x80\x00\x00\x01] -org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:513)1 +*** ERROR[8616] A conflict was detected during commit processing. Transaction has been aborted. Detail :org.trafodion.dtm.TransactionManagerException: org.apache.hadoop.hbase.coprocessor.transactional.CommitConflictException: java.io.IOException: This Transaction [[transactionId: 4664 regionTX: false status: PENDING neverReadOnly: false scan Size: 2 write Size: 1 startSQ: 20 prepareEditSize: 0 endEditSize: 0 editSize: 1]] has a scan, scanRange[startRow: \x80\x00\x00\x01, endRow: \x80\x00\x00\x01] that conflicts with a committed Transaction [[transactionId: 1600600729743055 regionTX: true status: COMMITED neverReadOnly: false scan Size: 1 write Size: 1 startSQ: 20 prepareEditSize: 1 endEditSize: 1 editSize: 1 commitedSQ:20]] which , inserted a row with key[\x80\x00\x00\x01], in the region [TRAFODION.SCH.T116T6,,1526451716937.fa9bf89e5ceeac7ed4ee428544f09af0.] +org.trafodion.dtm.HBaseTxClient.prepareCommit(HBaseTxClient.java:525) --- SQL operation failed with errors. >>select * from t116t6;