Bug #45051 Limit 0, 1000 is added to all queries (but hidden)
Submitted: 24 May 2009 3:33 Modified: 16 Jul 2009 9:45
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.1 OS:MacOS (10.5)
Assigned to: Sergei Tkachenko CPU Architecture:Any
Tags: CHECKED

[24 May 2009 3:33] Diego Medina
Description:
If you enter a query like

SELECT * FROM mytable LIMIT 10

You do not get any error, but if you go to another tab and come back, you will see an error like

"... error on your syntax ... near LIMIT 0,1000"

If I remove the LIMIT 10 clause form my query, I then see that WB adds a limit to the query, but it is not displayed on the UI

How to repeat:
1- Open WB and connect to a dabase
2- Double click on the Connection icon to open a query tab
3- Enter a query like 

SELECT * FROM mytable LIMIT 10

4- Execute it
5- You will not get any data nor an error
6- Go to another tab and come back
7- You will see the error message from mysql about the LIMIT 0,1000 syntax error

Suggested fix:
Show that you are adding LIMIT 0,1000 to the query so that the end user can edit it.
[24 May 2009 9:33] Michael G. Zinner
When the user specifies his own LIMIT clause, the automatic LIMIT 0,1000 should be omitted. In this case the user is responsible for not fetching too many rows himself.
[15 Jul 2009 17:55] Johannes Taxacher
fix confirmed; it will be included in 5.2.2
[16 Jul 2009 9:45] Tony Bedford
An entry was added to the 5.2.2 changelog:

If a user added a LIMIT clause to a query, the automatically added LIMIT 0,1000 clause caused a syntax error.