Returning thousands of rows only to count them with scalar() is, it turns out, not the most efficient way of counting.
Compress::Zlib now dies on wide characters. Presumably it has a good reason. We don't anticipate tons of wide characters, so we just convert them all to _. If this is a problem later we can adjust filters accordingly, or something. We could also perhaps use the utf8 -> ascii filters in the same module.
You're welcome, Jamie.
adminmail already sends email warnings on several errors but was not emailing when the table accesslog_temp_host_addr could not be created. Email warning added.
The DELETEs sent to the log master don't replicate to the slave if the master is ENGINE=BLACKHOLE and the slave is (obviously) not. This checks for that situation by testing whether an id exists on the master, and if not, sends the DELETEs directly to the slave.
The introtext is checked for a single case where it contains only one set of double quotes and then if present they are replaced with single quotes. Additionally, the subject line is sanitized so that every word is capitalized save for a, an, and, the, & of. The first word of the submission is capitalized regardless.
This new code's a little better for Slashdot's F5's and is a little more flexible for any Slash site that has a reverse proxy between its Slash webservers and its users. Also, fixed a var that had apparently gone missing in defaults.sql despite having been added to upgrades some years ago.
A query to get the total number of users who'd nodded and nixed was doing a table scan. Since its result wasn't being used in the template that generates the Firehose Usage console box, I commented it out. I also moved all the other stats queries it does use to a reader instead of the writer, and cleaned up some minor syntax.