rdbms: treat cloned temporary tables as "effective write" targets
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 20 Mar 2019 04:04:35 +0000 (21:04 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 26 Mar 2019 21:24:42 +0000 (14:24 -0700)
commit108fd8b18c1084de7af0bf05831ee9360f595c96
tree95e5543b25cdd41ef85558c49e29b345459b2118
parent3c3948a6f221a04954eb01b5423b7312c32aa870
rdbms: treat cloned temporary tables as "effective write" targets

Make IDatabase::lastDoneWrites() reflect creation and changes to
the cloned temporary unit test tables but not other temporary tables.
This effects the LB method hasOrMadeRecentMasterChanges(). Other tables
are assumpted to really just be there for temporary calculations rather
acting as test-only ephemeral versions of permanent tables. Treating
writes to the "fake permanent" temp tables more like real permanent
tables means that the tests better align with production.

At the moment, temporary tables still have to use DB_MASTER, given
the assertIsWritableMaster() check in query(). This restriction
can be lifted at some point, when RDBMs compatibility is robust.

Bug: T218388
Change-Id: I4c0d629da254ac2aaf31aae35bd2efc7bc064ac6
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/DatabaseMysqlBase.php
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/database/DatabaseSqlite.php
includes/libs/rdbms/database/IDatabase.php
tests/phpunit/includes/db/DatabaseSqliteTest.php
tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php