Unusual text inserted in the SQL I am getting some unusual text which is getting added to my queries in views. I am referring to the part setting view_name.

SELECT users.name AS users_name, users.uid AS uid, 'cardinality_user_test:page' AS view_name
FROM 
{users} users
LEFT JOIN {node} node_users ON (SELECT nodeINNER.nid AS nidINNER, ':default' AS view_name
FROM 
{node} node INNER LEFT JOIN {users} users_nodeINNER ON nodeINNER.uid = users_nodeINNER.uid
WHERE (( (users_nodeINNER.uid = users.uid ) ))
ORDER BY nodeINNER.nid DESC
LIMIT 1 OFFSET 0) = node_users.nid
LIMIT 10 OFFSET 0


This additional SQL is creating an error: 


  SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 2 column(s)


What is causing that text to be added in Drupal 7?
That extra field is added from the Views module itself, in particular its views_plugin_query_default::add_signature() method, which is described as:


  Add a signature to the query, if such a thing is feasible.
  This signature is something that can be used when perusing query logs to discern where particular queries might be coming from.


If you look at its code, it is setting the view_name field.

function add_signature(&amp;$view) {
  $view-&gt;query-&gt;add_field(NULL, "'" . $view-&gt;name . ':' . $view-&gt;current_display . "'", 'view_name');
}