You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by zellerh <gi...@git.apache.org> on 2017/10/03 17:13:28 UTC

[GitHub] incubator-trafodion pull request #1254: [TRAFODION-2719] Check for truncatio...

GitHub user zellerh opened a pull request:

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

    [TRAFODION-2719] Check for truncation and four more fixes

    This pull request combines five fixes, each in its own commit.
    
    **[TRAFODION-2719] Check for truncation of character columns**
    
    When inserting into a UTF-8 character column with a fixed number
    of characters, do a check whether the source string contains no
    more than the allowed number of characters (just checking the
    byte length is not enough). This bug does not show when using
    sqlci, since sqlci does its own check before calling the
    executor. It only happens when using JDBC or trafci.
    
    - core/sql/cli/CliExpExchange.cpp
    - core/sql/exp/exp_expr.h
    - core/sql/generator/GenExpGenerator.cpp
    - core/sql/sqlcomp/DefaultConstants.h
    - core/sql/sqlcomp/nadefaults.cpp
    
    
    **[TRAFODION-2736] Missing predicates on salt columns**
    
    In some cases, when we generate an index join (join of
    an alternate index with the clustering index), we lost
    the generated predicates on computed columns such as
    salt and division. 
    
    - core/sql/optimizer/RelScan.h
    - partial: core/sql/optimizer/TransRule.cpp
    
    
    **[TRAFODION-2751] Unnecessary PROBE_CACHE in an index join**
    
    An index join produces unique matches from the index, so
    a probe cache would be a waste of resources. Added a check
    to suppress probe cache for index joins.
    
    - core/sql/optimizer/OptLogRelExpr.cpp
    - partial: core/sql/optimizer/TransRule.cpp
    - core/sql/regress/core/EXPECTED005.SB
    
    **[TRAFODION-2752] Fix error message when UDR method not found**
    
    The error message displayed only the signature, but not the
    method name.
    
    - core/sql/regress/udr/EXPECTED100.SB
    - core/sql/regress/udr/TEST100
    - core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
    
    
    **[TRAFODION-2761] Error when all TMUDF columns are eliminated**
    
    Fix a couple of places where we would core dump when all
    columns of the input table of a TMUDF were eliminated. Also
    removed an unused NAColumnArray method that has a bug.
    
    - core/sql/executor/ExUdr.cpp
    - core/sql/generator/GenUdr.cpp
    - core/sql/optimizer/NAColumn.cpp
    - core/sql/optimizer/NAColumn.h
    - core/sql/regress/udr/EXPECTED001
    - core/sql/regress/udr/TEST001
    - core/sql/regress/udr/TEST001_Sessionize.java
    
    
    **Other fixes:**
    
    Change the swjdbc script to pick up the Trafodion version from
    the current environment, not when we run install_traf_components.
    
    - core/sqf/sql/scripts/install_traf_components


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

    $ git pull https://github.com/zellerh/incubator-trafodion bug/2719

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

    https://github.com/apache/incubator-trafodion/pull/1254.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 #1254
    
----
commit 279a9fd983bbd27eeacd5e084e1bf6b339cdd7ef
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:00:50Z

    [TRAFODION-2719] Check for truncation of character columns
    
    When inserting into a UTF-8 character column with a fixed number
    of characters, do a check whether the source string contains no
    more than the allowed number of characters (just checking the
    byte length is not enough). This bug does not show when using
    sqlci, since sqlci does its own check before calling the
    executor. It only happens when using JDBC or trafci.

commit 4327078e805617293c7a7ae028763b0949f6ec9f
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:02:04Z

    [TRAFODION-2736] Missing predicates on salt columns
    
    In some cases, when we generate an index join (join of
    an alternate index with the clustering index), we lost
    the generated predicates on computed columns such as
    salt and division.

commit 839f222356ed482215d876414761b4f1fcd54e59
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:02:52Z

    [TRAFODION-2751] Unnecessary PROBE_CACHE in an index join
    
    An index join produces unique matches from the index, so
    a probe cache would be a waste of resources. Added a check
    to suppress probe cache for index joins.

commit 4b1c64c892e68cfbecd1f87bc7ddc5327c52723c
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:03:40Z

    [TRAFODION-2752] Fix error message when UDR method not found
    
    The error message displayed only the signature, but not the
    method name.

commit 4e7ad3aa967a60d4a212074e962f0f22a811eaf0
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:04:12Z

    [TRAFODION-2761] Error when all TMUDF columns are eliminated
    
    Fix a couple of places where we would core dump when all
    columns of the input table of a TMUDF were eliminated. Also
    removed an unused NAColumnArray method that has a bug.

commit cd8c3a90df1e86f33bc783be212b2b11d1600170
Author: Hans Zeller <hz...@apache.org>
Date:   2017-10-03T17:04:40Z

    Change the swjdbc script to pick up the Trafodion version from
    the current environment, not when we run install_traf_components.

----


---

[GitHub] incubator-trafodion pull request #1254: [TRAFODION-2719] Check for truncatio...

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

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


---

[GitHub] incubator-trafodion pull request #1254: [TRAFODION-2719] Check for truncatio...

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/1254#discussion_r142528667
  
    --- Diff: core/sql/optimizer/OptLogRelExpr.cpp ---
    @@ -2394,7 +2394,7 @@ Join::synthConstraints(NormWA * normWAPtr)
       (void) leftGA.hasCardConstraint(minLeft,maxLeft);
       (void) rightGA.hasCardConstraint(minRight,maxRight);
     
    -  if (maxLeft == 1)
    +  if (maxLeft == 1 || isIndexJoin_)
    --- End diff --
    
    What happens in the case of joining a non-unique index to a base table? Would we want to have probe caches then?


---

[GitHub] incubator-trafodion pull request #1254: [TRAFODION-2719] Check for truncatio...

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

    https://github.com/apache/incubator-trafodion/pull/1254#discussion_r142535910
  
    --- Diff: core/sql/optimizer/OptLogRelExpr.cpp ---
    @@ -2394,7 +2394,7 @@ Join::synthConstraints(NormWA * normWAPtr)
       (void) leftGA.hasCardConstraint(minLeft,maxLeft);
       (void) rightGA.hasCardConstraint(minRight,maxRight);
     
    -  if (maxLeft == 1)
    +  if (maxLeft == 1 || isIndexJoin_)
    --- End diff --
    
    The non-unique index contains one row for each base table row, and it contains the clustering key of that row. So, there is still a 1:1 match between the non-unique index and the base table/clustering index, and a probe cache would not have any cache hits.


---

[GitHub] incubator-trafodion pull request #1254: [TRAFODION-2719] Check for truncatio...

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/1254#discussion_r142542077
  
    --- Diff: core/sql/optimizer/OptLogRelExpr.cpp ---
    @@ -2394,7 +2394,7 @@ Join::synthConstraints(NormWA * normWAPtr)
       (void) leftGA.hasCardConstraint(minLeft,maxLeft);
       (void) rightGA.hasCardConstraint(minRight,maxRight);
     
    -  if (maxLeft == 1)
    +  if (maxLeft == 1 || isIndexJoin_)
    --- End diff --
    
    Thanks. I guess I was thinking about joins to the index from elsewhere. But that's not what this code is dealing with.


---