Commit graph

283 commits

Author SHA1 Message Date
Brion Vibber
5f0afcf1a2 Breaking the 'math' table setup out to Math extension. Should be the last main step in extension-ification of the math options!
The 'math' table will no longer be created on a default install unless you've explicitly enabled the Math plugin at install time; the usual update.php procedure will add it in.

Postgres, Oracle, MSSQL, and DB2 variants are included -- broken out from the core files -- but have not been tested.

I know there has been some code duplication in parser test infrastructure but could only find one instance of the parser test temporary table setup to remove the 'math' table from (the extension adds it back via the hook). If the phpunit-based runner breaks, please track it down and fix it there too.
2011-04-22 21:37:16 +00:00
Happy-melon
495ec45a8a Follow-up r86485: SQL error in patch, and also add the index to tables.sql. 2011-04-20 19:02:51 +00:00
Roan Kattouw
3f52bd8007 Revert r83812 (schema change for cl_type enum), no longer needed after r84392. Also reverts r83821 (followup to r83812, add /*_*/ ) 2011-03-20 16:30:59 +00:00
Sam Reed
3e725a90b8 Revert r83993 2011-03-16 00:13:10 +00:00
Marcin Cieślak
274d317a0c r83812, r83814: Don't use cl_type at all when paging categorylinks
* Remove cl_type from paging in categorylinks - it's not
  really needed there. Although cl_type is in WHERE but not
  in ORDER BY clause the worst thing that can happen
  is to have a filesort going again through <500 entries
  selected by index. Or will FORCE INDEX work anyway?

* Revert schema change, as we don't need cl_type there
  anyway (or even if we wanted to compare, it should
  work as expected by using INT values against ENUM).
2011-03-15 02:53:00 +00:00
Roan Kattouw
4bfddfe4bf Schema change: change cl_type from ENUM('page', 'subcat', 'file') to varchar(6). This is needed because MySQL sorts 'page' < 'subcat' < 'file' when using ORDER BY cl_type but uses 'file' < 'page' < 'subcat' for the purposes of WHERE clauses, making paging impossible. Changing the ENUM() order to be alphabetical would fix the order discrepancy, but leave range scans like WHERE cl_type > 'page' unindexed. Varchars do behave correctly. Changing to an int was not an option because existing data would have to be migrated.
This commit does not include a patch for SQLite, because ALTER TABLE MODIFY is apparently not supported by SQLite as far as I could tell by Googling. Leaving resolution of this issue for SQLite to the SQLite experts; maybe SQLite's enum implementation is saner than MySQL and it doesn't even need this schema change, I don't know.
2011-03-13 10:35:06 +00:00
Aaron Schulz
a9bba54649 Fixed patch from r33520 2011-03-03 06:28:43 +00:00
Roan Kattouw
051e1e7624 Self-revert r80547 per CR, breaks stuff and is undesirable 2011-01-20 23:56:47 +00:00
Roan Kattouw
8b70c17d24 War on varchar. Changed all occurrences of varchar(N) and varchar(N) binary to varbinary(N). varchars cause problems ("Invalid mix of collations" errors) on MySQL databases with certain configs, most notably the default MySQL config 2011-01-19 01:11:21 +00:00
Tim Starling
eaeea84b44 * Introduced a non-dummy collation for $wgCategoryCollation, namely UCA with default tables.
* Added a maintenance script which generates a list of first letters. Unified Han are omitted for performance, and because they shouldn't be used as headings anyway. A future collation specific to Chinese would provide the KangXi radicals as "first letters".
* Provided a precomputed list of first letters. Used Unicode 6.0.0 data and ICU 4.2. 
* Moved collation functionality from Language to a Collation class hierarchy with factory function. Removed the recently-added methods from Language and updated all callers.
* Changed Title::getCategorySortkey() to separate its parts with a line break instead of a null character. All collations supported by the intl extension ignore the null character, i.e. "ab" == "a\0b". It would have required a lot of hacking to make it work.
* Fixed the uppercase collation to handle non-ASCII characters, redundantly with r80436. I don't think it's necessary to change the collation name as was done there, so I reverted that in the course of my conflict merge. A --force option to updateCollation.php might be nice though.
2011-01-17 14:02:22 +00:00
Brian Wolff
b64d76e84a follow-up r79706 (the cl_timestamp updating on null edit bug) add comment to
sql file about the length of the cl_sortkey_prefix field, per comment on CR
by Nikerabbit.
2011-01-06 22:09:58 +00:00
Sam Reed
dcb603bc61 Followup r79702, r66793, r66822
Add patch to kill bad original ar_page_revid index (did exist as 2 definitions under the same name). Add patch to add index ar_revid per FIXME, though, hopefully only a temporary index

