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

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

GitHub user DaveBirdsall opened a pull request:

    https://github.com/apache/trafodion/pull/1484

    [TRAFODION-3000] Fix binder issue with index maintenance on MERGE DELETE

    The inlining code for index maintenance in one place was assuming a record 
descriptor (RETDesc) for new values existed for a MERGE DELETE statement 
lacking a "when not matched" clause. But no such record descriptor exists, 
since there are no values being updated or inserted. That place has been 
changed to use the old record descriptor.

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

    $ git pull https://github.com/DaveBirdsall/trafodion Trafodion3000

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

    https://github.com/apache/trafodion/pull/1484.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 #1484
    
----
commit b4c60e151b3103d43ded0e62d9da7d9e69821e29
Author: Dave Birdsall <dbirdsall@...>
Date:   2018-03-19T23:14:57Z

    [TRAFODION-3000] Fix binder issue with index maintenance on MERGE DELETE

----


> MERGE DELETE on table with unique index fails with error 4002
> -------------------------------------------------------------
>
>                 Key: TRAFODION-3000
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3000
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.3
>            Reporter: David Wayne Birdsall
>            Assignee: David Wayne Birdsall
>            Priority: Major
>
> The following session illustrates the problem:
> {{>>drop table if exists t1 cascade;}}
> {{--- SQL operation complete.}}
> {{>>}}
> {{>>create table t1 (c1 int not null, c2 int, primary key (c1), unique 
> (c2));}}
> {{--- SQL operation complete.}}
> {{>>insert into t1 values (1,1),(2,2),(3,3);}}
> {{--- 3 row(s) inserted.}}
> {{>>}}
> {{>>merge into t1 on c2=1 when matched then delete;}}
> {{*** ERROR[4002] Column "NEW@".C2 is not found. Table "NEW@" not exposed. 
> Tables in scope: "OLD@". Default schema: TRAFODION.SEABASE.}}
> {{*** ERROR[8822] The statement was not prepared.}}
> {{>>}}
> If the "unique" constraint is absent in the CREATE TABLE statement, the MERGE 
> statement completes successfully.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to