summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-09-15 20:34:35 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-09-15 20:34:35 +0000
commitf8b429e963b4e9fe73f0a85a0ccb2679eca65d62 (patch)
tree9497c600f1eb3aca808f9579db34b7b742652064 /database
parentd00f4a4ebfc91321ed965335b16e13e6eaa519cd (diff)
downloadbrdo-f8b429e963b4e9fe73f0a85a0ccb2679eca65d62.tar.gz
brdo-f8b429e963b4e9fe73f0a85a0ccb2679eca65d62.tar.bz2
#10862: Smarter filter cache wiping.
Diffstat (limited to 'database')
-rw-r--r--database/database.mysql3
-rw-r--r--database/database.pgsql1
-rw-r--r--database/updates.inc16
3 files changed, 18 insertions, 2 deletions
diff --git a/database/database.mysql b/database/database.mysql
index 45d864e7e..014b63c99 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -165,7 +165,8 @@ CREATE TABLE cache (
expire int(11) NOT NULL default '0',
created int(11) NOT NULL default '0',
headers text,
- PRIMARY KEY (cid)
+ PRIMARY KEY (cid),
+ INDEX expire (expire)
) TYPE=MyISAM;
--
diff --git a/database/database.pgsql b/database/database.pgsql
index 339549516..375281dfa 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -168,6 +168,7 @@ CREATE TABLE cache (
headers text default '',
PRIMARY KEY (cid)
);
+CREATE INDEX cache_expire_idx ON cache(expire);
--
-- Table structure for comments
diff --git a/database/updates.inc b/database/updates.inc
index 9489780dc..2435492c9 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -81,7 +81,8 @@ $sql_updates = array(
"2004-08-12" => "update_102",
"2004-08-17" => "update_103",
"2004-08-19" => "update_104",
- "2004-09-14" => "update_105"
+ "2004-09-14" => "update_105",
+ "2004-09-15" => "update_106"
);
function update_32() {
@@ -1798,6 +1799,19 @@ function update_105() {
return $ret;
}
+function update_106() {
+ $ret = array();
+ if ($GLOBALS['db_type'] == 'mysql') {
+ $ret[] = update_sql('ALTER TABLE {cache} ADD INDEX expire (expire)');
+ }
+ else if ($GLOBALS['db_type'] == 'pgsql') {
+ // TODO: needs PGSQL equivalent.
+ }
+
+ $ret[] = update_sql('DELETE FROM {cache}');
+ return $ret;
+}
+
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);