Bug #51474 Snippet saves partial SQL statement
Submitted: 24 Feb 2010 20:41 Modified: 27 Apr 2010 15:01
Reporter: Bob Halstead Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.16.5249 OS:Windows (XP)
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: snippets

[24 Feb 2010 20:41] Bob Halstead
Description:
Selecting a SQL statement that begins on any other line except the first line of the SQL Editor results in a partially copied sql statement being saved to the snippet.  It appears that the farther down the editor page the statement begins, the more that is cut off from the beginning of statement when it is saved as a snippet.

How to repeat:
Create a sql statement on any line but the first line of the editor.  Select the sql and click the "Save SQL to Snippets List" toolbar button.

Suggested fix:
Not sure if the intended functionality was to select a statement and save to the snippets list, or to just take the first statement in the editor starting at line 1 as the help documentation doesn't say.  It seems that since the editor allows you to select and execute a single statement regardless what line the statement begins, saving the selected statement should be the intended functionality.
[24 Feb 2010 21:33] MySQL Verification Team
Thank you for the bug report.
[26 Apr 2010 20:00] Johannes Taxacher
fix confirmed in repository
[27 Apr 2010 15:01] Tony Bedford
An entry has been added to the 5.2.20 changelog:

If a SQL statement was selected in the SQL Statements area of the SQL Editor, and copied to the snippets list using the Save SQL to Snippets List toolbar button, then the statement was only partially saved, the beginning of the statement being missing. This only happened for lines after the first line. Also, the further down the copied statement was located, the less text was successfully copied to the snippets list. This resulted in statements further down the code being heavily truncated, with only the latter portion of the statement being saved.