contentStateSQLFor is contentStateSQL for a query that aliases the items table as something other than `i` — the backlink queries call it `s`, since the row they describe is the SOURCE item of a link (BUG-3033). A function rather than a second copy: two hand-maintained spellings of this predicate w
(alias string)
| 836 | // predicate would be two chances to drift, and a predicate that disagreed with |
| 837 | // itself between doors is the shape of the defect this whole family is about. |
| 838 | func contentStateSQLFor(alias string) string { |
| 839 | // Set-aside rows first (BUG-3244): when an item has both, the edits no tab |
| 840 | // can recover are the claim a reader must not miss, and set-aside rows do |
| 841 | // not depend on the watermark, so a tab stamping it cannot clear them. |
| 842 | return `CASE WHEN ` + setAsideExistsSQLFor(alias) + |
| 843 | ` THEN 'superseded_set_aside' WHEN ` + pendingFlushExistsSQLFor(alias) + |
| 844 | ` THEN 'applied_pending_flush' ELSE '' END` |
| 845 | } |
| 846 | |
| 847 | // pendingFlushExistsSQLFor is the BUG-3000 half of contentStateSQLFor on its |
| 848 | // own: unflushed content-bearing op-log rows. A door that must ask about the |
no test coverage detected