aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php4
-rw-r--r--engine/schema/mysql.sql2
-rw-r--r--engine/schema/upgrades/2008110601.sql3
-rw-r--r--version.php2
4 files changed, 7 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 0ff9b2d26..836064060 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1529,8 +1529,8 @@
$name = sanitise_string($name);
$value = sanitise_string($value);
- delete_data("delete from {$CONFIG->dbprefix}datalists where name = '{$name}'");
- insert_data("insert into {$CONFIG->dbprefix}datalists set name = '{$name}', value = '{$value}'");
+ //delete_data("delete from {$CONFIG->dbprefix}datalists where name = '{$name}'");
+ insert_data("INSERT into {$CONFIG->dbprefix}datalists set name = '{$name}', value = '{$value}' ON DUPLICATE KEY UPDATE value='{$value}'");
$DATALIST_CACHE[$name] = $value;
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index b906f9b5b..695a2e79f 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -288,7 +288,7 @@ CREATE TABLE `prefix_users_sessions` (
CREATE TABLE `prefix_datalists` (
`name` varchar(32) NOT NULL,
`value` text NOT NULL,
- KEY `name` (`name`)
+ PRIMARY KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- System log
diff --git a/engine/schema/upgrades/2008110601.sql b/engine/schema/upgrades/2008110601.sql
new file mode 100644
index 000000000..ddd80a91b
--- /dev/null
+++ b/engine/schema/upgrades/2008110601.sql
@@ -0,0 +1,3 @@
+-- Alter datalists to have a primary key
+ALTER TABLE `prefix_datalists` DROP KEY `name`;
+ALTER TABLE `prefix_datalists` ADD PRIMARY KEY `name` (`name`);
diff --git a/version.php b/version.php
index abcc7913d..a632c865d 100644
--- a/version.php
+++ b/version.php
@@ -13,7 +13,7 @@
* @link http://elgg.org/
*/
- $version = 2008110301; // YYYYMMDD = Elgg Date
+ $version = 2008110601; // YYYYMMDD = Elgg Date
// XX = Interim incrementer
$release = '1.1'; // Human-friendly version name