Database: clean up lockTables() and add postgres support
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 30 Mar 2017 21:56:22 +0000 (14:56 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 7 Apr 2017 23:28:36 +0000 (16:28 -0700)
commit1a1c43bdff483a2c74b5fa98d6e21910a3d17a72
treee4ee6518a89b8e814d1803672616112618955e8b
parentc6f96bc4c3caaf74acb9da3d6a74573ef3b35251
Database: clean up lockTables() and add postgres support

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
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/database/IMaintainableDatabase.php
includes/libs/rdbms/database/MaintainableDBConnRef.php