Bug #37840 "Discard"-Function replaces modified fields with NULL
Submitted: 3 Jul 2008 16:12 Modified: 4 Jul 2008 7:47
Reporter: Roman Held Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.12 OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: discard, query browser

[3 Jul 2008 16:12] Roman Held
Description:
In version 1.1.20, the Query  Browser replaces discarded data with "NULL"-Content, if the user insert a new row after discarding the changes.

How to repeat:
Use a small table, filled with test-data..
for example:
--------------------------
CREATE TABLE  `testdb`.`bugTest` 
(
  `ID` bigint(20) NOT NULL auto_increment,
  `Name` varchar(50) collate latin1_german1_ci NOT NULL,
   PRIMARY KEY  (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;

INSERT INTO `pstCommon`.`bugTest` (`ID`, `Name`) values (1,"test1");
INSERT INTO `pstCommon`.`bugTest` (`ID`, `Name`) values (2,"test2");
--------------------------

then:

Step 1: open mysql query browser an go to your table
Step 2: click "edit"
Step 3: change a field of your choice (doubleclick field "test1" and enter "error")
Step 4: insert a new row by clicking into the empty field at the end of the Table and enter some data (for example (3, "test3")).
The table has now the modified field (violett marked) and the new row (green marked).
Step 5: click "Discard Changed" and confirm the question with "yes"
The table has now the old values in the modified fields and a new row with "null"-content.
Step 6: click "edit" again
Step 7: Fill the new "null"-Row with some date (again (3, "test3")).
The table now has only one green colored row: the new one.
Step 8: click "Apply changes"
The Query Browser now shows a error on row one and shows in the (on step 3) modified fields two values!! There is now "null" AND the original value ("test1" in my example).
Step 9: refresh the table data... now the (in step 3) modified (and in step 5 discarded) fields have no content...
[3 Jul 2008 16:15] Roman Held
of course 
-----------
INSERT INTO `pstCommon`.`bugTest` (`ID`, `Name`) values (1,"test1");
INSERT INTO `pstCommon`.`bugTest` (`ID`, `Name`) values (2,"test2");
-----------
should be
-----------
INSERT INTO `testdb`.`bugTest` (`ID`, `Name`) values (1,"test1");
INSERT INTO `testdb`.`bugTest` (`ID`, `Name`) values (2,"test2");
-----------
in this case...
[3 Jul 2008 18:16] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 1.2.12, and inform about the results.
[4 Jul 2008 7:47] Roman Held
in 1.2.12, all is working right.. thank you and sorry for the unnessesary report.