No generalnie jest to brak przywileju do tworzenia tabel tymaczasowych dla danego użytkownika w tej bazie. generalnie wystarczyło by byc może coś w stylu:
mysql>GRANT CREATE TEMPORARY TABLES ON *.* TO 'web75-sveadmin'@*;
Ale, jak nadmieniłeś że chodzi o Drupal, to problem leży też po stronie tegoż systemu a konkretnie dwóch modułów tj.: modules/search.module gdzie kod funkcji do_search trzeba zmienić mniej więcej tak:
<?php
function do_search
($keywords, $type, $join1 = '', $where1 = '1', $arguments1 = array(), $select2 = 'i.relevance AS score', $join2 = '', $arguments2 = array(), $sort_parameters = 'ORDER BY score DESC') { $query = search_parse_query($keywords);
if ($query[2] == '') {
form_set_error
('keys', t
('You must include at least one positive keyword with %count characters or more.', array('%count' => variable_get
('minimum_word_size', 3
)))); }
if ($query === NULL || $query[0] == '' || $query[2] == '') {
}
// First pass: select all possible matching sids, doing a simple index-based OR matching on the keywords.
// 'matches' is used to reject those items that cannot possibly match the query.
$conditions = $where1 .' AND ('. $query[2] .") AND i.type = '%s'";
$result = db_query_temporary("SELECT i.type, i.sid, SUM(i.score * t.count) AS relevance, COUNT(*) AS matches FROM {search_index} i INNER JOIN {search_total} t ON i.word = t
.word $join1 WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d", $arguments, 'temp_search_sids');
// Calculate maximum relevance, to normalize it
$normalize = db_result(db_query('SELECT MAX(relevance) FROM temp_search_sids'.$user->sid));
if (!$normalize) {
}
$select2 = str_replace('i.relevance', '('. (1
.0
/ $normalize) .' * i.relevance)', $select2);
// Second pass: only keep items that match the complicated keywords conditions (phrase search, negative keywords, ...)
$conditions = '('. $query[0] .')';
$result = db_query_temporary("SELECT i.type, i.sid, $select2 FROM temp_search_sids".$user->sid." i INNER JOIN {search_dataset} d ON i.sid = d.sid AND i.type = d.type $join
2 WHERE $conditions $sort_parameters", $arguments, 'temp_search_results');
if (($count = db_result(db_query('SELECT COUNT(*) FROM temp_search_results'.$user->sid))) == 0) {
db_query('DROP TABLE temp_search_results'.$user->sid);
db_query('DROP TABLE temp_search_sids'.$user->sid);
}
$count_query = "SELECT $count";
// Do actual search query
$result = pager_query("SELECT * FROM temp_search_results".$user->sid, 10, 0, $count_query);
while ($item = db_fetch_object($result)) {
$results[] = $item;
}
db_query('DROP TABLE temp_search_results'.$user->sid);
db_query('DROP TABLE temp_search_sids'.$user->sid);
return $results;
}
?>
oraz includes/database.mysql.inc którego zresztą ścieżkę wypluwa przy Twoim zapytaniu. Tam trzeba z kolei zmienić wywołanie funkcji db_query_temporary na następujące:
<?php
function db_query_temporary($query) {
db_query("DROP TABLE IF EXISTS ".$tablename.$user->sid);
$query = preg_replace('/^SELECT/i', 'CREATE TABLE '.$tablename . $user->sid.' SELECT', db_prefix_tables
($query)); if (isset($args[0
]) and
is_array($args[0])) { // 'All arguments in one array' syntax $args = $args[0];
}
_db_query_callback($args, TRUE);
return _db_query($query);
}
?>
Spróbuj, może to coś da. Pozdrówka