Commit graph

259 commits

Author SHA1 Message Date
Aryeh Gregor
b3230dfe27 It would have been fun if this went live. :D 2008-04-15 14:17:10 +00:00
Aryeh Gregor
fd0cb785a8 Add RELEASE-NOTES for 33269, fix another one. 2008-04-15 13:14:44 +00:00
Alexandre Emsenhuber
2f41e3c98b Removed usage of deprecated settings 2008-04-06 16:14:04 +00:00
Tim Starling
54e2b71bd1 * Generalised FileRepoStatus, providing a very similar general Status object.
* Fixed external storage in LBFactory_Multi, was broken
* Useful debugging hack $wgAllDBsAreLocalhost
2008-04-05 18:11:23 +00:00
Tim Starling
4d7cb64dd6 mmm... 2008-03-30 09:51:15 +00:00
Tim Starling
fbfb509df5 * Introduced LBFactory -- an abstract class for configuring database load balancers and connecting to foreign DBs.
* Wrote two concrete implementations. LBFactory_Simple is for general installations. LBFactory_Multi will replace the runtime configuration used on Wikimedia and allow load-balanced connections to any DB. 
* Ported Special:Userrights, CentralAuth and OAI audit to the LBFactory system. 
* Added ForeignDBViaLBRepo, a file repository which uses LBFactory.
* Removed $wgLoadBalancer and $wgAlternateMaster
* Improved the query group concept to allow failover and lag control
* Improved getReaderIndex(), it will now try all servers before waiting, instead of waiting after each.
* Removed the $fail parameter to getConnection(), obsolete. 
* Removed the useless force() function. 
* Abstracted the replication position interface to allow for future non-MySQL support.
* Rearranged Database.php. Added a few debugging features. 
* Removed ancient benet-specific hack from waitForSlave.php
2008-03-30 09:48:15 +00:00
Brion Vibber
899f644016 * Don't die when single-element arrays are passed to SQL query constructors
that have an array index other than 0

Since we don't enforce linear ordering of array keys on longer arrays, we
may as well not enforce it on single-element arrays either.
The freaky little Categoryfinder class was using different keys for its
arrays, which could cause a PHP notice and silent lookup failure when
only one ID was looked up.
2008-03-25 23:08:19 +00:00
Tim Starling
9e82828825 Fixed no-op update query in common code path 2008-03-19 11:19:00 +00:00
Tim Starling
45a998174a Fixed Database::ping() for MySQL client 5.0.13+. 2008-03-10 04:08:44 +00:00
Tim Starling
3d17f9896a Bug 11980: don't complain on rollback of non-transactional tables. Not sure how to reproduce it, but this should fix it in any case. 2008-02-27 06:09:51 +00:00
Greg Sabino Mullane
157fd5bd94 When putting usernames in SQL comments, truncate using mb_ functions for utf usernames. Bug 12735. 2008-02-04 17:33:49 +00:00
Domas Mituzas
d7f225d419 don't open transactions for SHOW and SET statements - reduces some redundancy of transaction startup 2008-01-13 13:34:45 +00:00
Brion Vibber
7700199c34 Special-case empty arrays and single-element arrays in database wrappers.
* single-element arrays were inefficient ("field IN (42)"), now using straight matches ("field=42")
* empty arrays caused an error ("IN ()" is invalid syntax), now will evaluate to 0 (false)
2007-11-15 18:35:58 +00:00
Nick Jenkins
a46194b809 Tweak variable name 2007-09-28 00:42:22 +00:00
Greg Sabino Mullane
546dc86714 Use "private", thanks Nick. 2007-09-27 13:23:10 +00:00
Greg Sabino Mullane
0ab8c7e910 Make CONCAT calls database portable, change IF() to standard CASE-WHEN calls.
Postgres: replace CHAR(64) with TEXT for fa_storage_key of filearchive
Postgres: Add hasConstraint to allow replacing of oldimage fk constraint
Postgres: make oldimage cascade delete on image deletion
2007-09-23 22:23:01 +00:00
Greg Sabino Mullane
7b9616a21c Fix bug 11292, unserialize errors with Postgres, by changing from array to object when slinging around blobs. 2007-09-23 19:54:56 +00:00
Greg Sabino Mullane
8eb82ee407 Add implicitOrderby() to make sure that SpecialAllpages uses an ORDER BY when needed.
Made this an option rather than forcing the ORDER BY as testing show MySQL is 
faster without it for large tables.
2007-09-02 18:03:10 +00:00
Brion Vibber
e2a069fd89 * (bug 11082) Fix check for fully-specced table names in Database::tableName
strpos() was in wrong order since added in 2004 :D
2007-08-27 18:56:31 +00:00
Nick Jenkins
786e93fb37 Static code analysis housekeeping time... things that could be double-checked are marked with "[Note: some-comment]" :
if-if-else without curly braces [api/ApiQuerySiteinfo.php] --> adding
Unused global declaration:  $wgGroupPermissions --> removing 
Unused global declaration:  $wgEmailConfirmToEdit (line 301) --> removing 
Variable $id appears only once (line 1021)  --> removing 
Variable $m was used before it was defined (line 805) --> defining.
Variable $retval was used before it was defined (line 2346) --> renaming to $result
Variable $rcid appears only once (line 244 of RecentChange.php)  --> using this instead of $change [Note: was left over from r24607 refactoring, revert if wrong please]
Unused global declaration:  $wgCommandLineMode (line 11) --> removing
Variable $k appears only once (line 132 of ImagePage.php) --> removing.
Variable $info appears only once (line 311 of ImagePage.php)  --> removing.
Unused global declaration:  $wgTitle (line 569 of ImagePage.php) -> removing.
Variable $handlerParams was used before it was defined (line 616 of Linker.php) --> resolved by Raymond in r24966
Variable $match was used before it was defined (line 1031 of Linker.php) --> defining.
Unused global declaration:  $wgEnotifWatchlist (line 253 of UserMailer.php) --> removing 
Unused global declaration:  $wgShowUpdatedMarker (line 253 of UserMailer.php) --> removing 
Variable $img appears only once (line 446 of SpecialUpload.php) --> added definition, defined as null, flagged with @todo  [Note: should $img be defined in this context, or is it intended to be null? And should the return value after the hook be checked in some way?]
Unused global declaration:  $wgEnableAPI (line 739 of SpecialUpload.php) --> removing.
Unused global declaration:  $wgNamespaceProtection (line 1030 of OutputPage.php) --> removing.
Unused global declaration:  $wgContLang (line 18 of SpecialWatchlist.php) --> removing.
Unused global declaration:  $wgRawHtml (line 269 of SpecialMovepage.php) --> removing.
The value of variable $page was never used (line 331 of SpecialUndelete.php) --> removing line, as $page gets redefined a few lines down.
Variable $synIndex appears only once (line 521 of MagicWord.php) --> commenting out.
Variable $case appears only once (line 539 of MagicWord.php) --> removing from foreach index key usage.
Variable $wgUser appears only once (line 1039 of Title.php) --> adding line to declare as a global, would be null otherwise.
Variable $m was used before it was defined (line 285 of Title.php) --> defining.
Variable $id appears only once (line 1150 of Title.php) --> removing from foreach index key usage.
Variable $subpage appears only once (line 1297 of Title.php) --> commenting out.
Variable $restrictions appears only once (line 1399 of Title.php) --> commenting out.
Variable $mime appears only once (line 210 of filerepo/OldLocalFile.php) --> removing.
Variable $deprefixedName appears only once (line 213 of filerepo/LocalFile.php) --> removing.
Variable $m appears only once (line 541 of filerepo/LocalFile.php) --> removing.
Variable $where appears only once (line 1245 of filerepo/LocalFile.php) --> removing.
Variable $info appears only once (line 1427 of filerepo/LocalFile.php) --> removing.
Variable $rel appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $zone appears only once (line 138 of filerepo/RepoGroup.php) --> commenting out.
Variable $nbytes appears only once (line 208 of media/Generic.php) --> added a return line that uses $nbytes. [Note: I'm assuming that this was the intent]
Variable $offset appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $limit appears only once (line 201 of SpecialListusers.php) --> removing.
Variable $groupTarget appears only once (line 203 of SpecialListusers.php) --> removing.
Unused global declaration:  $wgLang (line 74 of SpecialWantedpages.php) --> removing.
Variable $block appears only once (line 244 of SpecialProtectedpages.php) --> removing.
Variable $offset appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Variable $limit appears only once (line 281 of SpecialProtectedpages.php) --> removing.
Unused global declaration:  $wgLang (line 30 of FileDeleteForm.php) --> removing.
Unused global declaration:  $wgServer (line 30 of FileDeleteForm.php) --> removing.
2007-08-21 03:57:54 +00:00
Rob Church
12f3e5d28a (bug 10769) Database::update() should return boolean result 2007-08-01 21:42:59 +00:00
Greg Sabino Mullane
4fffb261dd Add function to check if function-based indexes are supported by the backend DB. 2007-07-30 14:10:42 +00:00
Aaron Schulz
358b187c5c *Still use = for LIST_SET so as not no kill non-where queries 2007-07-11 20:26:33 +00:00
Aaron Schulz
d20bf39150 *Make null values of arrays use NULL(for lists) or IS NULL, rather than x = NULL, which doesn't work 2007-07-11 20:07:25 +00:00
Nick Jenkins
d466cf6e86 A few comment tag tweaks. 2007-07-11 08:09:21 +00:00
Tim Starling
8c3b4616cd Added iterator interface to ResultWrapper. No support in Oracle yet. Updated documentation for Database::getLag(). 2007-07-09 00:48:40 +00:00
Yuri Astrakhan
5a0bbe0a1a bug 10496 DISTINCT option logic incorrect in Database::makeSelectOptions 2007-07-07 21:51:06 +00:00
Tim Starling
9382bc7a85 Return a ResultWrapper from Database::query() and query builder functions, instead of a raw DB result resource. Backwards compatibility is maintained, except with naughty code that was calling database driver functions directly on result objects. 2007-07-05 19:42:18 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Nick Jenkins
b4d37577b9 Removing or commenting out unused variables or globals, and adding declarations for two arrays. 2007-05-08 09:09:46 +00:00
Aaron Schulz
ccb7b43392 *Support for HAVING clause 2007-05-04 22:54:13 +00:00
Brion Vibber
08fbff373b Avoid cyclic stub problems when authorization hooks do funny things with the user and the database at load time 2007-05-04 21:04:50 +00:00
Tim Starling
0dd9f81078 username in SQL comments 2007-04-25 07:41:00 +00:00
Tim Starling
0a93752af6 * Removed mysql5 SQL files, obviously we're collectively incapable of keeping them up to date. They were littered with errors. The only deliberate difference appears to be the table character set, which can be adjusted programatically using a variable.
* Added table option variable to the SQL patch files, so now upgrading a non-standard schema won't leave your database horribly corrupted.
* Added sql.php, for sourcing SQL files with MediaWiki variable substitution.
* Disable MySQL's strict mode at session start for MySQL 4.1+, to avoid the various problems that occur when it is on.
2007-04-22 14:04:06 +00:00
Nick Jenkins
f9619da3f0 Yet more doc tweaks:
* Add @addtogroup tags to various classes, to try and group conceptually-related classes together.
* Add brief descriptions to various Special pages, thanks to Phil Boswell.
* Moving some docs to be right above the classes they represent, so that they are picked up.
2007-04-20 08:55:14 +00:00
Aryeh Gregor
32c6eb1786 Documentation, mark public functions public, comment a presumably private function as private 2007-04-19 02:01:19 +00:00
Domas Mituzas
fdf9d73bb1 - add simple row estimation mechanism, allows preparing heavy queries better :)
- use estimates instead of select count(*) for jobs in Special:Statistics, won't scan million-row-tables too often
2007-04-07 07:35:54 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Greg Sabino Mullane
d6456e1e41 Remove variables when we can simply override accessors instead. 2007-03-21 18:19:35 +00:00
River Tarnell
89b14494bb - strict warning fixes in databasepostgres
- PG updaters should use general Database methods instead of reimplementing in updaters.inc
- fieldInfo should work for postgres; generalise result to an object type
- add missing *Exists() functions (rules, triggers, sequences)
2007-03-19 02:40:32 +00:00
River Tarnell
67cc9eaef3 limitResult() changes need fiddling to put options in right order 2007-03-11 15:49:27 +00:00
River Tarnell
033b6b9646 revive experimental Oracle support
fix use of limitResult(); must pass actual SQL, not empty string
2007-03-11 03:59:37 +00:00
Brion Vibber
3caa998c8c prettify:
* set_timeout() -> setTimeout()
* remove a couple obsolete references from dump code
2007-03-09 15:26:41 +00:00
River Tarnell
e8306706e8 dumpBackup should instantiate correct database class for db type
add set_timeout() method to Database
2007-03-09 02:04:36 +00:00
Tim Starling
994743b79e debugging lost connections 2007-02-22 02:12:46 +00:00
Domas Mituzas
6bd82dc0db Add ResultSet::rewind() 2007-02-15 15:38:28 +00:00
Domas Mituzas
3de6fd8c81 If 'tables' is a string that starts with a space, treat it as user-enforced FROM definition.
Development sponsored by: Dirty Hacks Inc.
2007-02-11 11:29:33 +00:00
Greg Sabino Mullane
934d8c41e4 Add searchableIPs differentiator 2007-01-23 14:47:12 +00:00