PDA

View Full Version : Query errors deleting projects.



submute
Tue 4th Sep '07, 6:08pm
On deleting projects, a few queries throw errors. We're using MySQL 4.0.24. An erroneous query:

DELETE issuenote
FROM pt_issuenote AS issuenote
INNER JOIN pt_issue AS issue ON (issue.issueid = issuenote.issueid)
WHERE issue.projectid = 16

The error:

ERROR 1066: Not unique table/alias: 'issuenote'

Quite a few of the DELETE/INNER JOIN queries result in this kind of error. These tables have not been modified.

Any ideas?

submute
Tue 4th Sep '07, 6:38pm
Answering my own question here a bit: apparently prior to MySQL 4.1, one had to use the full table name in the delete query, e.g.


DELETE pt_issuenote
FROM pt_issuenote AS issuenote
INNER JOIN pt_issue AS issue ON (issue.issueid = issuenote.issueid)
WHERE issue.projectid = 16

Whereas from 4.1 on, the alias should be used.

Odd, but a quick code change. Should upgrade the DB, though.

Mike Sullivan
Wed 5th Sep '07, 5:47am
I attached a patch for this here: http://www.vbulletin.com/forum/project.php?issueid=23024