From 9f1c4d0cf4457597152326f32839c4cf86ec4a46 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 23 Jan 2006 05:37:57 +0000 Subject: [PATCH] Prefix the cache tables with a "c" so we don't get issues with MySQL --- includes/cachev.php | 10 +++++----- index.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/cachev.php b/includes/cachev.php index b940f82..4d7dd10 100644 --- a/includes/cachev.php +++ b/includes/cachev.php @@ -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']) diff --git a/index.php b/index.php index fc5e0f4..ce8f3a5 100644 --- 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 '', -- 2.22.5