Bug #23170 | if Insert ignore ...select fails on violation unique key, @@identity is <> 0 | ||
---|---|---|---|
Submitted: | 11 Oct 2006 10:03 | Modified: | 26 Feb 2007 20:49 |
Reporter: | Aurel Pekarcik | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.26, 5.0.36-BK | OS: | Linux (Linux, windows XP) |
Assigned to: | Evgeny Potemkin | CPU Architecture: | Any |
[11 Oct 2006 10:03]
Aurel Pekarcik
[11 Oct 2006 10:53]
Sveta Smirnova
Thank you for the report. Verified as described on Linux using last BK sources
[3 Feb 2007 8:46]
Valeriy Kravchuk
On 5.1.15-BK I've got: mysql> select * from T2; +----------+ | Identity | +----------+ | 1 | | 2 | | 2 | | 2 | +----------+ 4 rows in set (0.00 sec) after running this test case. Not sure it is OK (and it differs from 5.0.26).
[3 Feb 2007 8:51]
Valeriy Kravchuk
Looks like on 5.1-BK it works as expected by the bug reporter. While on 5.0.36-BK we still have a bug: mysql> select * from T2; +----------+ | Identity | +----------+ | 1 | | 2 | | 0 | | 3 | +----------+ 4 rows in set (0.00 sec)
[9 Feb 2007 19:26]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/19638 ChangeSet@1.2408, 2007-02-09 22:25:09+03:00, evgen@moonbone.local +3 -0 Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted. The select_insert::send_eof() function now resets LAST_INSERT_ID variable if no rows were inserted.
[14 Feb 2007 10:30]
Igor Babaev
The fix has been pushed to 5.0.36 ONLY. 5.1 follows a different semantics (see the manual)
[26 Feb 2007 20:49]
Paul DuBois
Noted in 5.0.36 changelog.