You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by robertamarton <gi...@git.apache.org> on 2017/06/02 23:06:05 UTC

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

GitHub user robertamarton opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/1109

    TRAFODION - 2632 Performing update statistics on metadata tables caus…

    …es issues
    
    Added code to return error and cleanup code a bit:
    *** ERROR[9205] UPDATE STATISTICS is not supported for object <metadata table>
    
    Also fixed a problem where privileges on Hive tables that included external
    table gave false "no priv" error for the SHOWDDL <hive table> command.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertamarton/incubator-trafodion update-stats

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/1109.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1109
    
----
commit 63b275d406e29bcaba1ab42e57a656bb8dd8ce31
Author: Roberta Marton <rm...@edev07.esgyn.local>
Date:   2017-06-02T23:04:08Z

    TRAFODION - 2632 Performing update statistics on metadata tables causes issues
    
    Added code to return error and cleanup code a bit:
    *** ERROR[9205] UPDATE STATISTICS is not supported for object <metadata table>
    
    Also fixed a problem where privileges on Hive tables that included external
    table gave false "no priv" error for the SHOWDDL <hive table> command.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1109#discussion_r120198661
  
    --- Diff: core/sql/ustat/hs_parser.cpp ---
    @@ -178,89 +178,24 @@ Lng32 AddTableName( const hs_table_type type
           }
         else
           {
    -        // When CQD DEFAULT_SCHEMA_ACCESS_ONLY is on, 
    -        // users cannot update stats on tables not in the default/public schemas.
    -        if ( schema && 
    -             ActiveSchemaDB()->getDefaults().getToken(DEFAULT_SCHEMA_ACCESS_ONLY)==DF_ON )
    -        {
    -          SchemaName objSchName;
    -          NAString curSchName(schema);
    -          NAString curCatName;
    -          objSchName.setSchemaName(curSchName);
    -          if (catalog)
    -          {
    -            curCatName = catalog;
    -            objSchName.setCatalogName(curCatName);
    -          }
    -          else
    -            curCatName = ActiveSchemaDB()->getDefaultSchema().getCatalogName();
    -
    -          // If the schema is neither default nor public,
    -          // issue inaccessible error.
    -          if (!objSchName.matchDefaultPublicSchema())
    -          {
    -            NAString dataObj(curCatName);
    -            if (!dataObj.isNull()) dataObj += ".";
    -            dataObj += curSchName + ".";
    -            dataObj += table;
    -            HSFuncMergeDiags(-UERR_OBJECT_INACCESSIBLE, dataObj.data());
    -            retcode = -1;
    -            HSHandleError(retcode);
    -          }
    -        }
    -
             if (catalog)
               catName = catalog;
             else
               {
    -            // LCOV_EXCL_START :nsk
    -            if (SqlParser_NAMETYPE == DF_NSK)
    -              {
    -                catName = SqlParser_MPLOC.getSysDotVol();
    -                hs_globals->tableType = GUARDIAN_TABLE;
    -                hs_globals->tableFormat = SQLMP;
    -              }
    -            else
    -            // LCOV_EXCL_STOP
    -              catName = ActiveSchemaDB()->getDefaultSchema().getCatalogName();
    +            catName = ActiveSchemaDB()->getDefaultSchema().getCatalogName();
    --- End diff --
    
    Thank you for getting rid of the NSK anachronisms.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1109#discussion_r120198438
  
    --- Diff: core/sql/ustat/hs_globals.cpp ---
    @@ -3788,7 +3788,7 @@ NABoolean HSGlobalsClass::isAuthorized(NABoolean isShowStats)
                 << DgSqlCode( -4481 )
                 << DgString0( "SELECT or MANAGE_STATISTICS" )
                 << DgString1( objDef->getNATable()->getTableName().getQualifiedNameAsAnsiString() );
    -            authorized = FALSE;
    +            return FALSE;
    --- End diff --
    
    Ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-trafodion/pull/1109


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1109#discussion_r120198402
  
    --- Diff: core/sql/ustat/hs_globals.cpp ---
    @@ -3776,7 +3776,7 @@ NABoolean HSGlobalsClass::isAuthorized(NABoolean isShowStats)
            if (privs == NULL)
              {
                *CmpCommon::diags() << DgSqlCode(-1034);
    -            authorized = FALSE;
    +            return FALSE;
    --- End diff --
    
    Changing this to an immediate return breaks the timer at line 3795. Please either add a call to LM->LogTimeDiff or revert this change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-trafodion pull request #1109: TRAFODION - 2632 Performing update s...

Posted by robertamarton <gi...@git.apache.org>.
Github user robertamarton commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1109#discussion_r120394504
  
    --- Diff: core/sql/ustat/hs_globals.cpp ---
    @@ -3776,7 +3776,7 @@ NABoolean HSGlobalsClass::isAuthorized(NABoolean isShowStats)
            if (privs == NULL)
              {
                *CmpCommon::diags() << DgSqlCode(-1034);
    -            authorized = FALSE;
    +            return FALSE;
    --- End diff --
    
    The return was added because the next statement "if ( privs->hasSelectPriv() )" cores if privs is NULL.     But will change the code to not break the time.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---