| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Also added LBFactory::setTableAlias() for consistency with this
Change-Id: Ie49003ff8fd5b99f75db9fae8fe0a184444254d4
|
|
|
|
| |
Change-Id: I96f3e0c4920d52f63175cb6767c149f20a8a8cde
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Done using the PhpStorm refactor->rename tool.
Also move "defaultBigSelects" declaration to DatabaseMysqlBase
as no other classes uses that.
Change-Id: I424a2d9815de3a5d4cca2522f3db23a5efe6b592
|
|
|
|
|
| |
Bug: T182273
Change-Id: I9e1b628fe5949ca54258424c2e45b2fb6d491d0f
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also, enforce that new DB connection use the domain
schema as is the case with the DB name and table prefix.
The code worked previously since the local domain did not override
the schema in the server configuration arrays, so it happened not
to clobber the domain schema.
Lastly, fix unit test fatal in LBFactorySingle::forEachLB() when
called during LBFactorySingle::_destruct().
Change-Id: Ia9ddef0f21591d0c8b15f2947cd61569e3fec7a0
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Update replace()/upsert() to combine the affected row
count for the non-native case
* Also make replace() atomic in the non-native case,
similar to how upsert() already works
Change-Id: I6c9bcba54eca6bcf4a93a9b230aaedf7f36aa877
|
|/
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces MediaWikiTestCase::getSchemaOverrides, which can be overwritten
to return information about which tables are going to be altered, and which SQL
files should be used to set up the target schema. This allows tests for a class
that interacts with the database can have a subclass for each supported database
schema.
NOTE: this has only been tested with MySQL.
Bug: T180705
Change-Id: I7a4071072d802a82ecf7d16fbf8882ff8c79287f
|
|
|
|
| |
Change-Id: Ib34b623b47fb92f1383bc5c55c50a16dd6d49abd
|
|
|
|
|
|
|
|
|
|
|
| |
This store is used for ChronologyProtector positions.
It should be cross-DC since the sticky DC cookie may not work
for rapid cross-wiki farm activity, causing some request go to
the non-primary DC.
NOTE: this change should be deployed on all farm wikis at once
Change-Id: Ife126592aacace696e43912b9461164a9ea98bc1
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's often forgotten because MySQL and Sqlite don't use it, the only
users are PostgreSQL and Oracle. And when used, if inserts to multiple
tables are being done it's easy to get the ordering wrong.
This patch reimplements DatabasePostgres::insertId() in terms of PG's
lastval() function, and adds triggers to the Oracle schema to make it
work the same as the other databases.
Bug: T164900
Change-Id: Ib308190c52673a9266c8495a589ae644f9fbefce
|
|
|
|
|
|
|
| |
This needs to be cross DC, so fix the name and comments.
Also update the one MWLBFactory reference to it.
Change-Id: I5ef10000276c300299fd1ece35ada0d78388bef7
|
|
|
|
| |
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
|
|
|
|
|
|
|
|
|
|
|
| |
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.
This is similar to I994d11e. Even more trivial, because this here is
about comments that don't say anything but "constructor".
Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In PostgresSQL
a) Temp tables are automatically deleted upon end of session
b) Same temp table name hides existing table for current session
It is not necessary to consider 'postgres' during dropping of table.
I guess similar logic for Oracle but I could not verify.
It seems that no one use Oracle for MediaWiki.
Bug: T113445
Change-Id: I37b5483a6e9abe5cda0d4dfc103c287641f277a7
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
selectField() and selectFieldValues() are trivial, they just need to
pass it through to select(). In fact, selectFieldValues() was already
doing it, just no one ever updated IDatabase.
insertSelect() is a little more work. nativeInsertSelect() was
originally written as largely a copy-paste of select() and has since
gotten well out of sync. Now that we have selectSQLText(), we should be
able to just use that. DatabasePostgres's implementation can wrap the
parent implementation instead of being another copy-paste, but
DatabaseOracle seems to still need to be special.
Change-Id: I0e6a9e6daa510639d3212641606047a5db96c500
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a service to represent wfReadOnly() and friends.
It's necessary to have two service instances, one for wfReadOnly() and
one for wfConfiguredReadOnlyReason(), to avoid a circular dependency,
since LoadBalancer needs the configured reason during construction, but
wfReadOnly() needs to query the currently active load balancer.
Not having a cache of the configuration makes it possible to dynamically
change the configuration. Ideally things would not change the
configuration, and I removed such instances in core, but to support
extensions, I added a test ensuring that the configuration can be changed.
Change-Id: I9bbee946c10742526d3423208efd68cb3cc5a7ee
|
|
|
|
| |
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
|
|
|
|
| |
Change-Id: I52bef87512f9ddd155d1f4cc0052f6b7a0db5b42
|
|
|
|
| |
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
|
|
|
|
| |
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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.
Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Travis CI, the Postgres build has been failing very early on
in the installer (before phpunit) due to a database error:
> Creating administrator user account.. DBQueryError at Database.php:1059
> Query: SELECT user_id FROM "user" WHERE user_name = 'Admin' LIMIT 1
> Function: User::idForName
> Error: 42P01 ERROR: relation "user" does not exist
> LINE 1: SELECT /* User::idForName */ user_id FROM "user" ...
This is because the installer makes its own Database object without
involving ServiceWiring or MWLBFactory, which means wgDBport and
(more importantly) 'keywordTableMap' don't get applied.
While keywordTableMap doesn't matter during the database installation,
after the installer is done updating GlobalVarConfig and resetting
MediaWikiServices, DatabaseInstaller::enableLB takes that homemade
connection and injects it into MediaWikiServices by redefining
the 'DBLoadBalancerFactory' service. Which then affects all use
of wfGetDB(), such as from User::idForName().
Bug: T30162
Bug: T75174
Bug: T75176
Change-Id: I7af58c4beffc4908a93c0c1d8ab1aec9d4ec57c6
|
|
|
|
| |
Change-Id: I9be89faef693343a4071d7c29b6ca0c021e7fb63
|
|
|
|
|
|
| |
Update core callers and leave a class alias to \Field.
Change-Id: I4908282301d5de2a20baafe510557bd2c3867de5
|
|
|
|
|
|
|
| |
Leave \Blob as an alias. Callers can now use the Rdbms\Blob class
for "extends"/"new" and the Rdbms\IBlob interface for type hints.
Change-Id: I983b76f181ac60c1eb92c350cd27ad77ec90a192
|
|
|
|
| |
Change-Id: I3fb482232483f37bf73ebbeb405056794109e618
|
|
|
|
|
|
|
|
|
| |
* Inject global variables in MWLBFactory.php
* Remove incompatible ignoreErrors() override which is only called
from the base classes.
* Remove use of wf* methods.
Change-Id: Idf8202474182cc82fb6ef453e2722e7af17e32aa
|
|
|
|
| |
Change-Id: Ifb06e792a36b5123ec3596933d0d394711ee5d08
|
|
|
|
| |
Change-Id: I5ae10783228d0252284807c9562bc8e328d4becb
|
|
|
|
|
|
|
|
|
| |
Use of &$this doesn't work in PHP 7.1. For callbacks to methods like
array_map() it's completely unnecessary, while for hooks we still need
to pass a reference and so we need to copy $this into a local variable.
Bug: T153505
Change-Id: I8bbb26e248cd6f213fd0e7460d6d6935a3f9e468
|
|
|
|
| |
Change-Id: Iac80f6668be17c0e35908fc8fdacbae0201f2d7f
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.
Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.
This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.
Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
|
|/
|
|
|
|
|
|
|
|
|
| |
This is useful when IMaintainableDatabase methods are needed
for foreign wiki connections to things like external store.
Also:
* Set visibility for ExternalStoreDB methods.
* Cleaned up various type hints and comments.
Change-Id: Ie35b1ff21032cc4e78912dc499486da23aeba041
|
|
|
|
| |
Change-Id: Ia3b7f9cb7d40f4ec9f19c924904e8a096880ec6a
|
|
|
|
|
| |
Bug: T148956
Change-Id: I14f0aa7dd52bd0bdd0d3f8729b562a0fee2df6fa
|
|
|
|
|
|
|
|
|
|
| |
Causes HHVM 3.12.7 to segfault and or:
Fatal error: Stack overflow in includes/libs/objectcache/BagOStuff.php on line 754
This reverts commit b47ce21cec3a4340dd37c773210a514350f10297.
Bug: T150833
Change-Id: Ia52fdf65f5e386c0eaa1046328680fb5c8a9081a
|
|
|
|
|
|
|
|
|
|
| |
This works by setting a callback to return the cache set
options. The callback will watch DB reads and create a
merged result from said usage.
This handles callers that are missing getCacheSetOptions().
Change-Id: Ia264f011e45e8cf105480955dad7e2c4c2357b73
|
|
|
|
| |
Change-Id: I71d3481fc624f665bac81725026647bbb84ae608
|
|
|
|
|
|
|
|
| |
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
|
|
|
|
|
|
|
|
| |
* Use services container in more places.
* Undeprecated getLocalServerInstance() since $fallback is not
handled elsewhere.
Change-Id: Id1fcd1c465d2d92653357523f4225f1c4d1ace2f
|
|
|
|
|
|
|
|
|
|
| |
It's no longer an LBFactory subclass (since 5d4b009cf), and the MW-prefix
seems more natural for this class.
The class has only existed since for about 2 weeks (since 0e5cd18b7) and
is not used outside MediaWiki core across Wikimedia Git.
Change-Id: I34be982b5d10ad03e062033da9c40b4a01665289
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I3919b04eb2de4fa0bf8a02239fb5bbf17d347511
|
|/
|
|
| |
Change-Id: Ibfc4c6cbbc08b5917f1a84d86d2d4a0855e371a1
|