Bug #19000 export results creating additional column
Submitted: 11 Apr 2006 4:22 Modified: 6 Oct 2006 10:25
Reporter: Brandon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.20 OS:Windows (XP Pro)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any
Tags: Generic

[11 Apr 2006 4:22] Brandon
Description:
I am using MySQL Query Browser to Export results to HTML or Excel. Within the Query Browser the results look fine but upon exporting to HTML or Excel there is an additional column being added on.

Two similar queries will export different results to HTML than what the query browser display gives. This happens with similar queries within other tables in the specific schema.

Two examples follow (not using actual data):
______________________________________
Query: 
SELECT Customer_Name FROM customer;

Browser Display results: 
Customer_Name
-------------------
customer 1
customer 2
customer 3
customer 4

Export to HTML results:
Query SELECT Customer_Name , CUSTOMER_NUM FROM customer, Tue Apr 11 13:52:55 2006

Customer_Name	CUSTOMER_NUM
-------------------   --------------------
customer 1          148   
customer 2          282 
customer 3          356 
customer 4          462
____________________________________________

Query: 
SELECT Customer_Name FROM customer where Credit_Limit <= 7500;

Browser Display results: 
Customer_Name
-------------------
customer 1
customer 2
customer 3
customer 4

Export to HTML results:
Query SELECT Customer_Name , CUSTOMER_NUM FROM customer where Credit_Limit <= 7500, Tue Apr 11 13:31:57 2006

Customer_Name	CUSTOMER_NUM
-------------------   --------------------
customer 1          148   
customer 2          282 
customer 3          356 
customer 4          462
______________________________________________

Below are the SHOW CREATE TABLE results for the table in question:

'customer', 'CREATE TABLE `customer` (
  `CUSTOMER_NUM` char(3) NOT NULL,
  `CUSTOMER_NAME` char(35) NOT NULL,
  `STREET` char(15) default NULL,
  `CITY` char(15) default NULL,
  `STATE` char(2) default NULL,
  `ZIP` char(5) default NULL,
  `BALANCE` decimal(8,2) default NULL,
  `CREDIT_LIMIT` decimal(8,2) default NULL,
  `REP_NUM` char(2) default NULL,
  PRIMARY KEY  (`CUSTOMER_NUM`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1'

How to repeat:
Export data to a HTML or Excel file. View that exported document.
[11 Apr 2006 15:04] Valeriy Kravchuk
Thank you for a bug report. Verified just as described. I added 2 rows of data to your table to demonstrate the problem:

If the results of "SELECT some_columns FROM some_table" are exported to, say, HTML, PRIMARY KEY column(s) is always present in exported results, even they are not included in some_columns list.
[6 Oct 2006 10:25] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html