I've moved our multisite installed 4.6.4 sites over to a new server and upgraded to 4.6.5.
I am getting a lot of these errors:
Column 'nid' in from clause is ambiguous query: SELECT DISTINCT(n.nid), n.title, n.type, n.status, n.moderate, e.event_start FROM node n INNER JOIN node_access na ON na.nid = n.nid INNER JOIN event e USING (nid) WHERE (na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0','node_privacy_byrole_role1','node_privacy_byrole_user0')) AND n.status = 1 AND n.moderate = 0 AND e.event_start >= 1138925260 ORDER BY event_start LIMIT 0, 6 in
/path/to/my/includes/database.mysql.inc
Here's another one:
Unknown column 'n.nid' in 'on clause' query: SELECT t.tid, COUNT(DISTINCT(n.nid)) AS c FROM term_node t INNER JOIN node_access na ON na.nid = n.nid INNER JOIN node n ON t.nid = n.nid WHERE (na.grant_view = 1 AND CONCAT(na.realm, na.gid) IN ('all0','node_privacy_byrole_role1','node_privacy_byrole_user0')) AND n.status = 1 GROUP BY t.tid in /path/to/my/includes/database.mysql.inc
Out of 6 installations of Drupal that got moved there is only one site that is having problems. Initially I thought that I forgot to import part of the database. Then I imported the database in little sections and made sure there were no errors. This didn't help at all.
From what I've gathered so far a non-core module is creating these errors. I went and turned off all non-core modules and watched the error log as I enabled one at a time. This method seemed to be working, but there is a problem with it; the errors are usually a long time apart where one or two will occur and then nothing happens for a 1/2 an hour or so. I would suspect it relates to visitors on the site.
I enabled one module at a time for a while and then stopped because I thought that the modules might have uploaded with the wrong permissions. I went to my modules directory and did a chmod 755 to each module. I thought that fixed it, since the errors stopped for a while, but during the night the errors started occuring again with periods of intense error generation.
Does anyone have any experience with this sort of error? I'm going back to enabling one module at a time and trying to figure it out, but I was hoping someone else might have discovered this before.
I'll post the results from my first trial and what modules i'm using, though I have dental surgery later and might not be able to until tomorrow.
Comments
Node_Privacy_Byrole
From trial and error I figured it out it's the Node Privacy By Role : module, and there is a bug already posted:
http://drupal.org/project/node_privacy_byrole
http://drupal.org/node/40623
It's a MySQL 5 problem