So it sets the size to false now in that case?
Well if there is no rev row. I guess rev_len would be NULL if it just wasn't populated.
No, it sets it to null in that case -- instead of turning it into the string 'NULL', we now pass the null value through.
False could come up when the row doesn't exist; the previous code would have silently converted that to 0, which is probably wrong. New code will pass the false through, which I believe will end up as an empty string "" in the output SQL.
However, that's fairly unlikely as we've just populated 'recentchanges' with items pulled from 'revision'; and if revisions got deleted in the meantime their recentchanges records should have been removed too.
So I'm not sure if that's a case you'd need to handle... but checking for false and returning null wouldn't hurt?
Couldn't hurt :)
So, how to fix the garbage that this script has added into the database?
Actually, I'm not sure what it has added to the DB? Is 'NULL' in MySQL converted to 0 or null?
Looks like it turns 'NULL' into 0 inserting into an int column. (This probably throws a warning in strict mode, but otherwise coerces silently to 0.)
If you want to clean up, I guess just run rebuildrecentchanges.php again after the fix. :)