Bug #64123 MySQL Workbench crashes when running stupidly simple query.
Submitted: 24 Jan 2012 17:35 Modified: 31 Jan 2012 13:20
Reporter: Richard Quadling Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.37 Revision 8576 OS:MacOS (10.5.6, 10.7.2)
Assigned to: CPU Architecture:Any

[24 Jan 2012 17:35] Richard Quadling
Description:
Running a simple SELECT statement and attempting to alias the only column selected results in a crash.

The query runs fine from the mysql prompt, so really does point to something in WorkBench.

I'll attach the crashlog when I've saved this.

How to repeat:
Running the following query to build a table, add data and select it ...

DROP TABLE IF EXISTS `wonky`;
CREATE TABLE `wonky` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aff_rid` int(11) NOT NULL DEFAULT '0',
  `aff_id` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
  `publish_retailer` bit(1) NOT NULL DEFAULT b'0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1284 DEFAULT CHARSET=utf8 COLLATE=utf8_bin CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;

INSERT INTO wonky(aff_rid, aff_id, name) VALUES(1, 123, 'Bob''s Shop');
INSERT INTO wonky(aff_rid, aff_id, name) VALUES(2, 123, 'Richard''s Shop');
INSERT INTO wonky(aff_rid, aff_id, name) VALUES(3, 123, 'Martin''s Shop');
INSERT INTO wonky(aff_rid, aff_id, name) VALUES(4, 123, 'Sally''s Shop');

UPDATE wonky SET publish_retailer = 1 WHERE name LIKE '%i%';

-- The following line will result in an error "Error: Index out of range."
-- SELECT id retailer_id FROM wonky where publish_retailer = 1;

-- The following line will crash MySQL WorkBench and produce a crash log.
-- SELECT id as retailer_id FROM wonky where publish_retailer = 1;
[24 Jan 2012 17:37] Richard Quadling
Crash log from MySQLWorkBench.

Attachment: MySQLWorkBenchCrashLog.txt (text/plain), 67.69 KiB.

[24 Jan 2012 17:42] Valeriy Kravchuk
Thank you for the bug report. Verified just as described while working with local MySQL 5.6.5.
[31 Jan 2012 6:42] Philip Olson
This bug has been fixed as of 5.2.38:

Running a SELECT statement and attempting to
alias the only column selected would result in a crash.
[31 Jan 2012 13:20] Richard Quadling
What is the release schedule for this version please?