I get the following warning when trying to do a search using facets.

user warning: Table 'temp_faceted_search_results_4' already exists query: CREATE TEMPORARY TABLE temp_faceted_search_results_4 (nid int unsigned NOT NULL, PRIMARY KEY (nid)) Engine=HEAP SELECT n.nid AS nid, 5 * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp)) - 1356072803) * 6.43e-8) + 5 * (2.0 - 2.0 / (1.0 + MAX(c.comment_count) * 1)) AS score FROM d6_node AS n INNER JOIN d6_term_node AS term_node_542 ON n.nid = term_node_542.nid LEFT JOIN d6_node_comment_statistics AS c ON n.nid = c.nid WHERE (n.language ='el' OR n.language ='' OR n.language IS NULL) AND ( ((n.status = 1) AND (n.type IN ('accessory')) AND (term_node_542.tid = 542)) AND n.nid IN (SELECT node.nid AS nid FROM d6_node node LEFT JOIN d6_content_field_partno node_data_field_partno ON node.vid = node_data_field_partno.vid LEFT JOIN d6_uc_products uc_products ON node.vid = uc_products.vid WHERE node.type in ('accessory') ) )GROUP BY n.nid ASC ORDER BY score DESC in /public_html/sites/all/modules/faceted_search/faceted_search.inc on line 1174.

It used to work fine but after some upgrades it has stopped working.
The only solution I could think of was to add

db_query('DROP TEMPORARY TABLE IF EXISTS '. $this->_results_table .'');

before the CREATE TABLE statement.
Any thoughts on that would be very helpful.
Thanks

Comments

miraclegr’s picture

Status: Active » Fixed

Finally found the solution.

I was using the faceted search block of the environment into a mini panels menu.
Once I removed it, all went well.

Maybe the block was initializing the environment and was creating the temporary table before the user performed any search through the facets.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.