Wrong result when using analytic function on a view

5 posts / 0 new
Last post
alex
alex's picture
Offline
Last seen: 7 hours 11 min ago
Joined: Jan 14 2014
Junior Boarder

Posts: 8

Alexander Shestakov
Wrong result when using analytic function on a view

Hi, I am using community edition of InfiniDB built from source.

Server version: 5.1.73 InfiniDB 5.0 Alpha

 

select version();
+-----------+
| version() |
+-----------+
| 5.1.73    |
+-----------+
 

create table t(a bigint, b varchar(10)) engine=InfiniDb;

 

insert into t values (1, 'hi');

insert into t values (1, 'hello');

insert into t values (2, 'bye');

insert into t values (2, 'good night');

 

select t.*, row_number() over (partition by a order by b) as rnum from t;

+------+------------+------+
| a    | b          | rnum |
+------+------------+------+
|    1 | hello      |    1 |
|    1 | hi         |    2 |
|    2 | bye        |    1 |
|    2 | good night |    2 |
+------+------------+------+
 

So far so good.

Now try the same query from a view.

 

create view v as select * from t;

 

select v.*, row_number() over (partition by a order by b) as rnum from v;

+------+------------+------------+
| a    | b          | b          |
+------+------------+------------+
|    1 | hi         | hi         |
|    1 | hello      | hello      |
|    2 | bye        | bye        |
|    2 | good night | good night |
+------+------------+------------+
 
   

The last column is obviously wrong.

djoshi
djoshi's picture
Offline
Last seen: 2 months 20 hours ago
Joined: Jun 6 2012
Administrator

Posts: 28

Dipti Joshi
Wrong result when using analytic function on a view

Hello Alexander:

 

Thanks you for using InfiniDB. 5.1.73 you see is the MySQL version. Can you tell us what InfiniDB source version did you built from - 4.5.0 or 4.5.1 ? We are looking into it mean while.

 

Thanks,

Dipti

 

alex
alex's picture
Offline
Last seen: 7 hours 11 min ago
Joined: Jan 14 2014
Junior Boarder

Posts: 8

Alexander Shestakov
$ git branch -v
$ git branch -v
  master  ea4e16d 4.5.1 merge #6
 
davidhill
davidhill's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: Oct 27 2009
Administrator

Posts: 595

david hill
view query issue

Yes, you are correct. Thanks for posting this information.

 

We have open a BUG on the issue..

 

David

alex
alex's picture
Offline
Last seen: 7 hours 11 min ago
Joined: Jan 14 2014
Junior Boarder

Posts: 8

Alexander Shestakov
Is there an older version

Is there an older version where this is working?