Bug #16148 Running an ALTER TABLE statment runs, but reports an error
Submitted: 3 Jan 2006 9:59 Modified: 22 Sep 2006 12:11
Reporter: Drew Noble Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.18 OS:Windows (Windows XP)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any
Tags: Source Editors

[3 Jan 2006 9:59] Drew Noble
Description:
After creating a new schema then running a basic ALTER TABLE statement, Query Browser runs the script and creates the column, but then reports a duplicate column error (1060), as if the script had already been run.  This behaviour didn't occur on 1.1.17 and doesn't happen when running on the command line

How to repeat:
CREATE TABLE IF NOT EXISTS `table` (
  `id` int(0) NOT NULL AUTO_INCREMENT PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

SET @db_version = "x.x.x";
SET @script_type = "XXXXX";
SET @required_by = "XXX x.x.x";
SET @provides = "xxxxx";
ALTER TABLE `table` ADD COLUMN `columnName` CHAR(1) NOT NULL AFTER `id`;

Suggested fix:
Works fine if run via mysql command line
[3 Jan 2006 10:46] MySQL Verification Team
Thank you for the bug report.
[22 Sep 2006 12:07] Vladimir Kolesnikov
Hi,

I cannot repro the bug with the latest version of QB (1.2.3 beta).

If you are able to reproduce the bug with one of the latest versions, please change the version on this bug report to the version you tested and change the status back to "Open".  Again, thank you for your continued support of MySQL.

Thanks