You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ivan Pavlukhin (JIRA)" <ji...@apache.org> on 2019/08/14 06:41:00 UTC

[jira] [Commented] (IGNITE-12068) puzzling select result

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

Ivan Pavlukhin commented on IGNITE-12068:
-----------------------------------------

[~JerryKwan], you faced (for our shame) a bug related to an optimization for a primary key equality lookup. Erroneously it assumes that there should be only one result row. As a workaround I was able to get proper results using filtering condition {{WHERE id >= 1 and id < 2}}. But it is really weird, hope to fix it shortly.

> puzzling select result
> ----------------------
>
>                 Key: IGNITE-12068
>                 URL: https://issues.apache.org/jira/browse/IGNITE-12068
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.7.5
>         Environment: System version: CentOS Linux release 7.6.1810 (Core)
> Apache Ignite version: apache-ignite-2.7.5-1.noarch
>            Reporter: JerryKwan
>            Priority: Major
>
> select using the first primary key only returns one record, but it should return more records.
> The following is how to reproduce this problem
> 1, create a table using
> CREATE TABLE IF NOT EXISTS Person(
>  id int,
>  city_id int,
>  name varchar,
>  age int, 
>  company varchar,
>  PRIMARY KEY (id, city_id)
> );
> 2, insert some records
> INSERT INTO Person (id, name, city_id) VALUES (1, 'John Doe', 3);
> INSERT INTO Person (id, name, city_id) VALUES (1, 'John Dean', 4);
> INSERT INTO Person (id, name, city_id) VALUES (2, 'Alex', 4);
> 3, query using 'select * from Person' show all of the records, expected
> [http://www.passimage.in/i/03da31c8f23cf64580d5.png]
> 4, query using 'select * from Person where id=1', only get one record, NOT expected
> [http://www.passimage.in/i/f5491491a70c5d796823.png]
> 5, query using 'select * from Person where city_id=4' get  two records, expected
> [http://www.passimage.in/i/ff0ee4f5e882983d779d.png]
> Why  'select * from Person where id=1', only get one record? and how to fix this? Is there any special operations/configurations to do?



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)