Bug #11340 Download results in zero length file
Submitted: 15 Jun 2005 8:01 Modified: 29 Jun 2005 17:10
Reporter: Kai Sautter (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.10 OS:Microsoft Windows (Windows XP (SP2))
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[15 Jun 2005 8:01] Kai Sautter
Description:
I was running from within a query tab a stored procedure which outputs several results of select statements. Once the results are available, I try to download the results via right click "Export results ...". The file is created, but has zero length. Furthermore, Query Browser does not report success (any available file type results in the same). The same result can be atained via the menu path and also if all other result panes have been closed. Downloading from another query tab where a simple "standard" select command had been executed works fine within the same session.

How to repeat:
see above.

The script to create the stored procedure could look like this:

CREATE PROCEDURE proc1(IN var1 as tinyint unsigned)

BEGIN

Select var1 as 'Variable1';

select * from TABLE1 where FIELD1 = var1;

select count(*) from TABLE2 right join
  (select * from TABLE1 where FIELD1 = var1)
  on (TABLE2.FIELD10 = TABLE1.FIELD2 and TABLE2.FIELD11 = TABLE1.FIELD3)
  where not (TABLE2.FIELD13 is null);

END
[22 Jun 2005 17:32] MySQL Verification Team
I was able successfully export data returned by first SELECT, but got empty files for other SELECTs.
[29 Jun 2005 17:10] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

please notice that only resultset which is currently focused in the window will be exported