In the wildcards() function in memcache.inc:224 we have:

  private function wildcards($cid, $flush = FALSE) {
    static $wildcards = array();

...

    if (!isset($wildcard[$this->bin]) || !isset($wildcards[$this->bin][$cid])) {
      $multihash = $this->multihash_cid($cid);
      $wildcards[$this->bin][$cid] = dmemcache_get_multi($multihash, $this->bin);

When the if condition above is evaluated, the variable $wildcard is not yet declared and thus this will always give TRUE. I guess this should be $wildcards instead, that would make more sense. :)

The same mistake is present in the 6--1 branch in the memcache_wildcards() function.

Comments

gustavb’s picture

Title: Condition in wildcards() function will always evaluate to TRUE due to variable name misstake » Condition in wildcards() function will always evaluate to TRUE due to variable name mistake
longwave’s picture

StatusFileSize
new750 bytes

Equivalent patch attached for 6.x.

jeremy’s picture

Status: Needs review » Closed (fixed)

Good catch, thanks!

Fix committed in 6.x-1.x-dev:
http://drupal.org/cvs?commit=430556

An 7.x-1.x-dev:
http://drupal.org/cvs?commit=430558