In drupal 6.2 with img_assist-6.x-1.0-beta1 and postgresql 8.1, I started to get an error when updating. (I didn't store the error, sorry :().
The error was when trying to run the following SQL query:
SELECT * FROM files f INNER JOIN image i WHERE f.fid = i.fid AND i.nid = 10 AND f.filename = '_original';
Which is constructed in _img_assist_remove function inside img_assist.module ($result = db_query("SELECT * FROM {files} f INNER JOIN {image} i WHERE f.fid = i.fid AND i.nid = %d AND f.filename = '%s'", $node->nid, $size['key']);).
The problem is that the SQL select is not properly coded. Should be:
* If you'd like an explicit inner join:
"SELECT * FROM {files} f INNER JOIN {image} i ON f.fid = i.fid AND i.nid = %d AND f.filename = '%s'"
* If you'd like to do it in an implicit way:
"SELECT * FROM {files} f, {image} i WHERE f.fid = i.fid AND i.nid = %d AND f.filename = '%s'"
The problem is that in current version (also in cvs) the query is wrong.
I cannot reproduce it since I did a rollback to drupal 5.7. But I think the bug is pretty isolated :)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | img_assist.module_img_assist_remove.patch | 903 bytes | bursalia2k |
Comments
Comment #1
sunI don't understand what's the actual bug in your report. Would you mind to create a patch? See http://drupal.org/patch/create for further information.
Comment #2
bursalia2k commentedSorry, I was a bit in a hurry at work :( Here you have the patch. Hope will help.
Comment #3
sunLooks good. We should check the other queries, too.
Comment #4
sunCommitted along with some other SQL query fixes.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.