(bug 16020) Fix race condition in User::addToDatabase()
authorTim Starling <tstarling@wikimedia.org>
Mon, 8 Oct 2012 22:45:03 +0000 (09:45 +1100)
committerTim Starling <tstarling@wikimedia.org>
Mon, 8 Oct 2012 23:20:45 +0000 (10:20 +1100)
commita9f02d402240c6236b94c5711080aa5d7365c8c6
tree2b6d86b9132aace983df2e8c47a8b78b6c01bcd0
parenta719f7ef1282eb416a2ea7bea9de8a0325da081f
(bug 16020) Fix race condition in User::addToDatabase()

Fix the DB error which comes from User::addToDatabase() if it is called
when the user already exists. This is the most common DB error we log at
WMF in normal operation, perhaps because of double clicks on the "create
account" button, or perhaps due to CentralAuth autocreation when
multiple pages on another wiki are opened in the browser simultaneously,
as the bug reporter suggests.

See the doc comment for the interface rationale. Patched
Special:Userlogin to be aware of the new return value. Most extension
callers will continue to work, I will patch a couple that need it in
subsequent commits.

Change-Id: I1f6ef5e6319bfe692fb82a3fa50dc66c9fde8f15
includes/Status.php
includes/User.php
includes/specials/SpecialUserlogin.php