Handle PostgreSQL transaction errors and improve schema detection
authorMarcin Cieślak <saper@users.mediawiki.org>
Fri, 9 Mar 2012 17:24:57 +0000 (17:24 +0000)
committerMarcin Cieślak <saper@users.mediawiki.org>
Fri, 9 Mar 2012 17:24:57 +0000 (17:24 +0000)
commitcfb8e9a25115f6b8bd62718be7d55b036883b17a
treebc565be5775179f6a6f401c2a8fcc642aa0a1d0b
parent4fc819e92d9451c24594261d096d726d9acdc5f1
Handle PostgreSQL transaction errors and improve schema detection

* Introduce $wgDebugDBTransactions facility to help
  figure out what's going on with transactions.
  Currently PostgreSQL only.

  PostgresTransactionState can be easily be made more general
  to trace all sorts of state machinery.

* Improve r113408: we don't need to full reconnect on error,
  rollback is enough.

  Rolling back breaks search_path, as PostgreSQL
  can manage sessions settings under transaction therefore
  we need to improve schema sniffing introduced in r82674

* Introduce few schema handling functions. This could
  probably be generalized for other databases like DB2 and Oracle.

* Fix bug 15816 - Add a switch for SETting the search_path

  We try to avoid touching search_path at all unless
  really necessary. Even in this case we append MediaWiki
  core schema to the front of the list.

* No longer add $wgDBmwschema to PostgreSQL role search_path
  in the installer. This is no longer necessary as
  setting schema on connect should ReallyWorkNow(tm).

* Get rid as much as possible of $wgDBmwschema and
  bring us one step closer to fix bug 16794 (wgSharedDB
  support).

  All references to core MediaWiki schema in PostgreSQL
  specific code should now use Database::getCoreSchema()
  unless we know what we are doing.

Followup-To: r113408 r82674
RELEASE-NOTES-1.20
includes/DefaultSettings.php
includes/db/Database.php
includes/db/DatabasePostgres.php
includes/installer/PostgresInstaller.php
includes/installer/PostgresUpdater.php