Bug #15030 Worked in v4, not v5:"ERROR 1054 (42S22): Unknown column 't.ID' in 'on clause'"
Submitted: 17 Nov 2005 19:43 Modified: 17 Nov 2005 19:57
Reporter: David Bernick Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.15 OS:Linux (Fedora Core 4 Linux x86)
Assigned to: CPU Architecture:Any

[17 Nov 2005 19:43] David Bernick
Description:
There was a bug for a similar problem(#13832) but it was with a different version. I'm not so sure this problem has been completely resolved, but I've tried it with the suggested patch and I still have the error.

I have a Mysql 4.0.25 Database where the following works:

select * from  
TaskStatus as ts, 
Task as t, 
Repository as r, 
Source as s, 
SourceType as st, 
TaskType as tt, 
Media as m, 
Shipment as p, 
MediaType as mt  
LEFT JOIN Task_TaskStatus AS tts  ON (tts.taskStatusID = 125.0) AND (tts.taskID=t.ID) WHERE r.ID=t.repositoryID  AND m.mediaTypeID = mt.ID  and tt.ID=t.taskTypeID  and m.ID=t.mediaID  and m.shipmentID=p.ID  and s.ID=t.sourceID  and s.sourceTypeID=st.ID  and ts.ID=t.taskStatusID  and t.ID IN (14965, 14966, 14967, -1)  and t.isDel=0 and t.ID<>1  and r.caseID=2106 limit 1;

In 5.0.15 running this same query gives me this error:
ERROR 1054 (42S22): Unknown column 't.ID' in 'on clause'

I have tried building from source with the patch specified in this article as well as with the LATEST Bitkeeper Source (as of 11/17/05) and this select still throws the Error 1054. Any ideas?

How to repeat:
This query works on 4.0.25, not 5.0.15. Same data. InnoDB. I'm not sure how else to explain it.

select * from  
TaskStatus as ts, 
Task as t, 
Repository as r, 
Source as s, 
SourceType as st, 
TaskType as tt, 
Media as m, 
Shipment as p, 
MediaType as mt  
LEFT JOIN Task_TaskStatus AS tts  ON (tts.taskStatusID = 125.0) AND (tts.taskID=t.ID) WHERE r.ID=t.repositoryID  AND m.mediaTypeID = mt.ID  and tt.ID=t.taskTypeID  and m.ID=t.mediaID  and m.shipmentID=p.ID  and s.ID=t.sourceID  and s.sourceTypeID=st.ID  and ts.ID=t.taskStatusID  and t.ID IN (14965, 14966, 14967, -1)  and t.isDel=0 and t.ID<>1  and r.caseID=2106 limit 1;
[17 Nov 2005 19:57] MySQL Verification Team
Please see bug; http://bugs.mysql.com/bug.php?id=14047

For explanation why it is expected behavior.