Bug #77615 Workbench does case-sensitive comparison for primary keys -> readonly results
Submitted: 3 Jul 2015 20:12 Modified: 3 Jul 2015 23:44
Reporter: John Hawkinson Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:6.3.4 OS:Any (Mac OS X 10.9.5)
Assigned to: CPU Architecture:Any

[3 Jul 2015 20:12] John Hawkinson
Description:
Workbench 6.3.4.0 build 828 under OS X 10.9.5, but probably platform independent.
Server version:		5.6.21 MySQL Community Server (GPL)

MySQL Workbench does a case-sensitive comparison on a table's PRIMARY KEY column name to determine whether a query result should be editable.

So while these two queries return the same results

SELECT mypk, description FROM mytable;
SELECT MYPK, description FROM mytable;

if the canonical case of the primary key column is "MYPK" and not "mypk", then only the second query produces an editable result grid.

The check should be case-insensitive, or more properly it should probably test in a more direct way rather than going based on column name.

How to repeat:
DROP TABLE mytable;
CREATE TABLE mytable (MYPK VARCHAR(10), DESCRIPTION TINYTEXT, PRIMARY KEY (MYPK));
INSERT INTO mytable VALUES (1, "one");
SELECT mypk,description from mytable;

Table is readonly. Whereas:

DROP TABLE mytable;
CREATE TABLE mytable (MYPK VARCHAR(10), DESCRIPTION TINYTEXT, PRIMARY KEY (MYPK));
INSERT INTO mytable VALUES (1, "one");
SELECT MYPK,description from mytable;

Works fine.
[3 Jul 2015 23:44] MySQL Verification Team
Thank you for the bug report. Verified on Windows too.