When fetching a key from an array, PHP converts numeric strings to
integers. This led to an incorrect category update query.
So:
* In LinksTable subclasses, cast all string-like array keys to string.
* Add a unit test which confirms that no integers leak into link IDs.
* Add a fully integrated regression test for T301433.
The integration test and 7 of the link ID cases are confirmed to fail
if Amir's patch is reverted.
Bug: T301433
Change-Id: I8d19443607121b3efcafb82096bcff18c41035df
* In PagePropsTable, compare values after converting to string. In the
old code this was implicitly done by array_diff_assoc().
* Also convert to string before inserting, since
ParserOutput::setPageProperty() is documented as allowing null, but
the field is not nullable, so the query failed.
* Add a regression test which confirms that no write queries are done on
the second invocation of LinksUpdate.
Bug: T299662
Change-Id: I3f7d5800bf27a47cb57be80bdba13792fe3caae6
* In LinksUpdate, put each table in its own class, so that the
special code for each table has a more elegant place to go.
* Use generators to abstract and flatten out the underlying ParserOutput
data structures, without requiring the data to be copied. This allows
the incremental logic which was previously duplicated for each table,
i.e. computing insertions and deletions from the old and new state,
to be factored out. The per-table batch classes act as container
abstractions for the underlying data.
Bug: T263437
Depends-On: I472f4a023969bfde6298eb56112c16d2ae842199
Change-Id: Id40be19a8caa7b4669911927964cfd6755c25238