Closed (fixed)
Project:
Image
Version:
5.x-1.x-dev
Component:
image_attach
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Apr 2007 at 09:24 UTC
Updated:
26 Apr 2007 at 19:16 UTC
Jump to comment: Most recent file
Image_attach.install v 1.1.4.4 2007/03/28 22:30:53 contains in update 20 an EXISTS clause which fails in MySQL 4.0:
DELETE FROM {image_attach} WHERE NOT EXISTS (SELECT * FROM {node} n WHERE n.nid = {image_attach}.iid AND n.type = 'image')
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | image_attach.install_132879_0.patch | 885 bytes | drewish |
| #3 | image_attach.install_132879.patch | 847 bytes | drewish |
Comments
Comment #1
cog.rusty commentedI meant update 2 of course.
Comment #2
drewish commentedit's really not critical because all the query was designed to do was remove old unreferenced records. i'll dig up the mysql 4 docs and try to figure out an equivalent query that is compatible.
Comment #3
drewish commentedOkay so the following should do it:
Please try running that or by applying the attached patch and manually selecting image attach's update #2.
Comment #4
cog.rusty commentedThis time I got a
user warning: Not unique table/alias: 'ia' query: DELETE FROM ia USING image_attach ia LEFT JOIN node n ON ia.iid = n.nid WHERE n.nid IS NULL OR n.type != 'image'After trying a couple of things, what worked was
DELETE FROM {image_attach} USING {image_attach} ia LEFT JOIN {node} n ON ia.iid = n.nid WHERE n.nid IS NULL OR n.type != 'image'Comment #5
drewish commentedcool, i've committed that. thanks for your help.
Comment #6
mathieu commentedI just tried it and I get the following error : "#1109 - Unknown table 'image_attach' in MULTI DELETE". That's using mysql 4.1.
Comment #7
cog.rusty commentedCrap... look at this Note:
http://dev.mysql.com/doc/refman/4.1/en/delete.html
This is getting ugly...
Comment #8
cog.rusty commentedI tried completely removing the ia alias on MySQL 4.0 and forced update 2 and it worked ok.
DELETE FROM {image_attach} USING {image_attach} LEFT JOIN {node} n ON {image_attach}.iid = n.nid WHERE n.nid IS NULL OR n.type != 'image'Can you try it on MySQL 4.1?
Comment #9
cog.rusty commentedI also tested on a local MySQL 5. It seems to work.
Comment #10
drewish commentedcan anyone else test out this patch?
Comment #11
drewish commentedcommitted to HEAD and 5
Comment #12
(not verified) commented