In example my current query looks like:

SELECT node.title AS node_title, node.nid AS nid FROM node node  INNER JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND (flag_content_node.fid = 4 AND flag_content_node.uid = ***CURRENT_USER*** AND flag_content_node.sid = ***FLAG_CURRENT_USER_SID***) WHERE (node.status = 1 OR (node.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1) AND (node.type in ('ckan_package'))

There are too many variables used like: CURRENT_USER, ADMINISTER_NODES, FLAG_CURRENT_USER_SID, etc. (sometimes even more)
What's sense to have this query if I can't use it by copying and pasting it into my sql browser to debug it. For sure nobody wants to read them, especially if they are sometimes 20 lines long or more.
My proposition is to include values of those variables above (as separate row), or in the brackets, like:
uid = 1 (***CURRENT_USER***) OR uid = ***CURRENT_USER*** (1)

Comments

Letharion’s picture

If you want to debug it, then maybe there could even be a link, that when clicked, replaces the variables with their values.
Probably a low priority task though.
@dereine, what do you think?

Letharion’s picture

Assigned: Unassigned » dawehner
dawehner’s picture

Assigned: dawehner » Unassigned

Views in drupal7 already replaces this values, because of the technique they are implemented.

In general i like the feature, that they get replaced in the query, so much easier to paste them into sql.
Shouldn't be ultra hard to do it.

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)