* Replaced use of spl hash with random transaction IDs.
These can be correlated better and make the DBPerformance
log easier to make sense of. They are also shorter.
Change-Id: I5f49c0d0c26e37807341bbc83b1b41b124164419
This may cause unnecessary backslashes (in the case of a literal
% or _) to end up in the query when the DBMS uses C-style string
escaping; however, the query should still work.
Change-Id: I82681f83dd45fcbecf4bfd672f550cd4dba30949
* If callbacks are pending, just throw the normal query error
exception for the failed query and clear the callbacks. This
way an error is still reported, but the handle can be reused
if desired, instead of being left broken. Also the reported
error makes more sense.
bug: 65263
Change-Id: Icb2d372e65e6c62b5d5b90a442ea7b7a7f853adc
Part of program to remove underscores from class names. Checked core and
675 extensions for occurrences. All uses are in core in core are updated
in this patch. There are no uses in Gerrit extensions.
Change-Id: I6150c2d3f5a18496da5bcdcadc5d8982b70bec7a
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
One of the causes (if not the cause) of bug 56269 is if something
manages to throw an exception that makes it to MediaWiki::run's
last-resort exception catcher while having an open database transaction:
the transaction never gets committed or rolled back, so it gets
implicitly rolled back and a warning is raised.
The API has the opposite problem in bug 63145: it catches the exception
but then does the normal DB shutdown which *commits* the transaction.
This is certainly the Wrong Thing to do.
Ideally, neither of these would ever happen because any code using
transactions would have its own try-catch that would catch any
exception, rollback the transaction, and then rethrow the exception. But
it happens anyway, so let's have both of these last-resort exception
handlers do the rollback, and also log the exception so the throwing
code has a better chance of being properly fixed.
Bug: 56269
Bug: 63145
Change-Id: I8f1da51187b281fe4afc0d5a0c49f5caf3612e92
I found two calls to wfLogDBError() that do not add a new line
at the end of the message. So instead of adding them to that
entries, I changed wfLogDBError() to automatically put it on
icoming messages; as for wfDebugLog().
Change-Id: Id014b5827a0aeef6873ebf08d78f0a3d7581d63b
this fixes the issue of the normalized sqlite
IGNORE option being discarded and ignored in
DatabaseBase::makeUpdateOptions.
Change-Id: I01579dee0f939a56c086d13683a60f4400014f62
Probably the fakeMaster/fakeSlave stuff was originally intended to be
generic, but the existing code in Database.php is making some very
MySQL-specific assumptions. So let's evict it from Database.php (except
for the minimal support functions) and put it in DatabaseMysqlBase where
it makes more sense.
This also takes care of fixing the breakage described in I5d2a1696 by
reverting Id6268193 and the problematic bit of I364e192e (again).
Change-Id: I3dc6ca216bf2c2f07d3090e86f2539292e1fa86b
DatabaseMysqlBase::fieldType() is used in the maintenance script
convertLinks.php for upgrading from MediaWiki 1.2 or earlier. This
script was failing when the mysqli extension was enabled.
Follows-up b1cc3511fd, b2d64432ee, and 00299ecb95.
Change-Id: I5d888f4dd344ecba15506023d35f6d2d6e24cfd8
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs
Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
This reverts commit 5e1efc3144.
This sort of thing needs to be discussed. Please do not self-approve changes like this.
Change-Id: I9eb9ea315d90584b7fe95db43a6759884f9506b5
We were missing a method to list out views defined in a database. This
patch adds in MysqlBase::isView() and MysqlBse::listViews().
Since listViews() cache its result in DatabaseBase::$allViews, we also
introduce a final DatabaseBase::clearViewsCache() to let us clear the
per process cache.
Finally, fixed fatal error when duplicating VIEWs in MySQL.
bug: 43571
Change-Id: I8650baa4b721fe69ea3e1d557dd76745c0c7754e
* Only do requeries after automatic reconnection if there is no trx open instead.
of doing possible half-broken changes and not fully updating trx state variables
* Also made trxLevel() no longer take an argument.
* Avoid clearing trx fields in some redundant places to make the code simpler
Only mTrxLevel needs to be well tracked in various places. For the other fields,
code just checks mTrxLevel before using those fields.
They do need to be cleared in begin() though.
* Moved endAtomic() up next to startAtomic().
* Improved mTrxLevel docs
Change-Id: I12adfb4fcb28a4832facd63baee2283ead500bd2