This patch only adds and removes suppressions, which must be done in the
same patch as the version bump.
Bug: T298571
Change-Id: I4044d4d9ce82b3dae7ba0af85bf04f22cb1dd347
We also bring along Database::attributesFromType(), which relied on the
private ::getClass(). This requires us to inject DatabaseFactory through
the LBFactory/LoadBalancer hierarchy.
Database::factory() is now soft deprecated. All callers outside of
includes/installer/ still need migration.
Bug: T299691
Bug: T315270
Change-Id: I7d057a9438f1b097554679975e4e9b2fc99e7c2b
Queries that query a value "1" are expected to return either
that "1" (possibly as a string), or false. It's safe to simply
cast this to bool and use it as it is.
Queries for COUNT(*) are expected to return that number,
possibly as a string. It's not possible for such a query to
return false. And even if, casting to 0 is fine.
I found an existing code style where the table name and the
"1" are on the same line as the selectField() method name, and
applied it to all similar queries.
Change-Id: I9453196281871c03ef03f653f43762eb9284342f
Postgres:
- Rename the table from `mwuser` to `user`
- Transition user_id from int to serial
- Make user_token not nullable and add default
- Make user_real_name not nullable and add default
- Make user_email not nullable
- Make user_newpassword not nullable
- Make user_password not nullable
- Drop UNIQUE contraint on user_name and add default
MySQL/SQLite:
* No changes
Bug: T164898
Bug: T230428
Change-Id: I746714f7b3ae16f9625f97bcca84280fcd8b61a0
One of the last ones left.
For MySQL/Sqlite:
- Dropping default of ar_timestamp, empty string is not a valid
timestamp.
- Changing ar_title from "varchar() binary" to varbinary
for Postgres:
- Set default for ar_namespace and ar_title
- Change datatype of ar_comment_id, ar_actor, ar_namespace
The indexes were fixed separately.
Bug: T230428
Bug: T164898
Bug: T42626
Depends-On: I83cf1cd51ac9cf933c9175cefd6e38a6914f3494
Change-Id: Ic1d13a82b27f7fa39a0f0ea9c5b7b193b007e4ab
For MySQL/Sqlite, drop the table options, they are for MySQL < 5.0 which
was released in 2003 and not any use today.
For Postgres, rename pagecontent table to text, approved as part of the
RFC. Swap order of creating auto-generated tables and manual tables.
Bug: T230428
Bug: T164898
Change-Id: Id7510b80beed7a7297353094a57d5e2d4f12fc64
9.4 was released December 2014, and became EOL in February 2020
https://www.postgresql.org/support/versioning/
Debian oldstable (Stretch) has PostgreSQL 9.6
Keeps things inline with doctrine/dbal 3.0.0, which only supports
PostgreSQL >= 9.4.
Bug: T270749
Change-Id: I9dc6af65f91849638a49f14e013b9a27fd6b8789
Also improve the description a bit and explain at a high level
how this code is used, and which classes back those entry points.
Change-Id: Ia69531858e714d0b43a29a7d5b6dcc5c7edd8240
This avoids having two similar fields that have to stay
in sync. Clean up the related error handling for connections.
If a connection handle is unusable, like when essential SET
queries fail, then destroy it.
Also:
* Avoid use of transactions in DatabasePostgres::determineCoreSchema.
* Make sure all subclasses log on connection failure.
* Add schema sanity checks to mysql/sqlite classes.
* Add IDatabase::QUERY_NO_RETRY flag to simplify reasoning about
queries that already run on open() to begin with.
* Remove unused return value of Database::open.
* Remove deprecated Database::reportConnectionError method.
Change-Id: I97beba7ead1523085bda8784234d00c69ef1accc
This was approved by TechCom in the "PostgreSQL schema change for
consistency with MySQL" RfC (T164898).
Bug: T164898
Bug: T190539
Change-Id: I1b17c18c513e4edcd9219e36e873c55dd7f33034
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).
Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
If MediaWiki has increased the minimum database server version that is
required, check it when running update.php to ensure it is still
compatible. Previously this was only checked during the installer.
Bug: T162044
Change-Id: I47092c9557f4706a4dcb3a23150647e68af4317f
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
* Make isTransactableQuery() exclude CREATE/ALTER.
Starting transactions for schema changes like this can cause
errors as it is not supported for MySQL and some Postgres
operations. Note that temporary tables are session-level,
so they are not effected by this change.
* Clean up the transaction logic in determineCoreSchema()
so a transaction is not left dangling.
* Fix broken getSchemaPath() call in PostgresInstaller.
* Avoid warnings in DatabasePostgres::closeConnection() if
mConn is already unset.
* Commit master changes in doMaintenance.php before running
deferred updates, just as MediaWiki.php does.
* Change E_WARNING to E_USER_WARNING to avoid notices in the
default /rdbms error handlers.
* Also avoid trying to rollback in MWExceptionHandler if the
LBFactory service is disabled, which just results in an error.
Bug: T147599
Change-Id: I64ccab7f9b74f60309ba0c9a8ce68337c42ffb0f
Reverts broken patch 0cf4e92d; it seems to have been intended to
validate the *to be created* db username/pass, but instead it
validates the *installation username/pass*. This made it impossible
to install if your db user had no password, as on many default dev
installations.
Bug: T85281
Change-Id: I0caaf8b9a244d6f4dad0cba32c566ea557f77fcc
Change I29b79a3c1bb2b5e51c1c8f5e04cd08c71e0662a3 rendered
it uninstallable on PostgreSQL.
Make the corresponding API changes to PostgreSQL installer.
Bug: T90288
Change-Id: I2019893ad705d99f3dbbce13690cd808cfb71d4a
Since Id364306d883e0d494b948854e05f3f79ba7dd6d2 the text boxes on the
gui installer were not preloaded with the default values from
DefaultSettings.php.
Changed this by return all needed globals (defined by getGlobalNames)
from DatabaseInstaller::getGlobalDefaults(). This injects the as default
value in function getVar and than gets used, when no value is set.
Bug: T71281
Change-Id: I8217b25e903e40ec82be3d700381ff7aea3b481f
Temporary fix for bug 70030.
openConnectionWithParams() got a new schema
parameter in 30a82aae9c and therefore must
not be used to probe some available databases
when checking username/password, because
schema is not at all a PostgreSQL connection
parameter - it something similar to
"current directory" in the database. PostgreSQL
can additionally search additional schemas
for objects in necessary.
This whole openPgConnection logic needs some
deeper repair; for now however, let's quickly
fix bug 70030 which is caused by that fact
that openConnectionWithParams returns magic
"Status" object and no longer a DatabasePostgres
instance we can directly talk to.
As a result, openPgConnection( "create-db" )
was returning a Status object that had
another Status object embedded in the value
field.
This reverts partially commit 30a82aae9c.
Conflicts:
includes/installer/Installer.php
includes/installer/PostgresInstaller.php
maintenance/install.php
Bug: 70030
Change-Id: I61d5f262e60722bc08201b40b61a298d8af42223
- Added/removed spaces around parenthesis
- Added space after switch/if/foreach
- changed else if to elseif
Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
Due to changes made to support Microsoft SQL Server, $wgDBmwschema changed its default from
"mediawiki" to null in DefaultSettings.php, as anything else horribly broke every DBMS that did
not use schemas (such as MySQL and SQLite). This change makes it so that the default value can
be properly overridden again by PostgreSQL and Microsoft SQL Server, and also enables the
--dbschema flag to the CLI installer.
Bug: 64043
Change-Id: Id364306d883e0d494b948854e05f3f79ba7dd6d2
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
Added configurations for Mysql and Postgresql installers
to display an error message if user doesnt input a username to the
database username
Bug: 43528
Bug: 59663
Change-Id: Ib6b05d2d7e8ebb4438d3b0051c33d367f41a9957
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.
Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668