Updated tables.sql with new index
2011-01-06 19:27:17 +00:00
Sam Reed
2da0059cc5 Per fixme on r66822, change index to CREATE INDEX /*i*/ar_page_revid ON /*_*/archive (ar_rev_id); 2011-01-06 02:15:53 +00:00
Platonides
7846165d81 (Bug 26434) - Generated password from "Create account by email" does not work.
Another consequence of the $ts === 0 from r71751.
Fixed in a more verbose way. Behavior documented in tables.sql
2010-12-27 17:17:45 +00:00
Mark A. Hershberger
617a5b1e15 Whitespace fixup under tha maint directory. 2010-12-04 03:20:14 +00:00
Roan Kattouw
7dd7c71cb5 Per bug 25503 comment #11, use varbinary instead of varchar for ResourceLoader-related tables to avoid errors about indexes being too long. Only really needed for msg_resource_links, changed the rest for consistency. No updater needed: anyone who's already gotten this set up without these errors doesn't need this change. 2010-11-05 22:15:58 +00:00
Aryeh Gregor
d798fd5ed1 cl_sortkey should be 230 bytes long, not 255
Bug 25503, reported by Dmitriy.  When switching it to binary, I figured
that since it would always be one byte per character now, there would be
room to make it the full 255 bytes.  In fact, if cl_to is utf8, the
(cl_to, cl_type, cl_sortkey, cl_from) index will be 255*3 + 1 + 255 + 4
= 1025 bytes, longer than the max of 1000.  Shortening cl_sortkey to 230
bytes fixes this (fix tested by Dmitriy).

I didn't add an updater because if you're already running the current
schema without problems, you don't need this change.
2010-10-14 21:47:02 +00:00
Alexandre Emsenhuber
a93336d222 Fixed comment; wfEncryptPassword() is deprecated 2010-10-09 13:34:19 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Aryeh Gregor
dcd5d260d4 Further categorylinks schema changes
Per review by Tim, I made two changes:

1) Fix cl_sortkey to be varbinary(255).

2) Expand cl_collation to varbinary(32), and change $wgCollationVersion
to $wgCategoryCollation, to account for the variety of collations we
might have.  tinyint is too small.  I could have gone with int, but
that's annoyingly inscrutable in practice, as we all know from namespace
fields.

To make the upgrade easier for non-trunk users, I updated the old patch
file to incorporate the new changes, using the updatelog table so that
people upgrading from 1.16 won't have to do two alters on categorylinks.
I didn't test the upgrade-from-1.16 code path yet, so if anyone tests
that and it seems not to break, commenting to that effect would be
appreciated.

Also removed wfDeprecated() from archive().  Do *not* add this to
functions that are still actively used in core.  If you think this
function is so terrible that it really mustn't be used, remove callers
yourself, don't pester every single developer with messages in the hope
that someone else will do it for you.
2010-09-03 20:52:08 +00:00
Aryeh Gregor
9fe8bbc9d6 Update tables.sql for category sorting changes
Pointed out by X! on Code Review for r69961.  There are a couple of
FIXMEs here, I'm waiting for review to evaluate how to fix them.
2010-08-08 16:51:09 +00:00
Roan Kattouw
61de1b9006 Rename the iwl_prefix_from_title index (again) to iwl_prefix_title_from and change the field order accordingly. Fixed r66892 which inserted iwl_from into the index (which was a good thing) but put it in the wrong place. I went out of my way to make sure the index isn't dropped and recreated needlessly, but since I don't know how to do the drop-index-if-exists thing in the Postgres updater, I left that out. The Postgres updater will now create the new index without dropping any old incarnations if present. I did create the patch files with the DROP INDEX statements to make it easier to add this behavior. Also tweak ApiQueryIWBacklinks to use this index properly. 2010-07-22 08:52:58 +00:00
Roan Kattouw
b5fa13fde7 Add iw_api and iw_wikiid fields to the interwiki table, plus rudimentary support in Interwiki.php and Title.php . Code written by peter17 in the iwtransclusion branch. This revision is a partial merge of r68170, r68448, r69480, r69540 and r69541 2010-07-19 11:55:30 +00:00
Chad Horohoe
3bdfc7cba1 Add optional ul_value blob to updatelog so it can store more useful things 2010-07-08 13:58:42 +00:00
Sam Reed
9958d84dca Followup to r65105 after discussion with Roan
Make the non-unique index index all fields

