Title | MySQL integrity error when you create a new bug in Bugzilla and update it quickly |
Status | closed |
Priority | critical |
Assigned user | Nick Barnes |
Organization | Ravenbrook |
Description | If you create a new bug in Bugzilla and update it quickly, then sometimes you get an integrity error from MySQL. The error message is: Traceback (innermost last): ... File "/usr/lib/python1.5/site-packages/MySQLdb.py", line 238, in __do_query db.query(q) IntegrityError: (1062, "Duplicate entry '2' for key 1") |
Analysis | This is because changed_bugs_since is returning a list of bugs including the same bug twice. Because the bug is new, it will try to setup for replication twice, causing the above integrity error in MySQL. It's in the list twice because it matches two of the selects; this is because the delta_ts in the bugs table is later than the last bug_when in the bugs_activity table, so it matches both "new and touched" and "changed". We could work around this by excluding from the "new and touched" bugs, all bugs which have a bugs_activity row whose bug_when is more recent than the since argument to changed_bugs_since. Alternatively, we could filter the results for duplicates. This might make the selects easier to write and possibly make the function a bit more robust. |
How found | manual_test |
Evidence | Found during testing of version 1.2 against Bugzilla 2.14. |
Observed in | 1.1.6 |
Introduced in | 0.5.0 |
Created by | Nick Barnes |
Created on | 2001-10-18 15:46:11 |
Last modified by | Gareth Rees |
Last modified on | 2001-12-10 19:58:18 |
History | 2001-10-18 GDR Created. |
Change | Effect | Date | User | Description |
---|---|---|---|---|
23333 | closed | 2001-10-18 15:56:04 | Nick Barnes | Stop bugs appearing twice in the result of changed_entities in the Bugzilla integration. |