Bug #2462 Subselect query gives the right result only once in prepared statement
Submitted: 20 Jan 2004 10:01 Modified: 20 Feb 2004 5:50
Reporter: Alexey Botchkov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1 OS:Any (All)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[20 Jan 2004 10:01] Alexey Botchkov
Description:
Some sort of queries with subselects don't give the right result
on the second mysql_execute() call.

How to repeat:
Data:
create table t1 (a int , b int);
insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5);
create table t2 select * from t1;

Program:
  look at the Files section

Suggested fix:
Item_subselect::cleanup() should be fixed with this
[20 Jan 2004 10:04] Alexey Botchkov
program producing the bug

Attachment: test1.c (text/plain), 5.05 KiB.

[5 Feb 2004 2:44] Oleksandr Byelkin
Work on this bug is stoped until count(distinct) in stored procedures will be 
fixed.
[5 Feb 2004 5:12] Oleksandr Byelkin
Sorry, I mean prepared statements. 
BUt all that comment was mistake. I am working on this bug using other 
subquery.
[8 Feb 2004 10:19] Oleksandr Byelkin
ChangeSet 
  1.1693 04/02/08 20:14:13 bell@sanja.is.com.ua +17 -0 
  fixed subquery with PS (BUG#2462) 
  fixed UNION preparation
[20 Feb 2004 5:50] Oleksandr Byelkin
pushed