Patches updated, patch created to update index. Table.sql also updated
2010-05-25 20:37:20 +00:00
Andrew Garrett
0d67db502d Fix index creation 2010-05-24 12:31:30 +00:00
Andrew Garrett
ee5afce7e7 Remove wayward comma 2010-05-24 12:30:09 +00:00
Andrew Garrett
8812fd2f9a Ugly temporary fix for bug 21279:
* When a revision cannot be found in the revision table, look for it in the archive table.
* If both deleted and undeleted revisions are covered by the same log entry, show two links (see bug 23663)
2010-05-23 14:19:20 +00:00
Brion Vibber
8eac509ab5 * (bug 14473) Add iwlinks table to track inline interwiki link usage
Like langlinks, this stores the interwiki prefix (as iwl_prefix) and full page title (as iwl_title), attached to the page doing the liking (as iwl_from -> page_id).
Unlike langlinks, there can be multiple entries stored per interwiki prefix.

Updater to add the table confirmed on MySQL, untested on SQLite but should work.
Someone may still need to add and test a PostgreSQL updater.

Refactored makeWhereFrom2d() out of LinkBatch to Database so it could be re-used for the similar mapping for the interwiki links, which need a string prefix rather than an int namespace key.
Also cleaned it up internally to reuse existing code for building where clauses from arrays. (Tim & Domas -- if the previous more verbose code was there to reduce function call and array processing overhead on very large link lists, feel free to unroll it again if the difference is measurable. Just swap the var names around from the old LinkBatch code and escape the base key value if it's not an integer, it'll be functionally equivalent.)
2010-04-16 01:40:05 +00:00
Bryan Tong Minh
143fdd07b1 Comment fix: Special:Imagelist -> Special:ListFiles
For those poor people who can't remember all special pages MediaWiki has
2010-03-19 22:12:30 +00:00
Jure Kajzer
f68c74f17b Changed all *_mime_minor field lengths to 100; current 32 does not support some OpenDocument mimes
* changed tables.sql for mysql and oracle
* added patch script for mysql and included it in updaters.inc
2010-02-23 11:24:40 +00:00
OverlordQ
ff2d149795 Followup to r59869, add to MySQL section, and copy patch to SQLite directory 2009-12-10 05:39:45 +00:00
Aryeh Gregor
b520bfb771 Rename some extauth functions and fields
Per Code Review at
<http://www.mediawiki.org/wiki/Special:Code/MediaWiki/53497#c4633>.  One
of the changes was a database field, and updaters might have to be
written for pgsql and DB2.
2009-12-08 19:32:17 +00:00
OverlordQ
bdb4f74360 Add missing columns to PG schemas
Add exceptions to schema comparison script
Alter SQL comments to appease said script
2009-10-21 02:46:39 +00:00
Domas Mituzas
40119c8e37 adding partial job_param to job_cmd index 2009-10-10 09:14:51 +00:00
Aryeh Gregor
1d1ecfa10f Add experimental new auth framework, ExternalAuth
This should not affect any existing behavior.  (Except that it reorders
some error conditions in attemptAutoCreate(), but probably no one cares
about that.)  It adds a new database table, but it will be unused unless
you enable external authentication.

An outline of the rationale for this system, and the design planning, is
at <http://www.mediawiki.org/wiki/ExternalAuth>.  Essentially,
AuthPlugin puts too much of a burden on plugin authors, requiring them
to write a lot of policy logic instead of just handling the actual
interface to the external user database.  This system uses a standard
framework to decide policy questions, and auth plugins only need to
provide some low-level, clearly-specified data.

There are lots of features still missing, marked in the code, but basic
functionality is present.  The commit includes initial support for one
type of external authentication, the forum software vBulletin (which I
happen to know well, and want to integrate with my MediaWiki).

