Commit graph

19 commits

Author SHA1 Message Date
Max Semenik
eff719b75d Fixed r61214: moved MySQL munging to SearchEngine, updated calls. Can we kill $doStrip now? 2010-01-22 20:36:26 +00:00
Max Semenik
f6dee6c1e7 Factored MySQL-specific munging out of Language::stripForSearch() to DatabaseMysql. This will also allow other backends to provide seamlessly their own munging algorithms in the future. 2010-01-18 20:54:43 +00:00
Tim Starling
fd3794c5bc For r60757: implement Database::getType() explicitly in each subclass, to make Roan happy. 2010-01-08 00:31:24 +00:00
Chad Horohoe
b19e37425a Update callers from immediateCommit() to commit(). The former's been deprecated a really long time...Tim did it 45243 revisions ago. 2009-12-14 23:05:35 +00:00
Max Semenik
25009de080 Per CR for r58631, moved default duplicateTableStructure() implementation to DatabaseMysql, replacing it with 'not implemented' exception throw 2009-12-11 19:53:10 +00:00
Max Semenik
1e3b2b8d5d Abstracted some parts of database interaction for parser tests, needs verification on Postgres. SQLite still doesn't work, though fails much later 2009-11-06 10:17:44 +00:00
Max Semenik
08b430460a * Abstracted table locks in maintenance/updateSearchIndex.php
* Fixed MySQL's table locking, stabstabstab PHP
2009-10-25 09:42:00 +00:00
Max Semenik
7055d6416d (bug 20268) Fixed Database::estimateRowCount on SQLite backend. This involved moving the previous implementation to where it belongs - DatabaseMysql, and replacing it with slightly tweaked DB2 implementation. 2009-10-21 12:21:09 +00:00
Alex Z
374b9e4af1 Mostly revert r53358 and r53365 per comments on code review. Change message to just say "Database" and remove the getDBtypeForMsg function (since I can't think of any other use for it) 2009-08-22 20:17:28 +00:00
Tim Starling
84b6a177f1 * Converted BagOStuff.php from the style of memcached-client.php to the standard MediaWiki style, including camel case, using protected visibility instead of initial underscore, abstract functions instead of stubs, stylize.php.
* In SqlBagOStuff, ignore errors due to a read-only database, per my comments on CR r42796. Same for LocalisationCache. 
* Merged SqlBagOStuff and MediaWikiBagOStuff, that proved to be an awkward and unnecessary generalisation. Use the standard quoting wrapper functions instead of $db->query(). 
* Implemented atomic incr() and decr() functions for SqlBagOStuff. 
* Made incr() and decr() generally work roughly the same as it does in memcached, respecting negative steps instead of ignoring such operations. This allows decr() to be implemented in terms of incr().
* Per bug 11533, in MessageCache.php, don't retry 20 times on a cache failure, that's really memcached-specific and won't be useful for other cache types. It's not really very useful for memcached either.
* Moved MySQL-specific implementations of wasDeadlock() and wasErrorReissuable() to DatabaseMysql.
* Briefly tested page views with $wgReadOnly=read_only=1, fixed an error from Article::viewUpdates(). A CentralAuth fix will be in a subsequent commit.
2009-08-15 03:45:19 +00:00
Chad Horohoe
df296de32e * Move generic return true; various for lock functions to parent, no need to implement this everywhere
* Make LOW PRIORITY optional
* Use sourceFile instead of dbsource
2009-07-29 23:41:16 +00:00
Chad Horohoe
aa245f83d7 $this not $db 2009-07-27 23:36:30 +00:00
Greg Sabino Mullane
e8da51a574 Add standardSelectDistinct() function to help fork queries based on whether the order by items must appear in the select distinct list. See bug 18078. 2009-07-20 02:20:15 +00:00
Alex Z
bc1b8182e9 Followup to r53358 - Tweak the function name to be a little clearer as to what it does
Also make it abstract in DatabaseBase so all subclasses have to implement some human readable name 
(also make getSoftwareLink abstract for the same reason) Every current Database class already implements both.
2009-07-16 16:49:09 +00:00
Alex Z
3742d1058d (bug 19590) Database error messages are no longer hardcoded to use "MySQL".
Added a new function DatabaseBase::getDBtype() to get the DB type for messages, updated all subclasses.
Message change needs propagating.
2009-07-16 15:18:57 +00:00
Chad Horohoe
9924b70059 (bug 19591) Move setBigSelects() to DatabaseMysql 2009-07-09 00:14:43 +00:00
Chad Horohoe
f50573c33d * Move lock()/unlock() to DatabaseMysql, declare abstract
* Introduce lockTables() and unlockTables(), define in DatabaseMysql
* (bug 19372) updateSearchIndex has MySQLisms.
2009-06-25 00:40:12 +00:00
Aryeh Gregor
9244ed0c57 Abstract more methods in DatabaseBase
Notably, this will switch conditional() in MySQL from using IF() to
using CASE, like all other DBMSes.  Documentation suggests this works
back to 4.0.  If it's a problem, it's a matter of a few lines to
override it in DatabaseMysql.php.

Also, some extra explanatory comments have been added to a number of
methods in DatabaseBase.
2009-06-16 21:00:38 +00:00
Aryeh Gregor
31492fc3f1 Move some stuff from DatabaseBase to DatabaseMysql
I moved a number of methods and marked them abstract in DatabaseBase,
namely those that met the following criteria:

1) Used some mysql_* function, so would obviously fail on any other DB.
2) Were already implemented by all five non-MySQL subclasses.

It would be reasonable to revisit these and make the less essential ones
return a dummy value instead of being abstract.  And document them.  And
move more methods that are MySQL-specific.  But one thing at a time.

I also split the classes Database, DatabaseMysql, and MySQLMasterPos to
DatabaseMysql.php.

This should theoretically have no practical changes, but it's a bunch of
changed code, so it will possibly break something by accident.

Followup to r51795.
2009-06-15 18:39:41 +00:00