Closed (fixed)
Project:
Boost
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Feb 2011 at 23:47 UTC
Updated:
3 Jan 2014 at 02:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ChrisLaFrancis commentedRe-rolled patch for latest dev and also -p1.
Comment #2
AlexisWilke commentedI support this patch. PostgreSQL cannot accept anything between DELETE and FROM.
Thank you.
Alexis
Comment #3
bgm commentedI'm not very familiar with the crawler, but it seems to me that the query is trying to delete from the {boost_crawler} table only, and not from the {boost_cache}. (whether it really matters, I don't know)
In pgsql, it might be better to use "delete from ONLY {boost_crawler} ...". c.f. http://www.postgresql.org/docs/8.1/static/sql-delete.html
Also, in your patch, you are changing the mysql statements as well, but that syntax is correct in mysql.
Can you test and re-roll?
Thanks
Comment #4
AlexisWilke commentedbgm,
If you cannot test with PostgreSQL, then you cannot make sure this is [in]correct...
I would be very surprised that the MySQL syntax is necessary. If you look at Drupal Core they never use it anywhere. I don't see why it would be necessary.
Of course, that's not a proof.
Thank you.
Alexis
Comment #5
ChrisLaFrancis commentedI think we can actually accomplish the same effect in a database-independent way by replacing the PostgreSQL USING and the "all others" INNER JOIN with one statement using a sub-select. New patch attached.
On a related note, I don't really understand the logic in the WHERE clause of the SQL statement in the ELSE (line 34 of the patch)... couldn't we just replace that whole WHERE clause with "WHERE ca.expire > 0"?
Comment #6
bgm commentedThanks for the patch, committed to 6.x-1.x. I also found a related issue, for reference: #888816: Postgresql error in reports while prune_tables of the boot_crawler.
As for the conditions on that query, I agree, it makes no sense. From what I understand of this part of code, it would make the crawler restart from zero every time cron is run. I'll leave the issue open (even if it's a tangent issue, but it may not really be a bug) and see if Mike has feedback on this.
(There are plans to rework the crawler by using httprl on a future 6.x-2.x branch, to make the crawler less buggy and the code easier to maintain, but it needs people to step up and work on it.)
@ Alexis: check the MySQL docs. If you "delete from X left join Y", it will delete the resulting entries from both tables. So "delete X from X left join Y" will delete only X. In the examples you provided from Drupal core, all those queries are on only one table. I spend a lot of time in the issue queue, so I appreciate it when other people test and provide clean patches (ideally issues should be RTBC before being committed).
Comment #7
AlexisWilke commentedbgm,
Interesting... another good reason for me not to use MySQL. Although I very rarely find the need to use JOINs anyway. There's often a "better" solution.
PostgreSQL has an ONLY keyword, maybe MySQL would support that? Although it is not use for the exact same purpose. Would need to test to make sure that it works as expected in both DBs.
file:///usr/share/doc/postgresql-doc-8.4/html/sql-delete.html
Thank you for the info! (and for fixing the problem.)
Alexis
Comment #8
bgm commentedClosing issue. Thanks all.