rdbms: fix Sqlite::tableExists() method to avoid STATUS_TRX_ERROR
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Jun 2018 21:38:47 +0000 (14:38 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 22 Jun 2018 22:33:45 +0000 (22:33 +0000)
commitd16bfb0a30882ef80f844f9fbb0775505caeeda2
treed3b2a291d4133718c9f370e9dd79ce3bdd9811c9
parentfe2fcd89049b0f943299b82ebca9e1598fdc994b
rdbms: fix Sqlite::tableExists() method to avoid STATUS_TRX_ERROR

Sqlite used the base implementation of trying a SELECT 1 query and
seeing if it failed. Instead, make it use the sqlite_master table.
Also remove the base version of that method since it would always
cause this problem and all subclasses have proper implementations.

Make LoadBalancerTest::assertWriteAllowed() more explicit and add
more assertions there.

Change-Id: I6c7b0bea8894c45dfe8931748d6687f0e5d1e101
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseSqlite.php
tests/phpunit/includes/db/LoadBalancerTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseTest.php