sql: fail to compute aggregate in complex query
commit: 5c3c8ed3
branch: 2.11.0-picodata
intel mac, Ventura 13.2.1
Create tables:
tarantool> box.execute([[create table u1 (i1 integer, primary key (i1))]])
---
- row_count: 1
...
tarantool> box.execute([[create table u2 (i2 integer, primary key (i2))]])
---
- row_count: 1
...
tarantool> box.execute([[insert into u1 values (1)]])
---
- row_count: 1
...
The following query works:
tarantool> box.execute([[select * from (select sum(i1) from u1) join (select sum(i2) from u2) on true]])
---
- metadata:
- name: COLUMN_1
type: integer
- name: COLUMN_2
type: integer
rows:
- [1, null]
...
If we replace scan u1
to (select i1 from u1)
the whole query fails:
box.execute([[select * from (select sum(i1) from (select i1 from u1)) join (select sum(i2) from u2) on true]])
---
- null
- 'Tuple field 1 (_COLUMN_0) type does not match one required by operation: expected
decimal, got unsigned'
...
Expected behaviour
The last query should work
Edited by Arseniy Volynets