[ 
https://issues.apache.org/jira/browse/TRAFODION-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15546894#comment-15546894
 ] 

ASF GitHub Bot commented on TRAFODION-2247:
-------------------------------------------

Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/737#discussion_r81869515
  
    --- Diff: core/sql/generator/GenRelUpdate.cpp ---
    @@ -539,7 +415,9 @@ static short genHbaseUpdOrInsertExpr(
          updateRowLen,      // (OUT) Destination tuple length
          updateExpr,  // (OUT) Generated expression
          updateTupleDesc, // (OUT) Tuple descriptor for destination tuple
    -     ExpTupleDesc::LONG_FORMAT);
    +     ExpTupleDesc::LONG_FORMAT,
    +     NULL, NULL, 0, NULL, NULL,
    --- End diff --
    
    Should this be NULL, NULL, 0, NULL, FALSE? (the last of these is an 
NABoolean, disableConstFolding). Though the code still works since NULL would 
map to FALSE.


> upsert on altered aligned format table with missing columns inserts incorrect 
> values  
> --------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2247
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2247
>             Project: Apache Trafodion
>          Issue Type: Bug
>            Reporter: Anoop Sharma
>            Assignee: Selvaganesan Govindarajan
>            Priority: Minor
>
> If following conditions are present, incorrect values are inserted/returned.
> -- table is an aligned format table
> -- a column is added to it
> -- upsert is used with missing columns
> -- cqd traf_upsert_mode is 'MERGE'
> If cqd is changed to 'REPLACE', correct values are inserted.
> Example 1: (incorrect value inserted)
> >>cqd traf_upsert_mode 'MERGE';
> --- SQL operation complete.
> >>drop table ta;
> --- SQL operation complete.
> >>create table ta
> +>(a char(15) not null primary key,b int) 
> +>attribute aligned format;
> --- SQL operation complete.
> >>alter table ta add c int;
> --- SQL operation complete.
> >>upsert into ta (a, c) values ('0001', 2);
> --- 1 row(s) inserted.
> >>select c from ta;
> C          
> -----------
> -1340071904
> --- 1 row(s) selected.
> >>
> >>
> Example 2: (correct value inserted)
> >>cqd traf_upsert_mode 'REPLACE';
> --- SQL operation complete.
> >>drop table ta;
> --- SQL operation complete.
> >>create table ta
> +>(a char(15) not null primary key,b int) 
> +>attribute aligned format;
> --- SQL operation complete.
> >>alter table ta add c int;
> --- SQL operation complete.
> >>upsert into ta (a, c) values ('0001', 2);
> --- 1 row(s) inserted.
> >>select c from ta;
> C          
> -----------
>           2
> --- 1 row(s) selected.
> >>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to