Bug #21069 Undo doesn't undo the text correctly. (still exists)
Submitted: 14 Jul 2006 17:02 Modified: 12 Jan 2007 10:23
Reporter: Daniel Katz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.8 (beta) OS:Windows (Windows XP SP2 (current patches))
Assigned to: Mike Lischke CPU Architecture:Any
Tags: Source Editors

[14 Jul 2006 17:02] Daniel Katz
Description:
When typing text into the SQL Query area, simple undos executed with Ctrl-Z will not act as expected.

How to repeat:
A simple example (perhaps not canonical):

Type this into the window (without quotes):

'abcdefghijklmnopqrstuvwxyz'

Then replace a section with numbers (highlight 'fghij') and replace it with '12345'.
leaving the string:

'abcde12345klmnopqrstuvwxyz'

Hitting Ctrl-z once will remove the added numbers except the first one leaving the string:

'abcde1klmnopqrstuvwxyz'

Hitting Ctrl-z again (to hopefully replace the original letters) will replace the once removed 'fghij' however highlight '1fghi' (the number 1 shouldn't be there) as well as removing 'klm' which once existed to the right of the selection.

leaving:

'abcde1fghijopqrstuvwxyz'

---- 

Other case (summarized)
abcdefghijklmnopqrstuvwxyz
+1234567890 -> 
abcde1234567890pqrstuvwxyz
Ctrl-z ->
abcde1pqrstuvwxyz   (correct, except errant '1')
Ctrl-z ->
abcde1fghijklmnoyz  (replaced previously overwritten letters but now 'pqrstuvwx' is missing)
[15 Jul 2006 14:26] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version of QB, 1.2, from http://dev.mysql.com/downloads/gui-tools/5.0.html. Inform about the results.
[17 Jul 2006 15:25] Daniel Katz
Per your request, I also tested the newest beta version and I found the same results.

This bug *does* exist in the new beta version 1.2.1
[18 Jul 2006 16:41] MySQL Verification Team
Thank you for the bug report. Verified as described.
[5 Dec 2006 14:37] Mike Lischke
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/
[12 Dec 2006 11:21] MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=25002 was marked as duplicate
of this one.
[12 Dec 2006 16:04] Daniel Katz
Bug still exists in the latest version (verified in 1.2.6) although slightly different results than user posted.  Same results from original bug posting.

- in Query-area type: "SELECT Select_priv FROM mysql.db;"
- double-click-select "Select_priv"
- type or paste "COUNT(*)"
- undo (Ctrl-Z)
<strike>- notice line becoming: "SELECT COUNT(*)Select_privOM mysql.db;"</strike>
- notice line becoming: SELECT CSelect_privl.db;

Also original usage case:

- in Query-area type: "abcdefghijklmnopqrstuvwxyz"
- highlight "fghij"
- type "12345"
- undo (Ctrl-Z)
- Notice errant text: "abcde1klmnopqrstuvwxyz"
- undo (Ctrl-Z) (again)
- Notice errant text: "abcde1fghijopqrstuvwxyz"
[16 Dec 2006 13:47] MySQL Verification Team
Tested with 1.2.8

- typed in query area: qwerty asdfg zxcvb
- then double click on asdfg
- typed 12345
- ctrl+Z
- result: qwerty 1 zxcvb
[18 Dec 2006 10:53] Yahoo Serious
undoing after having hit an enter will get you nice results too:
  SELECT * FROM mysql.db d;
add newline:
  SELECT *
  FROM mysql.db d;
undo:
  
  FROM mysql.db d;
undo multiple times more:
  SELECT * FROM mysql.db d;
  FROM mysql.db d;
[18 Dec 2006 16:01] Daniel Katz
Now with 1.2.8, using 

Yahoo's Case:
- in Query-area type: "Select * from mysql.db d;"
- add a carriage return after the * to yield
"Select * 
from mysql.db d;"
- Ctrl-Z
- (line 1 is empty.)
"
from mysql.db d;"  

Daniel's Case (me!) (somewhat fixed)
- in Query-area type: "abcdefghijklmnopqrstuvwxyz"
- highlight "fghij"
- type "12345"
- undo (Ctrl-Z)
- Notice errant text: "abcde1klmnopqrstuvwxyz" *new!*
- hitting undo (Ctrl-Z) again will return the string to it's original state however it is after two rounds which is odd.
- Back to correct text: "abcdefghijklmnopqrstuvwxyz"

Other similar "single line" cases require two undos to get to tbe original text.
[12 Jan 2007 10:23] 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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html