You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/01 00:30:21 UTC

[jira] [Commented] (TRAFODION-2247) upsert on altered aligned format table with missing columns inserts incorrect values

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

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

GitHub user selvaganesang opened a pull request:

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

    [TRAFODION-2247] upsert on altered aligned format table with missing …

    …columns inserts incorrect values
    
    While generating mergeInsertExpr or updateExpr, the added columns were not considered. This resulted
    in incorrect relative offset value in the expressions in case of aligned row format and the row got
    corrupted.

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

    $ git pull https://github.com/selvaganesang/incubator-trafodion trafodion-2247

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

    https://github.com/apache/incubator-trafodion/pull/737.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 #737
    
----
commit 4d31d6e21c54b976a97eeeba3694003744838718
Author: selvaganesang <se...@esgyn.com>
Date:   2016-09-30T23:37:28Z

    [TRAFODION-2247] upsert on altered aligned format table with missing columns inserts incorrect values
    
    While generating mergeInsertExpr or updateExpr, the added columns were not considered. This resulted
    in incorrect relative offset value in the expressions in case of aligned row format and the row got
    corrupted.

----


> 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)