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
Comment #1
merlinofchaos commentedI 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:
So a few extra parens don't seem necessary at all.
I then used Views to reproduce that query:
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.
Comment #2
merlinofchaos commentedBut those extra parens also don't appear to be harmful.
Comment #3
gathu1 commentedThank 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.
Comment #4
gathu1 commentedWhen 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.
Comment #5
merlinofchaos commentedThat 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 ()
Comment #6
gathu1 commentedThanks 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.
Comment #7
merlinofchaos commentedI can't fix delicious issues. Though delicious issues sound nicer than what we really get. =)