Bug #10581 unable to select text after pasting query containing tab characters
Submitted: 12 May 2005 10:35 Modified: 23 Sep 2005 13:24
Reporter: Mathieu van Loon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.14 OS:Windows (Windows XP)
Assigned to: Mike Lischke CPU Architecture:Any

[12 May 2005 10:35] Mathieu van Loon
Description:
After pasting text containing tab characters into the Sql Query Area you are unable to select the last characters of the pasted text. The caret will be placed a few characters before the end of the text. You are unable to move the caret to the end of text. If you try to select all text (CTRL-A), the last characters will not be selected.

The number of characters you cannot select is related to the number of tabs in the pasted text. Please note that only tab character in specific locations will trigger this bug. This is what I determined about the locations so far:

- The tab character needs to be the first character of the line (it needs to be the first character after a newline)
- A leading tab character on the _first_ line will not trigger this bug. The tab needs to be on the second or later line.
- Adding more leading tabs will increase the number of 'unselectable' characters.

An example text (\n is newline, \t is tab):
SELECT *\n\tFROM user\n\t\tORDER BY host

How to repeat:
1. open MySQL Query Browser. Connect to the default MySQL database
2. open a text editor (Notepad). Enter the following text into the text editor (\n is newline, \t is a tab):
SELECT *\n\tFROM user\n\t\tORDER BY host
3. Copy the text to the clipboard.
4. Paste the text into the SQL Query Area in the MySQL Query Browser
5. The caret (the text cursor) will not be located after the word host. Instead, it will be located between the 'o' and the 's' of 'host'.
6. Try moving the caret right, using the arrow keys on your keyboard. This will not work.
7. Try moving the caret right, using the mouse. This will not work.
8. Try selecting all text, using CTRL-A. Not all text will be selected.

Suggested fix:
Workaround: Using the Delete key you are able to delete the 'unselectable' characters.

Impact: The bug is quite annoying if you are, like me, pasting queries of the form "SELECT * FROM table WHERE column="

Obviously you'd like to enter something after the = character, which this bug makes very difficult to do.
[12 May 2005 10:58] Mathieu van Loon
it turns out the bug is more pervasive. Any pasted text which contains tab characters will create 'unselectable' characters. It does not matter whether the tab characters are the first character in the line. However, the bug will not be triggered by tab characters in the _first_ line.
[13 May 2005 16:31] MySQL Verification Team
I was able to repeat.
[23 Sep 2005 8:56] Mathieu van Loon
Running version 1.1.14 now, the issue has disappeared in that version.
[23 Sep 2005 9:37] Mike Lischke
This is funny. I'm currently working on this problem and could solve it (there is some more todo, though). I wonder why you do not see it anymore. There was a problem with line end computation, which I doubt was correct between the your old version and 1.1.14 but not before that and in the current sources.

Anyway, this will be fixed today, no matter how it was before.

Mike
[23 Sep 2005 13:24] Mike Lischke
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html