[MCOL-437] Cross Join between InnoDB and Columnstore tables returns wrong results Created: 2016-12-05  Updated: 2016-12-05  Resolved: 2016-12-05

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.0.5
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Kumar Saurav Sonu Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Attachments: PNG File Incorrect_Output_Of_Query.png    
Issue Links:
Duplicate
is duplicated by MCOL-424 cross engine subquery losing where cl... Closed

 Description   

Steps to reproduce :-
1)Create a table -> table_1
CREATE TABLE `table_1` (
`id` int(11) NOT NULL,
`time_slice_size` int(11) DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1;
2)Insert data in table_1 :-
insert into table_1 values(1,60);
insert into table_1 values(2,60);
3)Create another table -> table_2
CREATE TABLE `table_2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`start_timestamp` timestamp NULL DEFAULT NULL,
`end_timestamp` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9155 DEFAULT CHARSET=latin1;
4)Insert data into table_2 :-
insert into table_2 values (1,'2016-10-10 08:00:00','2016-10-10 09:00:00');
insert into table_2 values (2,'2016-10-10 08:00:00','2016-10-10 09:00:00');

5)Run the below query :-
select tb1.time_slice_size,tb2.id tb2_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id and tb2.id = 1;
This returns two row it should return one row.

Same problem is with below query(with IN )

select tb1.time_slice_size,tb2.id tb2_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id and tb2.id in (1);

but the weird thing is that when i add one more id then it returns correct result,see below :-
select tb1.time_slice_size,tb2.id tb2_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id and tb2.id in (1,3);

Please see screen shot for details.



 Comments   
Comment by David Thompson (Inactive) [ 2016-12-05 ]

This is a duplicate of MCOL-424 that is fixed in the next release. There are some workarounds listed that may or may not apply to your use case.

Generated at Thu Feb 08 02:21:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.