Bug #63949 Can't select data when no primary key defined for the table
Submitted: 6 Jan 2012 10:41 Modified: 11 Jan 2012 18:15
Reporter: Carlos Ferreira Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.36, 5.2.37 OS:Windows
Assigned to: CPU Architecture:Any

[6 Jan 2012 10:41] Carlos Ferreira
Description:
When you have a table without a primary key (example: with 2 foreign keys), you can't select data, on SQL Editor, giving the following error 

"SELECT * FROM cacas.profile_permissions LIMIT 0, 1000	Error: `cacas`.`profile_permissions`: table data is not editable because there is no primary key defined for the table"

This happens after update MySQL Workbench to this version.
To workaround this, you have to preferences and select or unselect the Safe Updates checkbox. You'll have to reconnect to your database to get the setting to apply and after it works ok.

How to repeat:
This happens only in SQLEditor of WorkBench
1 - In a previous version uncheck Safe Updates checkbox.
2 - Create a table with 2 foreign keys and none primary key.
3 - Update MySQL Workbench from a previous version to version 5.2.36
4 - In the table created select * from table

Workaroud
5 - Go to Preferences and check the Safe Updates
6 - Close connection and reconnect to your database
7 - Repeat 4
[6 Jan 2012 14:15] MySQL Verification Team
Please check with new version 5.2.37. Thanks.
[6 Jan 2012 14:21] Carlos Ferreira
Tested! After my report, i have installed 5.2.37 and it's the same. If you want I can attach a image showing this bug.
[10 Jan 2012 15:07] Amanda Ricketson
I'm also experiencing this, though the workaround doesn't work for me, as I'm getting this regardless of my "safe updates" setting. Also, this seems to be something that starts happening after a period of time - I was able to select from a table with no PK for a while, until last evening when I was suddenly no longer able to. When I was previously experiencing this, I was able to get around it by simply restarting the workbench.
[10 Jan 2012 15:08] Amanda Ricketson
Forgot to add: I am using version 5.2.37 on Windows 7
[11 Jan 2012 11:00] Rob Wilmshurst
Duplicate of 62893?
[11 Jan 2012 11:03] Carlos Ferreira
Not really. This problem is a table without primary key (example, with 2 foreign keys). The 62893 bug is for tables with primary key.
[11 Jan 2012 18:15] Alfredo Kojima
Duplicate of bug #63867
[6 Jun 2013 14:58] Rune Stilling
Bug still present in MySQL Workbench 5.2.47 on Windows.