diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 1fe8c14..f2e204d 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -2750,7 +2750,7 @@ class SchemaCache extends DrupalCacheArray {
 
   public function __construct() {
     // Cache by request method.
-    parent::__construct('schema:runtime:' . $_SERVER['REQUEST_METHOD'] == 'GET', 'cache');
+    parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache');
   }
 
   protected function resolveCacheMiss($offset) {
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 954f575..d292fa6 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -151,14 +151,22 @@ class CacheSavingCase extends CacheTestCase {
     $this->assertTrue(isset($cache->data) && $cache->data == $test_object, t('Object is saved and restored properly.'));
   }
 
-  /*
+  /**
    * Check or a variable is stored and restored properly.
-   **/
+   */
   function checkVariable($var) {
     cache_set('test_var', $var, 'cache');
     $cache = cache_get('test_var', 'cache');
     $this->assertTrue(isset($cache->data) && $cache->data === $var, t('@type is saved and restored properly.', array('@type' => ucfirst(gettype($var)))));
   }
+
+  /**
+   * Test no empty cids are written in cache table.
+   */
+  function testNoEmptyCids() {
+    $this->drupalGet('user/register');
+    $this->assertFalse(cache_get(''), t('No cache entry is written with an empty cid.'));
+  }
 }
 
 /**
