Bug #49611 Deep tab indents in stored routine editor causes inaccessible characters
Submitted: 11 Dec 2009 6:33 Modified: 11 Dec 2009 10:57
Reporter: Scott Rosenberg Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.2.17 OS:Windows (XP SP3)
Assigned to: CPU Architecture:Any
Tags: editor, stored procedures, stored routines

[11 Dec 2009 6:33] Scott Rosenberg
Description:
In the stored routine editor, deeply tabbed indents (4 tab characters or more) causes some of the rightmost text to become inaccessible.

E.g. in the following line the pipe character represents the right-most position to which the cursor can be moved:

[TAB][TAB][TAB][TAB]SET v_this| = v_that + 7;

This seems to only occur when the text is pasted from another text editor (e.g. Editpad Lite, Notepad++, Notepad).

Obviously not a critical bug, but it's very aggravating when manipulating code in a text editor (e.g. for find replace), and c&p'ing back and forth.

How to repeat:
1) Enter the following text into a Windows text editor (e.g. Notepad), replacing "[TAB]" with actual tabs and [ANY-DB] with any valid DB on your system:

CREATE PROCEDURE `[ANY-DB]`.`AAAATEMP` ()
BEGIN

DECLARE v_this INTEGER DEFAULT 5;
DECLARE v_that INTEGER DEFAULT 7;

[TAB][TAB][TAB][TAB]SET v_this = v_that + 7;

END

2) Copy the above stored procedure.

3) In MySql Administrator, click "Catalogs" -> [db name] -> "Stored Procedures" -> "Create Stored Proc".

4) Enter any arbitrary legal proc name and click "Create PROCEDURE".

5) Paste the above text into the stored routine editor.

6) Click "Execute SQL".

7) Open the stored procedure you've just created.

8) Move your cursor down to line 7 (the one with the four tabs), and hit the "End" key or try to use the right-arrow to navigate to the end of the line.  It should be impossible to do so.

9) Note: Positioning your cursor immediately before the word "SET" and hitting backspace will remove one space (not a tab), and cause the end of the line to become accessible.  Deleting an arbitrary character after the "S" in "SET" will -not- cause the rest of the line to become accessible.

Suggested fix:
Out of my scope of knowledge.

As far as I can tell some tab characters are replaced by spaces in the editor and others are not (e.g. type a stored proc into the MySql Admin editor with lots of indenting and paste it into Notepad -- some characters you typed as tabs are now spaces, but not all).  I only mention this on the off chance it may somehow help.
[11 Dec 2009 10:57] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Administrator into MySQL Workbench and won't fix this anymore.

More informations about Workbench you will find here:

http://dev.mysql.com/workbench/