The COUNT query in path.inc runs fine on MyISAM because MyISAM keeps track of the total rows in each table. InnoDB must count all rows.

Fortunately, we don't need to count all of them. We just need to know if there's at least one.

Comments

webchick’s picture

Status: Active » Needs review
david strauss’s picture

Status: Needs review » Active
StatusFileSize
new476 bytes

Here's a D6 version.

david strauss’s picture

Just checked, this is "fixed" in Drupal 7 by virtue of not running such a check at all.

david strauss’s picture

Status: Active » Needs review

Whoops, my later comment overwrote webchick's status change.

david strauss’s picture

StatusFileSize
new481 bytes
new481 bytes

Updated patches.

david strauss’s picture

StatusFileSize
new493 bytes
new493 bytes

Account for possibility of "" and "0" as paths.

drumm’s picture

Version: 5.7 » 6.x-dev
Status: Needs review » Needs work

$count is no longer an accurate name for the variable. I would rename it to $has_paths with a boolean value. The ternary operator and '> 0' can be removed.

david strauss’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB
new1.01 KB

Updated patches to include drumm's suggestions.

david strauss’s picture

Ignore those last patches. I need to handle a regression in "0" and "" path handling.

drumm’s picture

I meant keep the !== FALSE, but remove the redundant ternary.

david strauss’s picture

@drumm Yes, I realized that. That's why I said my last post was bad.

dave reid’s picture

Status: Needs review » Closed (duplicate)