I had my SQL statement broken up onto multiple lines and it kept not returning any rows. After MUCH debugging, I realized it was because of the preg_replace for the count_query that was not returning a count value because it doesn't like the line breaks in the SQL statement.
I don't think its something you need to fix, but it sure would be nice if it was in the docs. :)