HomePhabricator

Handle PostgreSQL transaction errors and improve schema detection

Description

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

Details

Provenance
saperAuthored on
Parents
rSVN113486: center images for wider screens
Branches
Unknown
Tags
Unknown
ChangeId
None