Commit graph

249 commits

Author SHA1 Message Date
Brion Vibber
2970a45279 * (bug 1976) fix shared user database with a table prefix set 2005-06-06 00:38:31 +00:00
Tim Starling
a12ce8f747 new load balancing algorithm 2005-06-01 06:18:49 +00:00
Brion Vibber
0207abde02 * Fix function comment in debug dump of SQL statements
I could swear I've fixed this thing several times.
2005-06-01 02:10:29 +00:00
Brion Vibber
e0ce5a322e * links and brokenlinks tables merged to pagelinks; this will reduce pain
dealing with moves and deletes of widely-linked pages.

The updaters should be fixed up to understand future versions without the
tables there without breaking upgrades.
2005-05-26 10:23:36 +00:00
Brion Vibber
aad99df7d4 * HistoryBlobStub: the last-used HistoryBlob is kept open to speed up
multiple-revision pulls
* Special:Export now includes page, revision, and user id numbers by
  default (previously this was disabled for no particular reason)
* dumpBackup.php can dump the full database to Export XML, with current
  revisions only or complete histories.
2005-05-08 08:17:12 +00:00
Ævar Arnfjörð Bjarmason
011c75c483 * Changed makeSelectOptions() so that its paramater must always be an array
* Documented makeSelectOptions()
* Changed select() to always pass makeSelectOption() an array
* Cleaned up delete(), addQuotes() and useIndexClause()
2005-05-03 07:47:08 +00:00
Brion Vibber
aed4a04076 Clean up e-mail authentication code.
* Add Special:Confirmemail unlisted page for requesting confirmation emails and as the destination
* There is now a confirmation token separate from the login password, which is cleaner and hopefully a lot less confusing.
* Confirmation token expires after 7 days
* Added support functions for nullable timestamp columns: wfTimestampOrNull and Database::timestampOrNull
* userMailer now returns WikiError objects
* Added convenience functions to User for email management, consolidated some checks

There are changes to the user table, so run update.php
2005-04-25 18:38:43 +00:00
Tim Starling
aeab2e64a8 ported live patches 2005-04-25 03:30:24 +00:00
Tim Starling
6c1ccfd02e Made updateSpecialPages.php more robust to database problems 2005-04-24 08:31:12 +00:00
Tim Starling
faabce5662 Automatic reconnect when the connection is lost. This hopefully won't happen much for HTTP queries, since it breaks the transaction model. But it might be useful for maintenance scripts which sleep for long periods. 2005-04-24 07:21:15 +00:00
Tim Starling
cdb3f96ab8 Various live patches ported from REL1_4 2005-04-12 04:03:21 +00:00
Tim Starling
abfd2e7500 ported improved table quoting from 1.4 2005-04-10 18:26:26 +00:00
Tim Starling
c02064779a Add seek method to ResultWrapper 2005-04-03 07:27:25 +00:00
Tim Starling
7597b899d6 Fixed ordering of SQL debug log 2005-03-28 07:56:17 +00:00
Tim Starling
9d4d4b7779 Bought me a horizontal scrollbar, no need for this anymore 2005-03-27 17:09:48 +00:00
Tim Starling
ba9ae79212 Fixed efficiency problem with $wgSiteNotice. Introduced wfSiteNotice(), which allows the script to load it on demand instead of on every invocation 2005-03-27 16:56:11 +00:00
Tim Starling
c5381f1f87 Fixed comment 2005-03-20 14:26:37 +00:00
Brion Vibber
7150b26584 Include function name for SQL statements dumped to debug log 2005-03-18 04:22:05 +00:00
Brion Vibber
0a5bd473fd fix deadlock loop 2005-03-13 06:43:33 +00:00
Jens Frank
9ce0e67162 Allow an array of tables for insertSelect() 2005-01-30 19:34:07 +00:00
Antoine Musso
7e901668b2 fix phpdoc comment 2005-01-27 18:28:30 +00:00
Tim Starling
59717e5161 Merging server feature from REL1_4 2005-01-14 13:03:34 +00:00
Tim Starling
2682b7db86 Fixed problem with missing query errors, noticed in installer but I seem to remember seeing it before 2005-01-14 13:00:17 +00:00
Antoine Musso
991f798587 * Remove some hardcoded 0 instead of NS_MAIN
* Note in define.php that people should NOT change the integer values for NS_* constants
2005-01-11 18:18:16 +00:00
Tim Starling
da7f1649dd Fixing synchronisation bug: can't open a transaction before calling MASTER_POS_WAIT(), because you get consistent reads. Instead, we commit any open transaction, then call doQuery() directly, thereby avoiding re-opening it. 2004-12-22 03:58:25 +00:00
Brion Vibber
64ac6b8e77 Merge SCHEMA_WORK into HEAD. Lots of changes, some things are probably broken:
* Page moves/overwrites are a little iffy
* Compression might not be working right
* Profit!
2004-12-19 08:00:50 +00:00
Brion Vibber
1fd8260c25 Allow empty array in select() for the where conditions 2004-12-13 03:54:56 +00:00
Tim Starling
6d4ce2a3bd Fixed connection errors yet again, hopefully in a more robust way this time 2004-12-12 04:44:17 +00:00
Evan Prodromou
4b42f18b66 Removed CVS keywords from files, to make merging between branches
easier. Interpolated keywords cause lots of conflicts and headaches at
merge time for older (<1.12.x) CVS versions.
2004-11-29 18:25:30 +00:00
Antoine Musso
46bd449a17 Patch by "Neil Barsema" <neil@barsema.org> :
http://bugzilla.wikipedia.org/show_bug.cgi?id=809

