Prefix the cache tables with a "c" so we don't get issues with MySQL
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Jan 2006 05:37:57 +0000 (05:37 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Jan 2006 05:37:57 +0000 (05:37 +0000)
includes/cachev.php
index.php

index b940f82eb00205c9cc284651ee39e0fc70c15332..4d7dd1052091749d68de632b16120acea6df210b 100644 (file)
@@ -124,7 +124,7 @@ class cacheV
                
                if (!isset($this->memcache['revs']["$revision"]))
                {
-                       $this->memcache['revs']["$revision"] = $this->controller->registry->db->query_first("SELECT * FROM {$this->hash}_revs " . ($revision == 0 ? " ORDER BY revision DESC LIMIT 1" : "WHERE revision = $revision"));
+                       $this->memcache['revs']["$revision"] = $this->controller->registry->db->query_first("SELECT * FROM c{$this->hash}_revs " . ($revision == 0 ? " ORDER BY revision DESC LIMIT 1" : "WHERE revision = $revision"));
                        $this->memcache['revs']["$revision"]['files'] = unserialize($this->memcache['revs']["$revision"]['files']);
                }
                
@@ -249,7 +249,7 @@ class cacheV
                $node = $this->controller->path;
                if (!isset($this->memcache['nodes']["$node"]))
                {
-                       $result = $this->controller->registry->db->query_first("SELECT * FROM {$this->hash}_nodes WHERE name = '" . $this->controller->registry->escape($node) . "'");
+                       $result = $this->controller->registry->db->query_first("SELECT * FROM c{$this->hash}_nodes WHERE name = '" . $this->controller->registry->escape($node) . "'");
                        if ($result == false)
                        {
                                return false;
@@ -293,7 +293,7 @@ class cacheV
        */
        function exec_build()
        {
-               $result = $this->controller->registry->db->query_first("SELECT MAX(revision) AS max FROM {$this->hash}_revs");
+               $result = $this->controller->registry->db->query_first("SELECT MAX(revision) AS max FROM c{$this->hash}_revs");
                $this->count = $result['max'];
                
                // time to go from the start
@@ -422,7 +422,7 @@ class cacheV
                
                // insert _revs
                $this->controller->registry->db->query("
-                       REPLACE INTO {$this->hash}_revs
+                       REPLACE INTO c{$this->hash}_revs
                                (revision, author, dateline, message, files)
                        VALUES
                                " . implode(",\n", $inserts['revs'])
@@ -430,7 +430,7 @@ class cacheV
                
                // insert _nodes
                $this->controller->registry->db->query("
-                       REPLACE INTO {$this->hash}_nodes
+                       REPLACE INTO c{$this->hash}_nodes
                                (name, node, revision, history, properties)
                        VALUES
                                " . implode(",\n", $inserts['nodes'])
index fc5e0f496ba626dc818c38b1236a950d1dbaba1e..ce8f3a5337671f14aeddf6dd7f72a6dab1f010cd 100644 (file)
--- a/index.php
+++ b/index.php
@@ -45,7 +45,7 @@ foreach ($viewsvn->repos->fetch_list() AS $repos)
        {
                $viewsvn->debug("creating new cacheV: $repos");
                $db->query("
-                       CREATE TABLE {$hash}_revs
+                       CREATE TABLE c{$hash}_revs
                        (
                                revision INT(20) UNSIGNED NOT NULL DEFAULT 0,
                                author VARCHAR(255) NOT NULL DEFAULT '',
@@ -57,7 +57,7 @@ foreach ($viewsvn->repos->fetch_list() AS $repos)
                );
                
                $db->query("
-                       CREATE TABLE {$hash}_nodes
+                       CREATE TABLE c{$hash}_nodes
                        (
                                name VARCHAR(255) NOT NULL DEFAULT '',
                                node VARCHAR(50) NOT NULL DEFAULT '',