This may be a design choice, but newertheless it makes the search feature unavailable to some. Below are the errors logged when I tried search on my site, http://oldrup.dk/drupaltest/?q=search/node
user warning: Access denied for user: 'web34197@%' to database 'web34197' query: CREATE TEMPORARY TABLE temp_search_sids 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 INNER JOIN node n ON n.nid = i.sid INNER JOIN users u ON n.uid = u.uid WHERE n.status = 1 AND (i.word = 'small') AND i.type = 'node' GROUP BY i.type, i.sid HAVING COUNT(*) >= 1 in /usr/home/web/web34197/drupaltest/includes/database.mysql.inc on line 108.
user warning: Table 'web34197.temp_search_sids' doesn't exist query: SELECT MAX(relevance) FROM temp_search_sids in /usr/home/web/web34197/drupaltest/includes/database.mysql.inc on line 108.
Seem that my hoster (web10.dk) doesn't allow CREATE TEMPORARY TABLE - don't know if that is normal.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | search.module_7.patch | 2.26 KB | paddy_deburca |
Comments
Comment #1
Thox commentedSome hosters allow temp tables as long as they are prefixed with the hosting account username. Prefixing might be worth looking in to.
Comment #2
netbjarne commentedI have filed a support request at my webhost asking if prefixing is a sollution they support.
Not being a sql expert; is it possible to modify/hack the search code to use "regular" tables instead of temporary tables, or would this be a bad design choice? - If hintet in the right direction, I'd be glad to experiment with an alternate sollution.
Best regards
Bjarne
Comment #3
moshe weitzman commentedComment #4
netbjarne commentedGot reply from host today. Sadly they do not grant the CREATE TEMPORARY TABLE right, nor do they support the prefixing approach.
Sadly, this prohibits me from using the search feature of Drupal. Any recommendations for a workaround?
Comment #5
killes@www.drop.org commentedtwo possible solutions:
1) change hosters
2) use the trip_search module instead. It has some shortcomings, but is probably better than no search at all.
Comment #6
netbjarne commentedI've found another host, surftown.dk, offering approx the same services at the same low price as my current host, web10.dk, and that apparently supports both create temporary table and lock table rights. So I purchased a webhotel there, and until now it looks good - users can post and search pages w/o any problems...
the trip_search module I'll will save for a project that doesn't permits a host change.
Thank you all for your replies :-)
Bjarne
Comment #7
luebbe commentedThe two options mentioned by killes do not really work for me.
1) I don't want to change my hoster, because I'm happy with everything else they offer.
2) The trip_search maintainers say they want to discontinue the module due to the improvements in 4.7 core search.
So what? Not everyone has the funds for a more expensive web hoster or an own server.
Drupal 4.7 is getting a really frustrating experience for me. I can work around the LOCK TABLE restriction, because my website is low traffic and simultaneous write accesses are rarely going to hit me, but I can't work around the safe_mode and CREATE TEMPORARY TABLE restrictions :-(
Why can't drupal give a good user experience in a restricted hosting environment?
Comment #8
paddy_deburca commentedTo solve this problem, I have done the following
What needs to be done
the idea here is to add a cron hook that wipes both tables clean on a regular basis
If anybody is interested I can provide a patch against the search module.
Paddy.
Comment #9
paddy_deburca commentedTo solve this problem with the attached patch, you need to create the two temporary tables
and
Apply the attached patch, and enjoy searching
Paddy.
Comment #10
Treesong commentedIt works! Thanks for the help. And for people like me who didn't know how to apply patches, here are two articles worth checking out:
HOWTO: Apply patches
http://drupal.org/node/60108
how to manually apply patches?
http://drupal.org/node/34422
I used the manual method described and it worked well for me.
Comment #11
cybe commentedThanks for the patch. It allowed me to update my site from 4.6 to 4.7.
It works, but only briefly. After a while any search, "qwertyasdfqweasd" for isntance, will result in a huge list of nodes (that do not contain the searched word, until I truncate the temporary search tables..
Looking forward to getting this fixed. Meanwhile I guess I'll leave a a script looping that truncates the temporary tables every ... 10 seconds or so =(.
Comment #12
nick1@neoforts.com commentedI am with godaddy hosting. My site www.neoforts.com was recently converted to Drupal. Our search is fully indexed and does not work with search because of this issue. I will contact godaddy to see if they can help me resolve this issue.
If godaddy does not support this right??? what should i do??
Comment #13
Crell commented1) Get a real web host.
2) Use GoogleSearch.