Handle NULL workflow IDs on cleanup of expired workflows
Closes #1402 (closed)
I fixed the issue by adding what boils down to a WHERE workflow_id IS NOT NULL on the subquery, which removes all possible NULL values from within the NOT IN clause and causes the query to work properly.
I made a placeholder page in my Redmine wiki to remind myself to write some docs about our fun adventures with SQL NULL, which has JavaScript levels of evil.