summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-08-29 19:17:17 +0000
committerDries Buytaert <dries@buytaert.net>2005-08-29 19:17:17 +0000
commit8ae8865abca6f118808ec56223f6741b8444bbe5 (patch)
treef245d2bf10e7245a21fffca7ebfee924b0bba07b /includes
parent307eefd1ce7216350df835bcd901a4a213b3b3b7 (diff)
downloadbrdo-8ae8865abca6f118808ec56223f6741b8444bbe5.tar.gz
brdo-8ae8865abca6f118808ec56223f6741b8444bbe5.tar.bz2
- Patch #22911 by Cvgbe: fixed table locking in PostgreSQL. You'll have to
use db_lock_table() and db_unlock_tables() for your code to be compatible.
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 9a05b65c7..f29a9b6be 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -232,10 +232,10 @@ function variable_get($name, $default) {
function variable_set($name, $value) {
global $conf;
- db_query('LOCK TABLE {variable} WRITE');
+ db_lock_table('variable');
db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", $name, serialize($value));
- db_query('UNLOCK TABLE');
+ db_unlock_tables();
cache_clear_all('variables');
@@ -321,12 +321,12 @@ function cache_get($key) {
function cache_set($cid, $data, $expire = CACHE_PERMANENT, $headers = NULL) {
$data = db_encode_blob($data);
- db_query('LOCK TABLE {cache} WRITE');
+ db_lock_table('cache');
db_query("UPDATE {cache} SET data = '%s', created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
if (!db_affected_rows()) {
@db_query("INSERT INTO {cache} (cid, data, created, expire, headers) VALUES ('%s', '%s', %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
}
- db_query('UNLOCK TABLE');
+ db_unlock_tables();
}
/**