You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:17:29 UTC

[jira] [Created] (TRAFODION-593) LP Bug: 1364575 - Index created prior to ‘upsert using load’ causes query to return wrong results

Alice Chen created TRAFODION-593:
------------------------------------

             Summary: LP Bug: 1364575 - Index created prior to ‘upsert using load’ causes query to return wrong results
                 Key: TRAFODION-593
                 URL: https://issues.apache.org/jira/browse/TRAFODION-593
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-exe
            Reporter: Weishiun Tsai
            Assignee: Anoop Sharma
            Priority: Blocker
             Fix For: 0.9 (pre-incubation)


If an index is created prior to using ‘upsert using load’ to load a table, the index is not populated.  This only happens with ‘upsert using load’.  An index created this way is populated fine with ‘upsert’ or ‘insert’.

This poses a query correctness problem as a query would return wrong results if the query plan selected uses index_scan to get the data.  This problem can be seen on the 0830_0830 build installed on a workstation.

------------------------------------------

Here is the entire script to reproduce this problem:

create table t (a int, b int, c int);

create index myindex on t (a, b, c);

upsert using load into table t values (1, 1, 1), (2, 2, 2), (3, 3, 3);

prepare xx from select * from t;

explain options 'f' xx;

execute xx;

set parserflags 1;

select * from table(INDEX_TABLE myindex);

------------------------------------------

Here is the execution output of the script:

>>create table t (a int, b int, c int);

--- SQL operation complete.
>>
>>create index myindex on t (a, b, c);

--- SQL operation complete.
>>
>>upsert using load into table t values (1, 1, 1), (2, 2, 2), (3, 3, 3);

--- 3 row(s) inserted.
>>
>>prepare xx from select * from t;

--- SQL command prepared.
>>
>>explain options 'f' xx;

LC   RC   OP   OPERATOR              OPT       DESCRIPTION           CARD
---- ---- ---- --------------------  --------  --------------------  ---------

1    .    2    root                                                  1.00E+002
.    .    1    trafodion_index_scan            T                     1.00E+002

--- SQL operation complete.
>>
>>execute xx;

--- 0 row(s) selected.
>>
>>set parserflags 1;

--- SQL operation complete.
>>
>>select * from table(INDEX_TABLE myindex);

--- 0 row(s) selected.



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