(Drupal 4.6.8)
After I made some changes to some of the categories/taxonomy on my site, I started getting database errors whenever I try to administer content (admin/node):
Not unique table/alias: 'tn'
query: SELECT COUNT(*) FROM drupal_node n INNER JOIN drupal_term_node tn ON n.nid = tn.nidINNER JOIN drupal_term_node tn ON n.nid = tn.nid INNER JOIN user u ON n.uid = u.userid WHERE tn.tid = 39 AND tn.tid = 20
If I run the query manually, I'll get an error:
SELECT COUNT( * )
FROM drupal_node n
INNER JOIN drupal_term_node tn ON n.nid = tn.nid
INNER JOIN drupal_term_node tn ON n.nid = tn.nid
INNER JOIN user u ON n.uid = u.userid
WHERE tn.tid =39
AND tn.tid =20
LIMIT 0 , 170
MySQL said: Documentation
#1066 - Not unique table/alias: 'tn'
However, if I remove that second "inner join" query, there's no error.
SELECT COUNT( * )
FROM drupal_node n
INNER JOIN drupal_term_node tn ON n.nid = tn.nid
INNER JOIN user u ON n.uid = u.userid
WHERE tn.tid =39
AND tn.tid =20
LIMIT 0 , 170
Repairing and optimizing tables didn't fix the error. There are no messages about this error on drupal.org, and Googling produced no results.
So, what's causing the second "inner join" to happen? Why did it begin only after I altered the taxonomy? What's the ultimate fix?