Attempt to load mysql php extension if it is not loaded.
2004-11-09 15:25:40 +00:00
Brion Vibber
a263b7c9f0 Let Database do the quoting of the 'group' table, so that prefixed tables will work. 2004-10-24 22:02:02 +00:00
Tim Starling
412eda0517 Correcting bugs due to double-prefixing table names. Removing obsolete Database member functions. Adding comments to Database.php 2004-10-24 07:10:33 +00:00
Brion Vibber
881b36f316 * Add support for prepared statements. This should be safer than dumping variables into raw SQL and more flexible than the array-based wrapper functions
* Add some quick PHPUnit tests for Database::fillPrepared()
2004-10-18 07:25:56 +00:00
Brion Vibber
53856406a6 Clean up a few scriptlets 2004-10-14 02:13:12 +00:00
Brion Vibber
df096a1e19 Fix brainfart that broke options on insertArray() 2004-10-10 22:40:58 +00:00
Domas Mituzas
d54c3602df Database::makeList() now checks in LIST_AND mode if supplied list item
value is an array, and uses IN (x,y,...). This extends select() syntax
as well, as arrays can be specified for conditions.
2004-10-04 19:43:49 +00:00
Brion Vibber
045e51de38 Extend select() wrapper to allow specifying multiple tables as an array 2004-10-03 05:59:45 +00:00
Zheng Zhu
ca7619c81c made some more wfMsg() to wfMsgForContent changes 2004-09-22 04:09:31 +00:00
Domas Mituzas
98ef9682ae return status of selectdb 2004-09-15 06:02:16 +00:00
Tim Starling
fa93b832d7 documentation: noting that a function is obsolete 2004-09-11 09:44:15 +00:00
Domas Mituzas
ed7dc234b2 add aggregateValue(), as some databases require different aggregated value specifications in HAVING and ORDER clauses 2004-09-09 12:04:39 +00:00
Brion Vibber
52b1b6e9c3 Add Database::conditional() function to build IF() or CASE statements
depending on the RDBMS used. Allowed NULL in some RC fields on PostgreSQL.

Fix for bug 407: rebuildrecentchanges.php fails on PostgreSQL
http://bugzilla.wikipedia.org/show_bug.cgi?id=407
2004-09-09 00:02:38 +00:00
Brion Vibber
24619e4c66 Add Database::getSoftwareLink() and Database::getServerVersion(), and use
those in Special:Version.

Fixes bug 388: Special:Version shows MySQL version when using PostgreSQL
http://bugzilla.wikipedia.org/show_bug.cgi?id=388
2004-09-08 20:36:41 +00:00
Brion Vibber
cbfdfb60dd Use array_keys() rather than array_flip(), which fails for NULL values. 2004-09-07 08:25:35 +00:00
Domas Mituzas
2d344ad9a8 extend makeList so it could include database field names 2004-09-06 08:30:05 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00
Antoine Musso
b3eb2ce4b3 Comments for phpdocumentor + comments placeholder. 2004-09-03 16:36:46 +00:00
Antoine Musso
90155b8a97 Changing comments layout preparing for generated documentation with Phpdocumentor 2004-09-02 23:28:24 +00:00
Brion Vibber
d867e6d863 ResultWrapper object, so you can pass a result back as a return value without passing along the database object you used too. 2004-09-02 02:43:13 +00:00
Brion Vibber
b8329819cf Quote seemingly numeric values in SQL, as they might
actually be strings which may not convert 1:1 if passed
to MySQL as numbers.

fix for Bug 255: Number articles on Special:Newpages
http://bugzilla.wikipedia.org/show_bug.cgi?id=255
2004-08-31 01:01:44 +00:00
Jens Frank
79303cd93a ENH#59 Provide a (diff) link in Special:Contributions
Does not look up the next old revision for every change but links to pseudo-revision 'prev'.
DifferenceEngine looks up the previous revision if user requests a specific diff.
2004-08-28 23:00:04 +00:00
Erik Moeller
76ea9e6220 rename $wgUserTablePrefix to $wgSharedDB as discussed on #mediawiki 2004-08-28 13:32:14 +00:00
Jens Frank
22525a2771 New global setting: wgUserTablePrefix
set wgUserTablePrefix to the name of the DB where your users
table is for single login. Disabled by default.
If set, the users table will be fetched from another MySQL schema (called
database by MySQL). Can not be on a different MySQL server, though.
2004-08-23 18:49:05 +00:00
Antoine Musso
3d60242fb5 massive double to single quotes conversion. I have not noticed any bug after a lot of testing 2004-08-22 17:24:50 +00:00
Domas Mituzas
95281cb81e remove bad functions:
wfLimitResult() - replaced by Database::limitResult()
QueryPage::getOrderLimit() - replaced by getOrder() + Database::limitResult()
2004-08-20 10:32:12 +00:00
Domas Mituzas
31e4c31bd4 allow getField, selectField and select to have empty conditions and table names. 2004-08-19 13:02:01 +00:00
Domas Mituzas
8aa6ebc2da Add Database*::timestamp(), using wfTimestamp() 2004-08-10 11:12:18 +00:00
Tim Starling
045d9a3b02 marking error suppression operators so that they can easily be removed with a search and replace 2004-08-07 03:41:50 +00:00
Brion Vibber
eda444e217 Wrap Database::setTimer() in a check for existence of mysql_thread_id()
function which was added in 4.3.0. If it's not available, don't set up
the thread killer.
2004-08-06 19:07:55 +00:00
Tim Starling
1773cd1e76 * Introducing bit field for database parameters
** Database constructor calling sequence, and Database::newFromParams()
** Including flags in the server initialisation structs
** Support for setting appropriate flags from legacy globals in Setup.php
** Moved some defines to Define.php so that they can be used in LocalSettings.php, most importantly the bit field constants

* Changes related to post-parse link colouring
** Turn the link cache back on when using it for updating the links table
** No longer need to call preFill() on page view

* Better synchronisation of slave servers
** Rearranged getConnection()
** System for beginning and committing transactions when multiple connections are open
** wfAbruptExit() commits transactions, wfErrorExit() does not. Various functions changed to use wfErrorAbort()

