This adds the rev_id column to the end of the rev_actor_timestamp index
to make it unambiguous. With the id field added, the index matches the
pagination criterion for user contributions (filter by actor, sort by
timestamp, then disambiguate based on revision id). The index is not
marked UNIQUE since this would potentially degrade write performance.
Uniqueness is already guaranteed by the rev_id field being the primary
key.
Note that no provisions are made to change the definition of the
rev_actor_timestamp index for existing instances. This index was only
recently added in I18071a2fe45907a0cf1b0fefebd96a97a2dacb7b and has not
been part of any release. It has also not yet been created on the wikimedia
servers. For this reason, any existing instances are assumed to be for
testing only. Instances would also continue to function normally with
the previous index definition.
With this patch, the new index will be created correctly when updating
from 1.34 or earlier. It will however not be modified for installations
of some development version of 1.35.
Bug: T200259
Bug: T238966
Change-Id: I511bb21b1ca820d950818cc831f8e3fef43a1559
Update length in patch-langlinks.sql and fix PK too
Update length in patch-sites.sql and fix PK too
Update length in patch-l10n_cache.sql and fix PK too
Re-use patch-langlinks-ll_lang-20.sql and update
Bug: T253276
Change-Id: I95bef3ef279cb59d54a3127c646a03826fa0da6b
We're finally to the point of making the massive alter to the `revision`
table that we've been building up to for 2.5 years now.
Changes here are:
* Drop `rev_text_id`, `rev_content_model`, and `rev_content_format` that
MCR obsoleted.
* Drop `ar_text_id`, `ar_content_model`, and `ar_content_format` that
MCR obsoleted.
* Replace `rev_comment` with `rev_comment_id`.
* Replace `rev_user` and `rev_user_text` with `rev_actor`, plus
associated index changes.
Future patches will make the code changes to migrate data from
`revision_actor_temp` and `revision_comment_temp` into the new
`revision` columns.
Bug: T251343
Bug: T184615
Bug: T215466
Change-Id: I18071a2fe45907a0cf1b0fefebd96a97a2dacb7b
This is how it's named in WMF production and the Postgres. Converging
names would help us to keep everything consistent, for example if we
need to force this index in the code.
For changing this index in Sqlite, we don't need to make a temp table as
this only touches the index and not the table structure.
Bug: T250071
Change-Id: I0838753b809680af3ee06d9c4f6d21d95b8982cc
The page.page_restrictions field was used to store protection settings
for pages before MediaWiki 1.10 introduced the page_restrictions table.
update.php has since been running the updateRestrictions.php maintenance
script to migrate data from the legacy field to the new table.
In preparation for dropping this field, it is necessary to first make this
column nullable, so that we can remove code that references it during write
operations. This patch adds migrations for MySQL and SQLite to make the column
type 'tinyblob NULL'. Postgres does not seem to require a schema change, as the
field definition there is 'TEXT' rather than 'TEXT NOT NULL'.
Bug: T218446
Change-Id: I626859cdb5ab81c504a986129d21059ab088b8bd
This table will store expiries for watchlist items, so that pages can be
automatically unwatched at a specific time.
Bug: T240094
Change-Id: I014ffccb91969e7a222a83858c55e71067b0f2af
The following function are set to public in the parent class and cannot
have another visibility in subclasses
Maintenance::__construct
Maintenance::execute
Maintenance::getDbType
Maintenance::validateParamsAndArgs
Maintenance::setDB
Change-Id: I0cd6514642d479aca20f1221bf673b0713c21631
While these have not yet caused problems, we should probably deprecate
the whole confusing "index aliasing" feature. Cleaning this up needs to
be done first.
Method MWLBFactory::setSchemaAliases() is being considered private due
to the @internal notation, and so is being removed without deprecation.
Bug: T233240
Change-Id: Ib04b7bc4af53382fde01bd8550cc7e361124255f
See T233221 for the sordid history. The short version is that it might
exist as `ar_usertext_timestamp`, `usertext_timestamp`, or both on
MySQL, so dropping it for the actor migration needs to drop both names
if they exist.
We can also remove the now-obsolete aliasing from MWLBFactory.
Bug: T233221
Bug: T104756
Bug: T229712
Change-Id: I429e7ade2c86a2514aafe947012f096b03aa67ce
This removes most of the pre-actor user and user_text columns, and the
$wgActorTableSchemaMigrationStage setting that used to determine
whether the columns were used.
rev_user and rev_user_text remain in the code, as on Wikimedia wikis the
revision table is too large to alter at this time. A future change will
combine that with the removal of rev_comment, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).
ActorMigration's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process. Code using
ActorMigration for accessing the core fields should be updated to use
the new actor fields directly. That will be done for in a followup.
Bug: T188327
Change-Id: Id35544b879af1cd708f3efd303fce8d9a1b9eb02
The default blob type holds 65kB which is often enough, but some
jobs push over this limit. When using mysql these are silently
truncated to 65kB which only issues errors when the data is retrieved.
Increase from blob to mediumblob which gives a max size of 16MB. There
may be some valid use cases for jobs > 64kB, but there should be no
use case for jobs > 16MB.
Bug: T124196
Change-Id: I6df6634bd3a5b5fa27ce6f8ff20d251a9b5eba32
This removes most of the pre-CommentStore text columns, and the
$wgCommentTableSchemaMigrationStage setting that used to determine
whether the columns were used.
rev_comment remains in the code, as on Wikimedia wikis the revision
table is too large to alter at this time. A future change will combine
that with the removal of rev_user_text, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).
CommentStore's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process.
Bug: T166733
Change-Id: I1479c73774e01ead1490adf6128f820c09bce9d4
Update the database schema so a block can be switched between a sitewide and
partial block. Also add the restrictions table for specifiying the partial
blocks.
Bug: T197144
Change-Id: I4a725312c4b980a1b14e5ca826069fa2278a5913
MySQL, SQLite, PostgreSQL and MSSQL done with transitional patches.
One additional duplicate index removed from PostgreSQL schema.
Having a PK is essential to do maintenance, specially on large tasks.
By not having a PK it is impossible to add it in a safe way if not done
directly on the master.
Having a PK means that we can easily change the PK into another one if
needed in the future. The ones we chose might not be the best ones, but
will allow us to get them changed.
Bug: T198811
Change-Id: I6b96a427687085c6c24bcd759c9739f81288b919
To follow up I39b0825c, this change replaces the existing non-unique
index on the column with a unique index, to help avoid some of these
sort of bugs in the future.
Bug: T193180
Change-Id: I932478c9c6a13210bc9dff75286d0f08da56682c
Adds a maintenance script to populate the field, has that be
automatically run during update.php, and drops the no-longer-needed
default value on the column (where possible: mssql has some sort of
constraint thing going on that I have no idea how it works).
Bug: T59176
Change-Id: I971edf013a1a39466aca3b6e34c915cb24fd3aa7
Table defining tag names for IDs. Also stores hit counts to avoid expensive queries on change_tag
See T185355 for more information
Bug: T193867
Bug: T185355
Change-Id: I4fd943589b3ed304471304c8beda15327a8edbcf
This should have been done long ago. Now it is being done.
This also changes ar_text_id to NOT NULL, since it should never be null
anymore, and DEFAULT 0 in preparation for MCR stopping writing it.
Bug: T33223
Change-Id: I18f1c740b7537c7dc3cfeba9b241d0a9f31caa34
Revisions deleted before MediaWiki 1.5 do not have a value in this
field. This is going to be a problem for migration to the MCR schema, so
provide a maintenance script to clean this up.
Then, for good measure, change the schema to make the field
non-nullable.
Bug: T182678
Change-Id: Ie2e11f12a30f379db32c3e074658012c6f93adb0
The site stats table holds a bunch of metric fields, two of which are of
data type "bigint unsigned", 3 are "bigint" (signed) and one is int
(signed). Also the default values differ widely: It is 0 on the
"unsigned" fields and the "int" field, but -1 on the three others. This
patch makes all of this more consistent:
Set all fields (except the ss_row_id, which isn't changed) data type to
"bigint unsigned". Also set NULL as the default value for all those
fields. Obviously -1 isn't a possible default value any more. Also, 0
can easily be mistaken for a real value (e.g. ss_active_users=0 -->
"there is nobody active on this wiki"). NULL, by it's definition, is the
value of choice for a value to insert into fields of which we don't know
a correct value.
The respective patch files were tested locally against MySql, Sqlite,
Postgres and SQL Server 2016. Neither oracle nor the upgrade with
update.php was tested.
Bug: T56888
Change-Id: I7d42aae434852a56b6f8dd559d8a5f3bce416021
This adds a default of 0 for:
- Mssql
- Mysql
- Sqlite
The field is already NULLable in:
- Oracle
- Postgres
Bug: T188741
Change-Id: Ibe1cc363d21fb96f38c263181bf30a429a1c7b45
This begins the process of merging image_comment_temp into the image
table by adding the needed column. Iab5f5215 will adjust the code
to use it and to add the necessary migration script.
Note this patch puts the new schema change in the 1.30 section rather
than the 1.31 section. This allows Iab5f5215 to have migrateComments.php
migrate the comments directly to the new field instead of having to
populate and then depopulate the temporary table.
Bug: T188132
Change-Id: I2485c5a758bf03bb2b4991eea920abd9d0d30bda
Per documentation on IDatabase, $conds must be a string or an array.
Passing false for conds is confusing, since it's unclear whether this
should match everything or nothing.
Bug: T188314
Change-Id: I8be1ac4cbdaafc41aadc2a658be8a99b754b0268
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.
A subsequent patch will remove the old columns.
Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
Schema additions/updates for MySQL, SQLite, PostgreSQL, MSSQL
and Oracle to add new tables:
* content
* content_models
* slots
* slot_roles
See also https://www.mediawiki.org/wiki/Multi-Content_Revisions/Database_Schema
Bug: T174028
Change-Id: I30a3a9834d54d0e6957553d91908b2b73b2c802f
Otherwise, the PK on log_search keeps getting dropped, ls_field_val readded and
this is then repeated on every run of update.php
Change-Id: I6b00933c29b5e24ec2833001fcf45053292d190c
Follows-up: Id635297838938c7c5dfe65d45285a4d16d65152d
WMF DBAs have been doing a massive effort to convert UNIQUE KEYS into
PRIMARY KEY.
Having a PK is essential to do maintenance, specially on large tasks.
By not having a PK it is impossible to add it in a safe way if not done
directly on the master.
Having a PK means that we can easily change the PK into another one if
needed in the future. The ones we chose might not be the best ones, but
will allow us to get them changed.
Bug: T172514
Change-Id: Id635297838938c7c5dfe65d45285a4d16d65152d
When revisions by logged out users are created, they will get copied
to this table. We can then JOIN it with revision when querying for
ranges at Special:Contributions.
DBA approval for this table can be found at T156318
Bug: T163562
Change-Id: I6593eb13701128faa782691a6b25ec01869c827d
Other filetypes use the text/plain MIME type, so we'll have to do something
else to support them.
Bug: T157348
Change-Id: Id78a504302fa664b353a4c45bdc5d99f95a0180a
This index name should be the same in new installations as in all other
MySQL installations. This is necessary so that
Special:DeletedContributions does not give an SQL error. Release notes
will go in the 1.28 branch.
Bug: T154872
Change-Id: I535a5513ab56203139c4cf64874ea7e7498990e3
This will allow searching on user id instead of just the name.
This is how ContribsPager, LogPager, ... all work already.
Bug: T160415
Change-Id: I4db7bd0f917a428f40eb315246f89d49c7ae5b6a
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
This includes renaming fixBug20757.php to fixT22757.php for similar consistency.
Change-Id: If81a590d658fbd82c20c54ac47dfdc8856745ca3
This patch adds an ug_expiry column to the user_groups table, a timestamp
giving a date when the user group expires. A new UserGroupMembership class,
based on the Block class, manages entries in this table.
When the expiry date passes, the row in user_groups is ignored, and will
eventually be purged from the DB when UserGroupMembership::insert is next
called. Old, expired user group memberships are not kept; instead, the log
entries are available to find the history of these memberships, similar
to the way it has always worked for blocks and protections.
Anyone getting user group info through the User object will get correct
information. However, code that reads the user_groups table directly will
now need to skip over rows with ug_expiry < wfTimestampNow(). See
UsersPager for an example of how to do this.
NULL is used to represent infinite (no) expiry, rather than a string
'infinity' or similar (except in the API). This allows existing user group
assignments and log entries, which are all infinite in duration, to be
treated the same as new, infinite-length memberships, without special
casing everything.
The whole thing is behind the temporary feature flag
$wgDisableUserGroupExpiry, in accordance with the WMF schema change policy.
The opportunity has been taken to refactor some static user-group-related
functions out of User into UserGroupMembership, and also to add a primary
key (ug_user, ug_group) to the user_groups table.
There are a few breaking changes:
- UserRightsProxy-like objects are now required to have a
getGroupMemberships() function.
- $user->mGroups (on a User object) is no longer present.
- Some protected functions in UsersPager are altered or removed.
- The UsersPagerDoBatchLookups hook (unused in any Wikimedia Git-hosted
extension) has a change of parameter.
Bug: T12493
Depends-On: Ia9616e1e35184fed9058d2d39afbe1038f56d7fa
Depends-On: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Change-Id: I93c955dc7a970f78e32aa503c01c67da30971d1a
This will allow for replacing the limit-and-offset queries with queries
that page in a sensible manner.
Bug: T59176
Change-Id: If5c137f68496772f3fff3a735b7b0c388426e518
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
This makes it match tables.sql, as it was modified previously but no
related database patch was made.
Bug: T117854
Change-Id: I239e7ee4d97fcc3cb96c98dc53d9371883aaf4fb
In 1.24 (b8c038f678), this update from 1.15 (see T18645,
640a6d311e) was undone in tables.sql. However, it was not
removed from MysqlUpdater, so update.php would still make the
indices UNIQUE, even when run on a new MediaWiki installation.
In its place, added patch-pl-tl-il-nonunique.sql, which recreates
the indices to match the current definitions from tables.sql.
Bug: T78513
Change-Id: Ic82ca06c8e7051bcd1e0a2a3d5d251e297a9142f
The PRIMARY KEY is rev_id, so this is a waste and
makes the index slower to maintain (e.g. no change
buffering).
Bug: T142725
Change-Id: I63f817656ff5e62aa27caf607d70353cc99eb349
We want to update categories in order, to minimize disruption
to users. Previous indexes required a filesort to do this, which
exploded things on large wikis. See bug for details
Bug: T58041
Change-Id: Iee6cd997ff87a313a46fda19d8ab063d0fed8ce8
The plan here is to take it out of 1.27.0-wmf.12 and put it back in
1.27.0-wmf.13.
Since BotPasswords depends on SessionManager, that's getting temporarily
removed too.
This reverts the following commits:
* 6acd424e0d SessionManager: Notify AuthPlugin before calling hooks
* 4d1ad32d8a Close a loophole in CookieSessionProvider
* fcdd643a46 SessionManager: Don't save non-persisted sessions to backend storage
* 058aec4c76 MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php
* b5c0c03bb7 SessionManager: Save user name to metadata even if the user doesn't exist locally
* 13f2f09a19 SECURITY: Fix User::setToken() call on User::newSystemUser
* 305bc75b27 SessionManager: Don't generate user tokens when checking the tokens
* 7c4bd85d21 RequestContext::exportSession() should only export persisted session IDs
* 296ccfd4a9 SessionManager: Save 'persisted' flag in session metadata
* 94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
* 46a565d6b0 Avoid false "added in both Session and $_SESSION" when value is null
* c00d0b5d94 Log backtrace for "User::loadFromSession called before the end of Setup.php"
* 4eeff5b559 Use $wgSecureCookie to decide whether to actually mark secure cookies as 'secure'
* 7491b52f70 Call session_cache_limiter() before starting a session
* 2c34aeea72 SessionManager: Abstract forceHTTPS cookie setting
* 9aa53627a5 Ignore auth cookies with value 'deleted'
* 43f904b51a SessionManager: Kill getPersistedSessionId()
* 50c5256352 SessionManager: Add SessionBackend::setProviderMetadata()
* f640d40315 SessionManager: Notify AuthPlugin when auto-creating accounts
* 70b05d1ac1 Add checks of $wgEnableBotPasswords in more places
* bfed32eb78 Do not raise a PHP warning when session write fails
* 722a7331ad Only check LoggedOut timestamp on the user loaded from session
* 4f5057b84b SessionManager: Change behavior of getSessionById()
* 66e82e614e Fix typo in [[MediaWiki:Botpasswords-editexisting/en]]
* f9fd9516d9 Add "bot passwords"
* d7716f1df0 Add missing argument for wfDebugLog
* a73c5b7395 Add SessionManager
Change-Id: I2389a8133e25ab929e9f27f41fa9a05df8147a50
Bot passwords are something like OAuth-lite, or Google's application
passwords: the bot can use API action=login to log in with the special
username and password, and will then be allowed to use the API with a
restricted set of rights.
This is intended to provide an easy migration path for legacy bots and
for bots on wikis without OAuth, since AuthManager is going to greatly
complicate non-interactive authentication. If OAuth is available, an
owner-only consumer would be a better choice.
Bug: T121113
Change-Id: Iaa4015e00edbfbfaedcc8b2d27a2d3fd25009159
Depends-On: I7e15331efb162275c4116bcae61f19d6b884cbe3
Changed some old bugzilla links to new phabricator links in comments,
test data and error message. This reduces the need for redirects from
old bugzilla to new phabricator from our source code.
Change-Id: Id98278e26ce31656295a23f3cadb536859c4caa5
This is just the db part. The changes to UI validation code will
come in a dependent patch later.
This changes the max size of various *_comment, *_description
and *_reason fields to be 767 bytes. This size is chosen to
be consistent with the largest we can get away with while
still having covering indexes.
It also unifies the various data types of these fields to
varbinary. (Note, this was previously done and reverted in
r80547, but I don't think the reason for revert applies to
the edit summary fields)
MyISAM has a much smaller max index size, and this wouldn't
work with that storage engine. However, none of these fields
are used in default indexes (only in WMF indexes), so this
should not be an issue for anyone using MyISAM. Postgress
and sqlite already supported the larger edit summary size.
Note: This patch increases min mysql version to 5.0.3.
Bug: T6715
Change-Id: I8558e80a18e4591f07f2c3e80f792ea4435c4e71
The primary key of the user table is an unsigned int, the column
user_newtalk.user_id refer the id and should have the same typ to store
the same values as the user table does.
No pre-deployment activity necessary; no need to sync deployment
and merge; can be done at any time (now or later)
Bug: T77005
Change-Id: I641dc1fad0a5bb14815f55e0357243a562fd672b
Followup to Ieeb558f9523c11965cbc1941cad4f316c00c85c5
No need to create the table and drop it then
Change-Id: I11409c6e5a76d65365c5652039c584e249dbf556
Unused. Basically reimplemented as doSchemaRestructuring(). That
method could possibly be broken up and make more use of patch
files though.
Change-Id: Idb0a3740dd1401632f2e273ff46dd856a5d4d735
The American Chemical Society suggested a new major MIME type for files
containing chemical data in 1998: http://dx.doi.org/10.1021/ci9803233
This suggestion got widely adopted and is now a de-facto-standard despite
not registered with IANA.
Applying this patch will allow us to continue with extension MolHandler
and PDBHandler.
http://fab.wmflabs.org/T352
- Fixes bug 66412 by creating a logic that will prevent running unneeded
updates.
Bug: 66412
Change-Id: Ic45dc1bce796a0406ed8a84e6274df1c4bda4967
* Also tweaked the query so MySQL avoids doing a page_name
index scan when it should start with the link table index
* Added population script (triggered by update.php)
* Also removed uniqueness from some indexes where it is redundant
* Renamed two confusing variables
Bug: 60618
Change-Id: Icca99b6ae0ef76cb77695faf82c615516191da36
Special page PageLanguage to set the page language of a page.
To enable the feature, set $wgPageLanguageUseDB to true
and assign the 'pagelang' user right to a user group.
Bug: 35489
Change-Id: I0f82b146fbe948f917c1c5d29f7469644d797e80
Field was removed in 1.23 from sql statements, but kept to allow easier
rollback on version update from 1.22 -> 1.23, when something gets wrong
with the new version.
Bug: 40667
Follow-Up: I4a9c2fa813d1f25dfb755e564f7677a212934d7b
Change-Id: I48989aceec31019f0b6c98aaeafaf60e975244df
This adds the pp_sortkey column to the page_props table.
pp_sortkeys allows for top-k queries for pages, e.g.
the 100 pages with the most language links, etc. It is also
possible to query for exact values.
For now, pp_sortkey will contain pp_value's numeric value if
the value was set to a float, int or boolean.
Associated tasks:
* create a maintenance script for populating pp_sortkey. Tricky,
because when reading from the database, all values are strings.
* create an API module for querying pages by property value.
bug: 58032
Change-Id: I217c42656fb877ff35a36eb446a22bdaf119faac
Add functionality to expire users' passwords:
* Adds column to the user table to keep a password expiration
* Adds $wgPasswordExpirationDays, which will force users to reset
their passwords after a set number of days. By default, this set
to false, so passwords never expire.
* Adds a default grace period of 7 days, where if the user's password
is expired, they can still login, but are encouraged to reset their
password.
* Adds hook 'LoginPasswordResetMessage' to update reset message, in
case an extension wants to vary the message on a particular reset
event.
* Adds hook 'ResetPasswordExpiration' to allow extensions to change
the expiration date when the user resets their password. E.g., if
an extension wants to vary the expiration based on the user's group.
If the user is in the grace period, they get a password reset form
added to the login successful page. If an extension prevents showing
the login successful page (like CentralAuth), it should be updated to
show a password change form during the grace period. After the grace
period, the user will not be able to login without changing their
password.
Also prevents a successful reset if the user is "changing" their
password to their existing password.
No passwords will expire by default. Sites will have to call
User->expirePassword() from their own maintenance script to trigger a
password reset for a user.
Bug: 54997
Change-Id: I92a9fc63b409b182b1d7b48781d73fc7216f8061
Fixing bug #54404 requires querying against logging.log_user_text, which
is currently unindexed. Add an index, to prevent performance from being
adversely affected by the fix.
Bug: 54432
Change-Id: I6b2af65c75bbee57377cb1ec2e75ea41a5091f80
The table has been unused and dropped since 1.8,
so there is no need to keep the patches for the updater.
See https://www.mediawiki.org/wiki/Manual:Validate_table
Change-Id: Iaadf1115ff6e6cba986c5402320da78ba3c2a8f4
* New fields: ar_id, el_id. el_id is presently not used for
anything, but will help with online schema changes.
Bug: 15441
Bug: 39675
Change-Id: Ib6b0fc3736d173fa4ba7b786ecfc710b2f4711bb
No feature flag, and also not deployed on WMF wikis. Asking for schema changes by the time we branch tomorrow is just unfair
This reverts commit e478c230f6.
Change-Id: I125c30e76fa04679cc04ae7b8728ae3a61f35194
The existing field to differentiate between kinds of recentchanges rows is
the rc_type field. We want to allow extensions to insert their own custom
data into recentchanges, but we have learned via the NS_* series of constants
that requiring extensions to "register" a specific number is very error prone.
The solution, which this commit implements the first phase of, is to utilize
a new 16 byte string field rc_source. Within that field change types will be
prefixed strings such as 'mw.edit' and 'mw.new'.
This commit adds the new field and begins populating it with data. At some
point in the future the rc_type field will be dropped. While WMF wiki's will
simply wait out the 30 day recentchanges history, other wiki's have the option
of letting update.php populate rc_source, or manually applying the db change and
utilizing the PopulateRecentChangeSource maintenance script.
Change-Id: Iaddd6c446373a68d31586ed54346db7d04e13b2c
After pulling master and some extensions and
running the update script these tables are not
created when needed.
DB returned error "1146: Table 'my_wiki.valid_tag'
This is probably a broken edge case
This patch splits the patch into three seperate
patches ensuring all of the tables are created if
they dont already exist
Change-Id: I79c740dc4ec68d3c5aa0572dc77ea3ac8d305db9
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.
Also updated usage in text in documentation and the
installer LocalSettingsGenerator.
Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;
Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
This was an experimental authentication system intoduced a couple
of years ago with a pretty narrow use-case. It's been pretty much
ignored since introduction, and makes login more complicated than
it needs to be.
I didn't drop the external_user table on the off-chance someone
out there actually has data in it, but they should use AuthPlugin
for their external authentication needs.
Change-Id: I794338dbb75961ee033d41fa44bb7aa22e54f447
The iwlinks and langlinks modules continue parameters imply ordering by
page then prefix then title. But in certain modes, the actual queries
use a different ordering, which may result in skipped or repeated
results.
This changeset fixes that. To do so, it needs to re-add an index
iwl_prefix_from_title which was mistakenly removed in 2010 (r69721). And
while it's doing that, it cleans up errors in the sqlite and postgresql
handling of the iwlinks indexes too.
Also, per Asher, make the iwl_prefix_from_title and
iwl_prefix_title_from indexes non-UNIQUE.
Change-Id: I607e8bf9183a2d8152a6127a81c83a0b5bba0c61
By PSR2 PHP Standard, the files should ends with exactly one newline.
Some of our files have 2 or more and some other were missing a newline.
Fix almost all occurences of CodeSniffer sniff:
PSR2.Files.EndFileNewline.TooMany
I have not fixed the selenium files, I believe we will drop them.
Change-Id: I89fca8c1786fee94855b7b77bb0f364001ee84b6
* We already compute the props when stashing, so including that in a column
lets us reuse it later when the stashed file is to be published.
Change-Id: I3d6adb6528f1e992d8986058806e745c4e1c0300
* This adds a new 'claimTTL' setting which recycles jobs into the queue
if they have been claimed for longer than that duration (in seconds).
* This also purges jobs for such cases when job retries are not enabled.
* This adds a new job_attempts column and adds an index to improve the
query and semantics for FIFO ordered queues.
Change-Id: Idb6217a694d86a4d6fc881768deed424628f015d
* Added support for different queue types and methods for storing queues.
* Treat each job type as being on its own queue, at least logically.
* Added $wgJobTypeConf to configure queue types for each job type.
* Improved the job DB table so that duplicate job checks actually work
and are faster. Also improved the method for popping rows of the table.
* Disabled duplicate job removal for everything except refreshLinks.
The DELETE statements just add DB overhead and are not useful for cheap
jobs, especially ones with start/end params (which are unlikely to have
exact duplicates).
Change-Id: I49824c7fa855fea4ddcac5c9901ece8c2c0101d0
This allows sha1 searches with the api in miser mode for deleted files
Added script to populate the rows
Adding new field to selects and handle it in all places, where needed
Using a 10 byte index for the new field per
http://lists.wikimedia.org/pipermail/wikitech-l/2012-September/063429.html
Change-Id: Ie54a513fe361202e63df44be44a0fdd91926c974
This code is meant to replace the current interwiki code, but does not do so just yet. It is however used by the Wikibase extension. This allows us to try out some more things and have the code stabilize more before we migrate over existing interwiki functionality.
Change-Id: I23c47c2c3909a1500350fb560a5f2ec654e2c37e
Per Asher Feldman's suggestion on wikitech-l, truncate DB indexes which
hold SHA-1 values, so that the space usage is reduced at the expense of
a very small overhead when selecting values that have colliding
truncated hashes.
Change-Id: I059de4f7bba9a949cf0a93a57df32226c41d8ce0
Variables in classes should be declared using public $foo
instead of var $foo for various reasons. As we require PHP 5.3
we don't have to take care about that PHP4 left over, but can
get rid of it in favour of the more clear and better readable
public.
See also: http://php.net/manual/en/language.oop5.visibility.php
(Divided into several commits to keep reviewable)
Change-Id: Ic723d0347ab2e3c78bc0097345c68bbee3dc035a
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)
Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Searches by path are not used by any code, and small blobs
are stored with the rest of the row in innoDB, so there is
no gain there. The field is mostly a hangover from a use case
that never materialized (where it would be indexed).
Change-Id: I5515f15bd35823736138a79a4942c7207e519e5c
The content model is stored as a varbinary(32), the format
as varbinary(64).
If the standard model resp. format is used, null is written
to the database instead of the actual id, saving space.
Change-Id: I32659b49a9ad3cb8ecae9019562cff7de42b65f9
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.
This change entails some refactoring and renaming, but no big
change in logic.
Previously, whenever we blocked a user, its IP address would be
autoblocked whenever he tries to edit a page. Thus when later unblocking
the username, he would be automatically blocked again if we forgot to
clean up is IP.
This patch introduces a the ipb_parent_block_id column in ipblocks table
to track which block triggered the autoblock command. Thus, when deleting
the original block we can easily remove all subsequentautoblocks.
Schema updaters for MySQL, SQLite and postgres have been added to the
patch but not for the other database types such as ibm_db2, mssql and
Oracle.
Change-Id: I4aa820ae9bbd962a12d0b48b6c638a1b6ff4efc9
If we want to sort the ops for a batch ID, we can just use a tiny to small filesort.
No need to make the index bigger.
Change-Id: Ibf7592930ec633a26e675e33d42aebe7763547b1
used in rare cases and where we'd almost always only be interested in very
recent entries only (timestamp is indexed). This should decrease insertion
time a bit.
Change-Id: Idb33ee3229315c44b764a8ed476afe8760f5595c
* Added FileJournal class to log file changes for file backends. This can be used for migrations (like moving to Swift), syncing mirror repos, consistency checks, finishing/reverting operation batches, and such. The default journal is the "null" journal, which simply does nothing.
* Added the optional schema change required for using the DBFileJournal (MySQL, SQLite).
Change-Id: I33c9f9a598ba1f164c862b9dc3c718f9172db02b
* Added FileJournal class to log file changes for file backends. This can be used for migrations (like moving to Swift), syncing mirror repos, consistency checks, finishing/reverting operation batches, and such. The default journal is the "null" journal, which simply does nothing.
* Added the optional schema change required for using the DBFileJournal (MySQL, SQLite).
trunk is frozen pending stabilisation so we can release MediaWiki 1.19.
Those changes introduces API changes and new SQL tables, so that sounds like
new feature we do not have time to review right now.
Please reapply changes in branches/concurrency and have code review handled
there. Once the branch has been reviewed, please hold. Once trunk is stable
enough and 1.19 got branched, you are welcome to merge the branch in trunk.
Note: we can have a Jenkins jobs setup to run the branch tests if you need.
Reverts:
r108595 r108591 r108585 r108584 108572 r108564 108560 r108559
Designed for administration purposes, not to be exposed to front end users
Useful for administration purposes (like WMF with job runners), we can look at the "highest" jobs, and find out whether enwiki is just busy, or the jobs have been there a while (signalling that the job runners potentially have issues)
Added run of ConvertUserOptions maintenance script into update.php before dropping the column
Removed usages of user_options in code
Marked User::decodeOptions() deprecated as of 1.19.
Made ConvertUserOptions drop out early if the user_options field doesn't exist
Made ConvertUserOptions update user_options to '' after migration of user options to mOptions
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean
ArticleTablesTest testbug14404
Error:
ArticleTablesTest::testbug14404
Undefined offset: 0
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
ParserTests testParserTest #552 - testParserTest with data set #551
Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&action=edit&redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&action=edit&redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&action=edit&redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
</p>
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
Implemented changes suggested in code review on r92009:
constructor bug handling passed repo/stash
up-to-date timestamp generation
fetching db handle from repo
iterating over select results according to convention
changed uploadstash.us_media_type to enum to mirror image.img_media_type
removed (most) new references to $wgUser, instead using ApiBase::createContext to find the user