Hello, we noticed after a forum upgrade from version 3, we were missing almost 70K threads. We tracked it down to this particular upgrade step in 500a1.

PHP Code:
function step_143()
This step removes duff thread records that have no first postid.
These threads have no posts, so adding them would be pointless and cause issues down the line.
Exclude the threads with open == 10 which are thread redirects
$query = "
. TABLE_PREFIX . "thread
WHERE firstpostid = 0 AND open 10
sprintf($this->phrase['vbphrase']['update_table'], 'thread'), $query

The code comment says "open == 10", but the actual query uses the '' or 'NOT equal to' operator.
The result is that almost 70k threads were deleted. These threads did not have any posts other than the starter, but they should not just be deleted from the upgraded forum.

We would like to confirm that the correct query should be "AND open = 10".