HomePhabricator

Add test coverage for "%R" in qsprintf() and convert LiskDAO to support it

Description

Add test coverage for "%R" in qsprintf() and convert LiskDAO to support it

Summary:
Ref T13210. Ref T11908. Add some basic test coverage for the new "%R" introduced in D19764, then convert LiskDAO to implement the "Database + Table Ref" interface.

To move forward, we need to convert all of these (where %T is not a table alias):

qsprintf($conn, '... %T ...', $thing->getTableName());

...to these:

qsprintf($conn, '... %R ...', $thing);

The new code is a little simpler (no ->getTableName() call) which is sort of nice. But we also have a lot of %T so this is probably going to take a while.

(I'll hold this until after the release cut.)

Test Plan:

  • Ran unit tests.
  • Browsed around and edited some objects without issues. This change causes a reasonably large percentage of our total queries to use the new code since the LiskDAO builtin queries are some of the most commonly-constructed queries, although there are still ~700 callsites which need to be examined for possible conversion.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13210, T11908

Differential Revision: https://secure.phabricator.com/D19765