Bug #16369 MQB executes some (all?) of the lines of a script TWICE
Submitted: 11 Jan 2006 11:43 Modified: 27 Dec 2006 15:17
Reporter: Alexandru Cristescu Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.1.18 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: Source Editors

[11 Jan 2006 11:43] Alexandru Cristescu
Description:
When I try to run a script in a "script tab", some lines get executed twice

How to repeat:
Open a new script tab and write the following:

CREATE DATABASE test_new;
USE test_new;

CREATE TABLE timer (tstamp TIMESTAMP);
INSERT INTO timer VALUES ( NOW());

I get an error stating that table timer allready exists. If I check the timer table I see 2 rows (not just one) with the same timestamp.

Suggested fix:
Revert to a version of MQB that works for you. 1.1.13 works OK for me...
[11 Jan 2006 12:06] Valeriy Kravchuk
Thank you for a bug report. Verified just as described on plain XP. I've got error message 1050, Table 'timer' already exists. But I've got only one row in timer table. So, it may really happen that only some lines are executed twice.
[23 Jan 2006 15:01] Shawn Ting
i'm experiencing the same problem too with v1.1.18 and v1.1.19.

v1.1.18: creating tables are ok, but inserting into tables are ALL implemented twice
v1.1.19: both creating and inserting are implemented twice
reverted to v1.1.17, and so far, no prob
[6 Mar 2006 11:31] Lizanne Ford
I'm just upgraded to v.20 having had this same problem on v.19 and I get the full script running twice - spotted as a primary key issue was found on a load data infile line, plus all my create table statements come up with error 1050 - table already exists.

If there a solution to this yet ?

Cheers ..
[25 May 2006 23:52] [ name withheld ]
Still present in 1.1.20, very annoying.  Seems to duplicate only the last line of a script.

My example:

DROP TABLE IF EXISTS gw_grp;

CREATE TABLE gw_grp (
grp_id int not null,
grp_name varchar(20) not null
);

INSERT INTO gw_grp VALUES (1, 'group1');
INSERT INTO gw_grp VALUES (2, 'group2');
INSERT INTO gw_grp VALUES (3, 'group3');
INSERT INTO gw_grp VALUES (4, 'group4');

then in a separate query window:

SELECT * FROM gw_grp;

shows 5 rows (last row is in there twice).

I found that adding "SELECT 1;" to the end of the script works in some cases but not others.  It did not work in this example but it did work for another table create script I have.
[6 Jun 2006 12:54] [ name withheld ]
I have had apparently random duplication of insert statements also in the scripts window also. 

This may include insert statements in the middle or end or of the script window.

It appears to happen randomly..??

Version 1.1.20 on Windows XP
[20 Oct 2006 8:34] Stuart Ferguson
running a long list of inserts as a script all of which get duplicated except the first and last queries.

version 1.1.20
[27 Oct 2006 15:08] Hartmut Grosser
I have randomly the problem in scripts, that indexes are created twice.
Query Browser 1.1.20 and 1.2.2 beta
Windows XP SP2
MySQL Server: different versions
[14 Nov 2006 13:56] Mike Lischke
I cannot reproduce the problem here. It might already be fixed. Please verify again if you still see this problem with that latest version (1.2.5 beta).
[27 Nov 2006 15:17] Valeriy Kravchuk
Please, try to repeat with a newer version, 1.2.6, and inform about the results.
[28 Dec 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[4 Jan 2007 13:36] Hartmut Grosser
This problem seems to be solved in ver 1.2.8 beta
Thanks a lot!
[26 Aug 2008 20:54] Dharmesh Sheth
I am currently using v1.2.12 of QB, and some of my scripts are being executed twice only in the "Script" section. When the same query is ran in "Resultset" section it runs only once.
[28 Aug 2008 12:27] Dharmesh Sheth
FYI. The duplication (while inserting) that I was experiencing was due to a trigger that I overlooked, so the version 1.2.12 is not producing duplicates as discussed in this page.