db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Daniels (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-6777) MERGE INSERT on GENERATED key causes npe
Date Mon, 01 Dec 2014 09:45:13 GMT
Alex Daniels created DERBY-6777:
-----------------------------------

             Summary: MERGE INSERT on GENERATED key causes npe
                 Key: DERBY-6777
                 URL: https://issues.apache.org/jira/browse/DERBY-6777
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.11.1.1
            Reporter: Alex Daniels


To reproduce: merge 2 tables where the recipient has a generated pk and the source table has
at least 6 rows of data.  

Example:

CREATE TABLE COLTEST.TEMPDATA1 (id BIGINT not null primary key GENERATED BY DEFAULT AS IDENTITY
(START WITH 1, INCREMENT BY 1), DATA1 VARCHAR(1024) not null, DATA2 VARCHAR(50));
CREATE TABLE COLTEST.TEMPDATA2 (DATA1 VARCHAR(50) not null, DATA2 VARCHAR(50));

INSERT INTO COLTEST.TEMPDATA2 (DATA1, DATA2) VALUES ('rowA', 'Ad2'),('rowB', 'Bd2'),('rowC',
'Cd2'),('rowD', 'Dd2'),('rowE', 'Ed2'),('rowF', 'Fd2');

MERGE INTO COLTEST.TEMPDATA1 M USING COLTEST.TEMPDATA2 AS U ON M.DATA1 = U.DATA1 
WHEN NOT MATCHED THEN INSERT (DATA1, DATA2) VALUES (U.DATA1, U.DATA2);





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

Mime
View raw message