Index: dmemcache.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/memcache/dmemcache.inc,v
retrieving revision 1.1.2.7.2.4
diff -b -u -p -r1.1.2.7.2.4 dmemcache.inc
--- dmemcache.inc	26 Jan 2009 21:12:04 -0000	1.1.2.7.2.4
+++ dmemcache.inc	3 Aug 2009 09:32:15 -0000
@@ -115,17 +115,22 @@ function dmemcache_flush($bin = 'cache')
 }
 
 function dmemcache_stats($bin = 'cache', $type = '') {
-  // resolve requests for 'default' type to ''
-  if ($type == 'default') {
-    $type = '';
-  }
   // resolve requests for 'default' bin to 'cache'.
   if ($bin == 'default') {
     $bin = 'cache';
   }
   if ($mc = dmemcache_object($bin)) {
+    // The PHP Memcache extension 3.x version throws an error if the stats
+    // type is NULL or not in {reset, malloc, slabs, cachedump, items, sizes}.
+    // If $type is 'default', then no parameter should be passed to the 
+    // Memcache memcache_get_extended_stats() function.
+    if ($type == 'default' || $type == '') {
+      return $mc->getExtendedStats();
+    }
+    else {
     return $mc->getExtendedStats($type);
   }
+  }
 }
 
 /**
