Bug #9194 "Copy SQL to Clipboard" generates inconsistent output
Submitted: 15 Mar 2005 12:35 Modified: 31 Aug 2005 15:13
Reporter: Emanuele Dolis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.5 OS:
Assigned to: Michael G. Zinner CPU Architecture:Any

[15 Mar 2005 12:35] Emanuele Dolis
Description:
Using the 'copy sql to Clipboard' option on a table from the context menu of the left bar generates SQL where the drop statement refers to the database, while the create statement doesn't

If you use the code like that, you risk to create tables in different databases than the one they're dropped from.

How to repeat:
use the copy sql option after selecting a table. the output is like this:
______________________________________________________
DROP TABLE IF EXISTS `tntna`.`tb_dbr`;
CREATE TABLE `tb_dbr` (
  `cdDevBr` char(2) NOT NULL default '' ,
   PRIMARY KEY  (`cdDevBr`)
) ENGINE=MyISAM;
________________________________
as you can see DROP is done for `tntna`.`tb_dbr`, create for `currentDB`.`tb_dbr`. That's wrong 

Suggested fix:
either include the database reference or exclude it...
[18 Jul 2005 15:58] Lee Saferite
This 'feature' is still present in 1.1.13

I know it is listed as 'Non-critical', but it seems like it should be a trivial fix.  When will it be addressed?
[31 Aug 2005 15:13] 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