Bug #25790 Duplicate inserted rows when executing script
Submitted: 23 Jan 2007 16:04 Modified: 29 Jan 2007 18:19
Reporter: Adam Wood Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.20 OS:Windows (WinXP Pro SP2)
Assigned to: MySQL Verification Team CPU Architecture:Any

[23 Jan 2007 16:04] Adam Wood
Description:
When pasting a script into a Query Browser script tab (eg as generated by a web page or whatever) that contains a series of INSERT statements, clicking "execute" or "continue" to run the script causes each row, except the first and the last, as long as the query is greater than three lines in length, to be INSERTed twice.

The script does not execute automatically upon being pasted in, so there is no apparent way to make it execute the script only once. Even stepping each line individually causes each line to be executed twice, although there is no way of telling this until you review the results afterwards.

Loading in a saved script (ie from a text or .sql file) does not produce the same problem.

How to repeat:
Paste any multi-line query (script) into a script tab of Query Browser that contains a series of insert statements:

INSERT INTO t1 VALUES ('a', 'b', 'c');
INSERT INTO t1 VALUES ('d', 'e', 'f');
INSERT INTO t1 VALUES ('g', 'h', 'i');
INSERT INTO t1 VALUES ('j', 'k', 'l');
INSERT INTO t1 VALUES ('m', 'n', 'o');

... etc

And choose "Execute", "Continue", or "Step" (to execute each line individually. Now look at the table (in this case `t1` and see that each row, except the first and the last, has been inserted twice). If the query is less than three lines long this effect cannot be observed.

Obviously this only works as long as duplicate keys are not violated - otherwise the query breaks when it encounters such a situation.
[23 Jan 2007 17:39] MySQL Verification Team
Thank you for the bug report. Could you please upgrade and try with the
latest version 1.2.9 and if you get the same behavior please provide the
complete script test case. Thanks in advance.
[29 Jan 2007 18:19] Adam Wood
I have installed Query Browser 1.2.9 (RC) and the problem appears to be resolved.