I'm encouraging the inclusion of ExternalAuth plugins in core because in
this framework, the amount of code required to add an additional backend
is quite small -- well under 100 lines in this case.  I'd hope to see a
lot more of these, and it seems unreasonable to make an armada of tiny
extensions instead of letting them live happily in their own directory
out of everyone's way.
2009-07-19 22:02:00 +00:00
Roan Kattouw
813c474eac Followup to r53408: change lengths of log_action and log_type too. Thanks to OverlordQ for spotting this. 2009-07-17 17:50:28 +00:00
Roan Kattouw
a7b32ae5ae (bug 19570) Add log_user_text and log_page to tables.sql; fixes r51997 2009-07-17 17:45:53 +00:00
Chad Horohoe
6964e122dd (bug 19428) PG and MySQL followups to r52503. Patch by OverlordQ 2009-07-01 00:55:45 +00:00
Andrew Garrett
1011b2c410 Document tag_summary and change_tags tables 2009-06-29 19:44:52 +00:00
Tim Starling
23cfebd3d2 * Introduced a new system for localisation caching. The system is based around fast fetches of individual messages, minimising memory overhead and startup time in the typical case. It handles both core messages (formerly in Language.php) and extension messages (formerly in MessageCache.php). Profiling indicates a significant win for average throughput.
* The serialized message cache, which would have been redundant, has been removed. Similar performance characteristics can be achieved with $wgLocalisationCacheConf['manualRecache'] = true;
* Added a maintenance script rebuildLocalisationCache.php for offline rebuilding of the localisation cache.
* Extension i18n files can now contain any of the variables which can be set in Messages*.php. It is possible, and recommended, to use this feature instead of the hooks for special page aliases and magic words. 
* $wgExtensionAliasesFiles, LanguageGetMagic and LanguageGetSpecialPageAliases are retained for backwards compatibility. $wgMessageCache->addMessages() and related functions have been removed. wfLoadExtensionMessages() is a no-op and can continue to be called for b/c. 
* Introduced $wgCacheDirectory as a default location for the various local caches that have accumulated. Suggested $IP/cache as a good place for it in the default LocalSettings.php and created this directory with a deny-all .htaccess.
* Patched Exception.php to avoid using the message cache when an exception is thrown from within LocalisationCache, since this tends to fail horribly.
* Removed Language::getLocalisationArray(), Language::loadLocalisation(), Language::load()
* Fixed FileDependency::__sleep()
* In Cdb.php, fixed newlines in debug messages

In MessageCache::get(): 
* Replaced calls to $wgContLang capitalisation functions with plain PHP functions, reducing the typical case from 99us to 93us. Message cache keys are already documented as being restricted to ASCII.
* Implemented a more efficient way to filter out bogus language codes, reducing the "foo/en" case from 430us to 101us
* Optimised wfRunHooks() in the typical do-nothing case, from ~30us to ~3us. This reduced MessageCache::get() typical case time from 93us to 38us.
* Removed hook MessageNotInMwNs to save an extra 3us per cache hit. Reimplemented the only user (LocalisationUpdate) using the new hook LocalisationCacheRecache.
2009-06-28 07:11:43 +00:00
Roan Kattouw
86d3122e48 SCHEMA CHANGE: adding rd_interwiki patch from bug 14418. Actual use of this schema change will follow later 2009-06-08 07:11:30 +00:00
Aaron Schulz
7aadbb783b Tweaked r49468 - sqllite fix 2009-06-04 12:57:22 +00:00
Greg Sabino Mullane
21993cbb81 Clean up whitespace, add log_search to Postgres schema. 2009-05-19 20:55:29 +00:00
Brion Vibber
d0a3dc38a1 Cleanup for r50567:
* Include DB table options on log_search table creation
* Adjust tabs->spaces in table def... sounds silly, but the tabs sometimes confuse things when cut-and-pasting into mysql command line. :)
2009-05-14 22:43:57 +00:00
Aaron Schulz
a69fb48274 [schema change] Use new log_search table to replace ugly code from r48839. Maintenance script added to populate the table with revisiondelete log items. 2009-05-13 22:03:32 +00:00
Brion Vibber
42a073e040 * Update patch-user_properties.sql to match definition in tables.sql
* Add some doc comments on user_properties table def and move it up near the user tales
2009-04-27 17:15:01 +00:00
Andrew Garrett
e1d3ead5d8 Fix MW installation for table-prefixes 2009-04-25 11:23:23 +00:00
Andrew Garrett
155ddf6de4 Branch merge of preferences work branch. Includes fixes for several bugs. WARNING: Breaks some extensions which have not been adapted to use it properly (basically anything not used on Wikimedia). 2009-04-24 01:31:17 +00:00
Roan Kattouw
d48ee9ffda Fix typo in tables.sql, pointed out by Jidanni 2009-03-20 11:20:39 +00:00