The query way[a|b=c|d][bbox=Z] generates the where clause WHERE ( tags @> hstore($1, $2)) OR ( tags @> hstore($3, $4)) OR ( tags @> hstore($5, $6)) OR ( tags @> hstore($7, $8)) AND linestring && $9
This should instead be WHERE (( tags @> hstore($1, $2)) OR ( tags @> hstore($3, $4)) OR ( tags @> hstore($5, $6)) OR ( tags @> hstore($7, $8))) AND linestring && $9, with () wrapping the conditions generated by [a|b=c|d]
The query
way[a|b=c|d][bbox=Z]
generates the where clauseWHERE ( tags @> hstore($1, $2)) OR ( tags @> hstore($3, $4)) OR ( tags @> hstore($5, $6)) OR ( tags @> hstore($7, $8)) AND linestring && $9
This should instead be
WHERE (( tags @> hstore($1, $2)) OR ( tags @> hstore($3, $4)) OR ( tags @> hstore($5, $6)) OR ( tags @> hstore($7, $8))) AND linestring && $9
, with () wrapping the conditions generated by[a|b=c|d]