Redshift picks wrong column when ambiguity occurs

Bug #1705400 reported by Jaya Ananthram
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Redshift
Invalid
Undecided
Unassigned

Bug Description

Redshift picks wrong column when ambiguity occurs instead of throwing errors

Steps to reproduce:

Step #1)
create table #temp1 (
col1 int,
col2 int
);

Step #2)
insert into #temp1 (col1, col2) values (1,1);
insert into #temp1 (col1, col2) values (2,2);
insert into #temp1 (col1, col2) values (3,3);
insert into #temp1 (col1, col2) values (4,4);

Step #3)
SELECT col1 AS tempcol INTO #temp2 FROM #temp1 where #temp1.col1 <=2;

Step #4)
DELETE from #temp1 where col1 in (select col1 from #temp2);

Here in the inner query "select col1 from #temp2" col1 doesn't exists in #temp2 (#temp2 has a column tempcol). So it picks col1 from #temp1 and trying to runn the query. So as a result all the records has been deleted. But actually it should throw error saying that col1 is not present in #temp2.

description: updated
description: updated
description: updated
description: updated
Revision history for this message
Mathieu Marquer (slasher-fun) wrote :

Related to Amazon Redshift, not to this software called Redshift.

Changed in redshift:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.