rdbms: clean up non-native Database::replace() code
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 14 Jan 2018 03:57:51 +0000 (19:57 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 30 Jan 2018 03:19:28 +0000 (03:19 +0000)
commita3f51001c03a2ac3ac6562b363cd50a4fa3f1b63
tree7b477cbff6d97cb185d40b609078c46041773635
parent791d4db7a93776df313d27ab42d7d5b7dff55f7c
rdbms: clean up non-native Database::replace() code

* Make sure all unique keys specified have all their values
  provided to avoid large bogus DELETEs. Do not ignore them
  in such cases either, as that would cause inconsistencies
  between the native and non-native case. Use an exception.
* Make ChangeTags caller clearer that the list of indexes
  is not a list of fields for a single index. Also, avoid
  mentioning indexes for values not defined in the new
  records, as this causes errors or inconsistencies with
  the native vs non-native case.
* This also fixes the "Undefined index: ts_log_id" error
  when running unit tests on postgres.

Change-Id: I30263df22066bd6d4836202b1bcad5d1aa1e7383
includes/changetags/ChangeTags.php
includes/libs/rdbms/database/Database.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php