Closed (duplicate)
Project:
Apache Solr Search
Version:
6.x-2.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Sep 2010 at 16:03 UTC
Updated:
14 Feb 2011 at 03:09 UTC
In Mysql version: 5.0.47 the query:
db_query("DELETE FROM {apachesolr_search_node} USING {apachesolr_search_node} asn INNER JOIN {node} n ON asn.nid = n.nid WHERE n.type = '%s'", $type);
Causes the error:
WD php: Unknown table 'apachesolr_search_node' in MULTI DELETE
The issue is that using the alias for apachesolr_search_node means that mysql can no longer recognise the table to delete. Rewriting the query without the aliases as:
db_query("DELETE FROM {apachesolr_search_node} USING {apachesolr_search_node} INNER JOIN {node} ON apachesolr_search_node.nid = node.nid WHERE node.type = '%s'", $type);
Fixes the problem. Patch supplied.
| Comment | File | Size | Author |
|---|---|---|---|
| apachesolr_rebuild_index_table_mysql.patch | 752 bytes | theapi |
Comments
Comment #1
jpmckinney commentedMarking duplicate of #592522: Hooks node_type, taxonomy and user knocks out our database server so that we can correct this bug in that issue.
Comment #2
jpmckinney commentedNote that we need to use table aliases in case someone configures Drupal with table prefixes, so the current patch won't work in all configurations.