Bug #22505 INSERT command malfunction
Submitted: 20 Sep 2006 6:22 Modified: 21 Sep 2006 2:53
Reporter: Peter Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Query Browser Severity:S1 (Critical)
Version:1.2.3 beta OS:
Assigned to: CPU Architecture:Any
Tags: insert

[20 Sep 2006 6:22] Peter
Description:
When I run the following code:

-------------------------------
DROP TABLE IF EXISTS config;
CREATE TABLE IF NOT EXISTS config (
  ID int UNSIGNED NOT NULL auto_increment,
  last_done_rawlogID int UNSIGNED NOT NULL default 1,
  last_done_rawlogDT datetime NOT NULL,
  PRIMARY KEY (ID)
) ENGINE=MYISAM DEFAULT CHARACTER SET utf8;

INSERT INTO config (last_done_rawlogID,last_done_rawlogDT) VALUES (1,NOW());
--------------------------------

in MySQL Browser I receive 'config' table that has the
following 2 rows (instead of just a single one):

1, 1, '2006-09-20 14:55:39'
2, 1, '2006-09-20 14:55:39'

How to repeat:
Try to run the following code:

-------------------------------
DROP TABLE IF EXISTS config;
CREATE TABLE IF NOT EXISTS config (
  ID int UNSIGNED NOT NULL auto_increment,
  last_done_rawlogID int UNSIGNED NOT NULL default 1,
  last_done_rawlogDT datetime NOT NULL,
  PRIMARY KEY (ID)
) ENGINE=MYISAM DEFAULT CHARACTER SET utf8;

INSERT INTO config (last_done_rawlogID,last_done_rawlogDT) VALUES (1,NOW());
--------------------------------

in MySQL Browser and then check the 'config' table:

SELECT * FROM config;
[20 Sep 2006 6:34] Peter
Additional info:

MySQL Server: 5.0.24a-community via TCP/IP
Network Name: localhost
IP: 127.0.0.1
Port: 3306

MySQL Client: 5.0.11

MySQL GUI Tools for 5.0r3 bundle
[20 Sep 2006 12:00] Valeriy Kravchuk
Thank you for a problem report. I had run the same statements, one by one, in Query Browser 1.2.3 beta, and got 1 row as a result, as expected. I had tested it on XP Home Edition.
[21 Sep 2006 2:53] Peter
Right! If I run it one-by-one in a query tab, I get one row.
I think this has something to do with the older version of
query browser. The file was created in older version of browser
and just opened in 1.2.3. However, if I type it in 1.2.3, 
save it, open it in script tab again, and run it, I get one
row. However, if just copy-paste it from old file into new 
script tab and run it, I still get two rows. But! If I save 
the copy-pasted tab into new file, re-open it in new script 
tab, and run it again, I get one row. If you want, I can send 
you the original file via e-mail.