Difference between query for admin vs other users

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by dougm on June 23, 2010 at 7:31pm

I'm working with Views (Drupal 6.x) and having a problem. The view works great when run as the admin user, but mysql blows up when it is run as any other user. I can reproduce it directly in mysql if I copy the query into mysql and run it directly. What has me baffled is that I don't get a problem when I run as the admin user. (user 1). I don't have any permissions set that might change the query, but there is obviously something different in the two queries. Any idea how I can see the difference and then make Views use the same query regardless of the user?

Thanks,
Doug

Comments

The URL to see the "problem"

Posted by dougm on June 23, 2010 at 7:33pm

The URL to see the "problem" is http://didea.3acres.org/Colors

The reason it works for user

Posted by Scott Reynolds on June 23, 2010 at 9:42pm

The reason it works for user 1 is user 1 doesn't have node access applied (via og ??). This is a common issue with the DISTINCT, make sure you are running the latest Views.

I was using the latest Views

Posted by dougm on June 23, 2010 at 10:46pm

I was using the latest Views (and not using OG although it is installed). I also tried the 6.x-3.0 alpha 3.
I'll try eliminating OG and see if that helps.

Ok, disabling OG resolved the

Posted by dougm on June 23, 2010 at 10:49pm

Ok, disabling OG resolved the problem. Is there some aspect of OG that causes this that I could leave out but still use the groups?

Removing OG resolved the

Posted by dougm on June 23, 2010 at 11:21pm

Removing OG resolved the problem with DISTINCT, but now there is a new problem. If I expose "filters" to allow a user to select what he/she wants, I get a new failure. Again, this doesn't affect user 1.

user warning: Lost connection to MySQL server during query query: SELECT node_data_field_brand.field_brand_nid AS node_data_field_brand_field_brand_nid, node.nid AS nid, node.type AS node_type, node.vid AS node_vid, node_data_field_availstatus.field_availstatus_value AS node_data_field_availstatus_field_availstatus_value, node.title AS node_title, node_data_field_availstatus.field_color_id_value AS node_data_field_availstatus_field_color_id_value FROM node node INNER JOIN content_type_color_sample node_data_field_brand ON node.vid = node_data_field_brand.vid LEFT JOIN content_type_color_sample node_data_field_availstatus ON node.vid = node_data_field_availstatus.vid LEFT JOIN node modr_n ON node.nid = modr_n.nid WHERE ((modr_n.moderate != 1)) AND ( (node.type in ('color_sample')) AND (node_data_field_brand.field_brand_nid IN ('65', '62', '60', '155')) )ORDER BY node_title ASC in /var/apache2/2.2/htdocs/3acres/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1096.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /