Commit 1c83d517 authored by Dries's avatar Dries
Browse files

- Patch by Adrian: postgresql fixes

parent fa40f244
......@@ -573,7 +573,7 @@ CREATE INDEX search_index_word_idx ON search_index(word);
CREATE TABLE search_total (
word varchar(50) NOT NULL default '',
count integer default NULL
count float default NULL
);
CREATE INDEX search_total_word_idx ON search_total(word);
......@@ -794,10 +794,10 @@ INSERT INTO variable(name,value) VALUES('theme_default','s:10:"bluemarine";');
INSERT INTO users(uid,name,mail) VALUES(0,'','');
INSERT INTO users_roles(uid,rid) VALUES(0, 1);
INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
INSERT INTO role (name) VALUES ('anonymous user');
INSERT INTO permission VALUES (1,'access content',0);
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
INSERT INTO role (name) VALUES ('authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
INSERT INTO blocks(module,delta,status) VALUES('user', 0, 1);
......
......@@ -107,7 +107,8 @@
"2005-03-21" => "update_128",
"2005-04-08: first update since Drupal 4.6.0 release" => "update_129",
"2005-04-10" => "update_130",
"2005-04-11" => "update_131"
"2005-04-11" => "update_131",
"2005-04-14" => "update_132"
);
function update_32() {
......@@ -2329,17 +2330,6 @@ function update_127() {
return $ret;
}
function update_sql($sql) {
$edit = $_POST["edit"];
$result = db_query($sql);
if ($result) {
return array('1', nl2br(htmlentities($sql)) ." ", "<div style=\"color: green;\">OK</div>\n");
}
else {
return array('0', nl2br(htmlentities($sql)) ." ", "<div style=\"color: red;\">FAILED</div>\n");
}
}
function update_128() {
$ret = array();
......@@ -2391,4 +2381,28 @@ function update_131() {
return $ret;
}
function update_132() {
/**
* PostgreSQL only update.
*/
$ret = array();
if ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql('DROP TABLE {search_total}');
$ret[] = update_sql("CREATE TABLE {search_total} (
word varchar(50) NOT NULL default '',
count float default NULL)");
$ret[] = update_sql('CREATE INDEX {search_total}_word_idx ON {search_total}(word)');
/**
* Wipe the search index
*/
include_once('modules/search.module');
search_wipe();
}
return $ret;
}
?>
......@@ -283,7 +283,7 @@ function statistics_top_users() {
array('data' => t('User'), 'field' => 'u.name'),
);
$sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid". tablesort_sql($header);
$sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid, u.name". tablesort_sql($header);
$sql_cnt = "SELECT COUNT(DISTINCT(uid)) FROM {accesslog}";
$result = pager_query($sql, 30, 0, $sql_cnt);
......
......@@ -283,7 +283,7 @@ function statistics_top_users() {
array('data' => t('User'), 'field' => 'u.name'),
);
$sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid". tablesort_sql($header);
$sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.uid, u.name". tablesort_sql($header);
$sql_cnt = "SELECT COUNT(DISTINCT(uid)) FROM {accesslog}";
$result = pager_query($sql, 30, 0, $sql_cnt);
......
......@@ -130,9 +130,8 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function taxonomy_save_vocabulary($edit) {
if (!$edit['nodes']) {
$edit['nodes'] = array();
}
$edit['nodes'] = ($edit['nodes']) ? $edit['nodes'] : array();
$edit['weight'] = ($edit['weight']) ? $edit['weight'] : 0;
$data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'tags' => $edit['tags'], 'weight' => $edit['weight'], 'module' => isset($edit['module']) ? $edit['module'] : 'taxonomy');
if ($edit['vid'] && $edit['name']) {
......
......@@ -130,9 +130,8 @@ function taxonomy_form_vocabulary($edit = array()) {
}
function taxonomy_save_vocabulary($edit) {
if (!$edit['nodes']) {
$edit['nodes'] = array();
}
$edit['nodes'] = ($edit['nodes']) ? $edit['nodes'] : array();
$edit['weight'] = ($edit['weight']) ? $edit['weight'] : 0;
$data = array('name' => $edit['name'], 'description' => $edit['description'], 'help' => $edit['help'], 'multiple' => $edit['multiple'], 'required' => $edit['required'], 'hierarchy' => $edit['hierarchy'], 'relations' => $edit['relations'], 'tags' => $edit['tags'], 'weight' => $edit['weight'], 'module' => isset($edit['module']) ? $edit['module'] : 'taxonomy');
if ($edit['vid'] && $edit['name']) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment