Homestyx hydra

R1:99bcf06c62e8

Fix minor issues with PhrictionDocumentQuery

Summary:

- Order checks used `=` but intended `==`. We could probably write a lint rule for this.
- Selecting `*` with a join could pick (for example) `id` columns from both the document and content tables and end up using the wrong one.
- `%Q` expects a string and chokes on `null`.

Auditors: btrahan
Repository: R1 hydra
Commit Date: Nov 11 2014