A new method is now available to check whether session scope
locks are supported, which callers typically want when using lock().
Its usage can avoid deadlock prone and expensive row-level locks for
some maintenance tasks.
For Postgres, table locks are tied to the transaction. Trigger
startAtomic() in lockTables() and endAtomic() in unlockTables() to
assure that a transaction is present.
Also remove LOW_PRIORITY feature, which is ignored by mysql.
Change-Id: I499061bcc2763afb1ff4a43319064eed4ba3a8fe
Commented out in 033b6b9646 (r20329).
After ten years, I think it's safe to bet this won't ever be getting
un-commented.
Change-Id: Ibb1f3e2969b2d81f6f2a17fff57e9b05cc17d58b
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.
Skipping jsminplus.php as those bug numbers aren't Wikimedia's, nor obviously
someone else's.
Change-Id: I9a2210e17852ee56f11282b980ac66d8c7a95671
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
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
* Use $tempIgnore in DatabaseBase::tableExists() instead of ignoreErrors().
* DatabasePostgres::reportQueryError(), since 419221e4a7, calls
ignoreErrors() before and after rollback(). This is probably not effective
as a recursion guard (reportQueryError() would be called regardless), and
for suppressing any log entry or exception, it is redundant (doRollback()
already sets $tempIgnore when calling query()).
* ignoreErrors(), now unused, can be removed in a separate change set.
Change-Id: Iee768abf996ece213146ab8f64a15a2b407a2e5e
Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link.
Also update some defect links.
Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
It was changed to a private function today, but it is called in
PostgresInstaller so it is causing this error
PHP Fatal error: Call to private method
DatabasePostgres::determineCoreSchema() from context 'PostgresInstaller'
in /home/travis/build/paladox/mw/includes/installer/PostgresInstaller.php
on line 515
Caused by I2a067ca89a03f9ebf3f70a4f36ddae92e5b1e468
Change-Id: Ifac5a5c7dfeceeb8c7827d6d70e757633df77ca5
* Add missing method visibilites
* Removed redundant doc blocks
* Use empty string for mSchema for consistency with
the base class
Change-Id: I2a067ca89a03f9ebf3f70a4f36ddae92e5b1e468
* Remove redundant schema prefix from relname=x query. The
schema filtering is already done via the JOIN. The relname
portion is just the table name not <schema>.<table name>.
* Avoid explicit table schema qualification and rely on the
search path, as MW 1.27 did. Previously it only used the
global $wgDBschema var to pass to determineCoreSchema()
instead of keeping it in mSchema.
* Clean up some code duplication in Database::tableName() and
make the code comments clearer.
* Make DatabasePostgres::tableName() use parent::tableName()
instead of a method that just wraps this method. The intent
seems clearer this way.
* Remove unused return value in
PostgresUpdater::rebuildTextSearch().
Bug: T148628
Change-Id: Id11d9576b7c2fdad22ff7f90727c12997217a632
* Remove non-connection magic case when no DB $user
is given. This was removed from the base class.
* Use PGSQL_CONNECT_FORCE_NEW to let LoadBalancer
handle connection reuse. This makes it work like
the mysql classes.
* Make postgres connection error messages actually
be useful by using the PHP error when possible.
This makes it clear if the problem is authentication
or something else and so on.
Change-Id: I3fd76c1e2db8d6008074f5347b201554579b549a
* 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
Since the WaitConditionLoop class was first introduced in 1.28 (current
master), no back-compat alias is added.
Bug: T146256
Depends-On: Ia84774d83da79fea1e167fe065c69549981f753b
Change-Id: Ibd4f15c87105b8caccbd1f661b74b6efa012b77f
Pretty much everything seems to assume that PHP booleans should be
converted to 0/1: MySQL does this implicitly thanks to the lack of
strict mode by default, while PostgreSQL and Sqlite (and Mssql) do it
explicitly.
The addition of MySQL strict mode for unit tests in Ib2873913 exposed
the assumption in the case of MySQL by making some extension unit tests
fail. So let's make casting bool to int the default behavior of
Database::addQuotes().
This also cleans up the phpdoc for Database::addQuotes() to properly
reflect all the supported types that can be passed to it.
Change-Id: I13d0e402fa676bc27c345e8ac12f363ebc627f6a
* Document various parameter arrays.
* Fix $user = false loophole in Database::__construct().
* Set the Postgres port *before* calling super, as it is
needed by open().
* Remove 'chronProt' parameter as it is lazy-loaded.
Change-Id: Icc1037efa1eee7ae6fdd2919f60001e6e29ae55c