Bug #61523 Invalid SQL when attempting to view general server logs
Submitted: 15 Jun 2011 12:49 Modified: 24 Aug 2011 23:52
Reporter: Anthony Pidden Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:5.2.34 CE rev 7780 OS:Windows (7 x64)
Assigned to: CPU Architecture:Any
Tags: logging, Logs, SQL

[15 Jun 2011 12:49] Anthony Pidden
Description:
When loading 'Server Logs' in the Admin section the following error message is shown:

Unhandled exception: Error fetching log contents: Error executing 'You have an error in your SQl syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-50,50' at line 1'
SELECT * FROM mysql.general_log ORDER BY event_time DESC LIMIT -50,50.
SQL Error: 1064

MySQL Server version 5.1.49-3 running on Debian Linux connected to on TCP via a SSH tunnel

Note: Currently mysql.general_log is empty

How to repeat:
1. Ensure logging is set to TABLE or FILE,TABLE
2. Connect to server on Workbench Admin
3. Click 'Server Logs'

Suggested fix:
When compiling the query add a check in to prevent negative start LIMIT.
[15 Jun 2011 13:20] MySQL Verification Team
Thank you for the bug report.
[24 Aug 2011 23:52] Philip Olson
This is fixed as of 5.2.35:

+        Viewing the Admin Management option <guimenu>Server
+        Logs</guimenu> with an empty <literal>TABLE</literal> resulted
+        in an unhandled exception.