The comment for db_query_range() in database.mysqli.inc and database.mysql.inc says

 * Note that if you need to know how many results were returned, you should do
 * a SELECT COUNT(*) on the temporary table afterwards. db_num_rows() and
 * db_affected_rows() do not give consistent result across different database
 * types in this case.

This is untrue. It looks like someone copied the docs for db_query_temporary() and forgot to delete this paragraph, as db_query_range() does not use temporary tables; for MySQL it simply adds a LIMIT clause. This patch removes this comment.

CommentFileSizeAuthor
notempjv.patch1.75 KBjvandyk

Comments

dries’s picture

Version: 5.x-dev » 4.7.4
Status: Needs review » Reviewed & tested by the community

Good catch. Committed to CVS HEAD. Thanks. Needs to be backported, I think.

killes@www.drop.org’s picture

Status: Reviewed & tested by the community » Fixed

applied.

Anonymous’s picture

Status: Fixed » Closed (fixed)