Here is the SQL query that I found for the "contains all words" filter that I'm using for a del.ici.ous link. The query is not working and the problem seems to be that the outer brackets for the WHERE statement below seems to be missing. It should be:
WHERE ((delicious_tag.name) LIKE ('%scientific-research%') AND (delicious_tag.name) LIKE ('%skills-development%'))

But right now, it is:

SELECT DISTINCT(delicious_link.lid) AS lid,
delicious_link.description AS delicious_link_description,
delicious_link.href AS delicious_link_href,
delicious_link.extended AS delicious_link_extended,
delicious_link.linktime AS delicious_link_linktime
FROM delicious_link delicious_link
LEFT JOIN delicious_tag delicious_tag ON delicious_link.lid = delicious_tag.lid
WHERE (delicious_tag.name) LIKE ('%scientific-research%') AND (delicious_tag.name) LIKE ('%skills-development%')

This seems to be an easy fix, so, your immediate attention is greatly appreciated.
Thanks a lot

Comments

merlinofchaos’s picture

I don't see how those outer parens are necessary in that query.

I ran this query on my test database which is full of lorem ipsum:

 select title from node_revisions where body like '%qui%' and body like '%lior%';

So a few extra parens don't seem necessary at all.

I then used Views to reproduce that query:

SELECT node.nid AS nid,
   node.title AS node_title
 FROM node node 
 LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
 WHERE (node_revisions.body) LIKE ('%qui%') AND (node_revisions.body) LIKE ('%lior%')

And it produced the same results.

Maybe there's a bug in your version of mysql or something. To be honest, there's some extra parens in there that don't make sense. I've no idea why they would be there.

merlinofchaos’s picture

But those extra parens also don't appear to be harmful.

gathu1’s picture

Thank you for your comments.
The queries that it generated for the other Views filters seemed to have that extra parenthesis. So, I thought, it might help. Is there any way I could add those parens and try?
Any other ideas on what I can try?
I'm new to drupal and databases. So, any ideas could help.
Thanks again.

gathu1’s picture

When I run the same view query, using the "Page" type rather than the "Block" type that I used earlier, it is also showing the following SQL query error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT dt.name, dt.lid FROM delicious_tag dt WHERE dt.lid IN () in /home/content/g/a/t/gathu1/html/modules/delicious/includes/delicious_views_handler_field_tag.inc on line 25.

Any idea, what I should do? Thanks.

merlinofchaos’s picture

That last query doesn't look like a Views query. In any case, it's failing because the IN is empty. You can't have IN ()

gathu1’s picture

Thanks for your help. You are right. There is something wrong in the delicious module. I used feedapi module to import the delicious bookmarks into nodes and setup another view with the nodes. The "contains all" logic worked fine.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

I can't fix delicious issues. Though delicious issues sound nicer than what we really get. =)