You seem to be catching wrong query. Dumping SQL for such URL (via posts_request
filter) get me this:
SELECT SQL_CALC_FOUND_ROWS wp_posts.*
FROM wp_posts
INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
INNER JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id)
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (93) AND tt1.term_taxonomy_id IN (94) AND wp_posts.ID IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (93,94)
GROUP BY object_id HAVING COUNT(object_id) = 2
) )
AND wp_posts.post_type="post"
AND (wp_posts.post_status="publish" OR wp_posts.post_status="private")
GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
In any case see WP_Query->get_posts()
method, which handles turning query variables into SQL. There is a lot of code there and a lot of it was changed in 3.1, so it’s a little hard for me to pinpoint where multiple tags are handled.