* Allowed reporting of database errors during deferred updates by moving them above output()
2004-07-24 07:24:04 +00:00
Tim Starling
8fd8374c34 fixed bug with masterPosWait() 2004-07-23 12:36:22 +00:00
Jens Frank
fe15e23107 Fix Userlogin 2004-07-19 06:35:56 +00:00
Tim Starling
ac549401d4 * Support for table name prefixes throughout the code. No support yet for converting static SQL, which also means no installation. But it has been tested by creating the tables in the ordinary way and then renaming them
* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE
* Converted to use SQL wrapper functions instead of direct SQL in various places
* Experimental method for preserving the chronological order of events when slave servers are used. Untested.
* Fixes to the new post-parse existence test feature
* Some.. other stuff
2004-07-18 08:48:43 +00:00
Domas Mituzas
a5a06ca36f add Database->limitResult($limit,$offset) instead of old wfLimitResult. Allows several DB classes to be loaded concurrently. 2004-07-15 14:50:22 +00:00
Tim Starling
b96b707efa OOP calling convention for database functions. DBMS abstraction implemented by means of functions instead of global variables, PostgreSQL object converted to a subclass instead of a drop-in replacement. Also the beginnings of a flexible table name feature. 2004-07-10 03:09:26 +00:00
Tim Starling
fbc9303fbf Log function name 2004-07-10 01:07:30 +00:00
Tim Starling
3c4d38faee Removed arbitrary change in timestamp formats between MySQL and PostgreSQL, moved global functions to GlobalFunctions 2004-06-29 12:23:59 +00:00
Tim Starling
524d56a6f1 DB error log 2004-06-29 07:09:00 +00:00
Tim Starling
05703f122b Nicer looking errors in command line mode 2004-06-26 03:28:58 +00:00
Tim Starling
0bc71915ec Check for missing mysql functions, give nice error message if they are missing rather than a blank page 2004-06-25 04:32:45 +00:00
Tim Starling
6c5254e2db allowing calls to getArray with no conditions 2004-06-21 07:31:41 +00:00
Tim Starling
b5ef8d221b Bringing the load balancer to the main branch. Still doesn't do much. I needed a DB connection cache for my Article.php alterations, which LoadBalancer provides. 2004-06-15 15:00:54 +00:00
Tim Starling
49749f3091 wfSetRef doesn't work, making isWindows() function which I was going to use somewhere else but decided against it 2004-06-12 06:05:02 +00:00
Brion Vibber
e2ee87c6e7 On emergency abort check if headers have already been sent to avoid useless warnings at that point. 2004-06-12 03:13:46 +00:00
Domas Mituzas
212c3afcb2 add wfLimitResult, for LIMIT/OFFSET compatibilities 2004-06-11 14:32:53 +00:00
Domas Mituzas
83a3aa9f8f added wfFetchRow() besides wfFetchObject. Used by objectcache code 2004-06-10 13:02:27 +00:00
Antoine Musso
52eedffd62 dont require FulltextStoplist on mysql4 databases (saves some memory) 2004-06-07 23:51:48 +00:00
Jerome Jamnicky
cf5da16687 SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not.
SHOW INDEX should work for 3.x and up:
http://dev.mysql.com/doc/mysql/en/SHOW_INDEX.html
2004-05-24 22:24:49 +00:00
Tim Starling
de13435a76 fixed database error handling 2004-05-23 05:32:20 +00:00
Tim Starling
53a43db6a8 fixed bug in tableExists() 2004-05-23 03:38:25 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Jerome Jamnicky
315be130a5 stop newFromParams() ignoring the $bufferResults param 2004-04-16 03:26:13 +00:00
Brion Vibber
f3be3bfbe6 Don't use the connection ID in error checks. If the connection itself fails, this just spits out extra error messages and is useless. 2004-04-10 09:45:00 +00:00
Brion Vibber
3d2a067e8c HTML tweaks inching towards XHTML-friendly output. To test:
$wgMimeType = "text/xml";
	$wgDocType = "-//W3C//DTD XHTML 1.0 Transitional//EN";
	$wgDTD = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";

Mozilla will spit out angry erorrs at all the well-formedness errors.
2004-04-03 10:01:08 +00:00
Brion Vibber
68b801e987 mysql_list_tables() is deprecated; switch to more elegant solution used
in REL1_2 branch.
2004-03-24 07:49:50 +00:00
Tim Starling
bdcc49b3b6 new function updateArray(), fixed bug which caused database messages to be ignored 2004-03-23 10:13:59 +00:00
Tim Starling
8eebcbc3a0 extra debugging info 2004-03-20 14:07:56 +00:00
Brion Vibber
59c6e92429 Some changes to the link tables. They now all use a key on cur_id for the *_from column instead of strings, and have a unique index to force prevent any duplicate entries. There's not yet a clean step in the update script, so just clear out your links tables (patch-linktables.sql) and rebuild them with refreshLinks.php.
This saves trouble in a number of places where we can now do joins with the link tables to get other info (such as cur_is_redirect!) as well as the name, and fewer bits need to be juggled on page renaming, as outgoing links no longer have to be changed (cur_id remains the same when a page is renamed).

rebuildLinks.inc and some of the tools in the 'maintenance page' still need to be updated to work with the new setup. (Special:Maintenance needs a *lot* of cleanup in general. It's kind of a catch-all of vaguely defined features which suck performance like a hydroelectric dam.)

Also I've slipped in some extra debug code. And, I think 'indexes.sql' is a big waste of time and should all be moved into tables.sql. Building indexes separately doesn't help on InnoDB and won't do anything on MyISAM either if you're just going to replace the table after it's built with an imported one from a dump which creates it with indexes.
2004-03-11 09:06:13 +00:00
Tim Starling
c96c50760a freeing a result object 2004-03-08 09:37:53 +00:00
Tim Starling
840dee3ad4 * Fixed magic quotes in $_REQUEST, in Setup.php
* Converted many instances of globals from the query to $_REQUEST
* Renamed near-useless Title::getURL() to Title::getPartialURL()
* Created new Title::getURL(), to replace wfLocalUrl, wfLocalUrlE, wfFullUrl and wfFullUrlE. Replaced most instances throughout the code
* In Parser.php, generalised stripping of <nowiki>, <pre> and <math> to allow more general use such as nesting
* Moved body of Article::preSaveTransform to Parser.php
* Put lots of comments in Title.php
2004-03-06 01:49:16 +00:00
Brion Vibber
24bafe9227 Add database creation to in-place installer, plus a couple fixlets.
Installer is now able to connect to the db, check its version (and
enable some MySQL 4 features if available), create the database
if need be, create the empty tables, and grant user privs if given
the root pass. This creates a usable empty wiki.

TODO:
* Populate main page and stub log pages
* Create sysop account
* Populate MediaWiki namespace for selected language
* Better error checking
* Option for InnoDB tables?
* Other useful options like uploads and TeX (shudder)
* Support scripts still need to be checked for security.

Also fixed a minor bug in Database::tableExists which ran into infinite
loops if no tables were present, and made Database::selectDB modify
the right member variable.

To get around some problems induced by the new parser stuff, User
won't loadFromDatabase() if we're in CommandLineMode, since it ends
up trying to do so before we've set up the database and fails.
2004-03-02 09:26:57 +00:00
Brion Vibber
0332f4c598 Fix for compatibility with short_open_tag = Off 2004-02-18 02:15:00 +00:00
Mr. E23
bcab02d087 Moved google box out from 'searchdisabled' message. Appended google box to title search result page. 2004-02-15 15:59:45 +00:00
Tim Starling
ca6782aefa More realistic kill procedure 2004-02-12 13:00:43 +00:00
Tim Starling
158e5ca759 Specia:Asksql security fix, Special:Asksql query timeout feature 2004-02-11 13:03:58 +00:00
Brion Vibber
4c7ff09b28 Use wgSiteMessage in no-database abort if it's set 2004-02-08 07:59:57 +00:00
Tim Starling
114ca8a146 Fixed recent bugs 2004-01-18 10:39:36 +00:00
Tim Starling
3c96949682 * Recent Changes improvements: object oriented back end, move page annotation and (untested) message queue feed.
* Misc. bugs fixed in DatabaseFunctions.php and Skin.php.
* install-utils, install and update utilise Database objects instead of handling their own connections
* schema change for RC improvement -- added rc_type, rc_moved_to_title and rc_moved_to_ns
2004-01-17 05:49:39 +00:00
Tim Starling
a4c652b0ff object-oriented database connections 2004-01-10 16:44:31 +00:00