On 6/30/06 7:45 PM, Glenn Gallien wrote:
> DBD::mysql::st execute failed: Unknown column 't2.id' in 'on clause' at
> /usr/local/lib/perl5/site_perl/5.8.8/Rose/DB/Object/Manager.pm line 1435
> [...]
> The sql that causes the error looks like this.
> ...
> FROM projects t1
> LEFT OUTER JOIN user_permissions t3 ON(t3.object_id = t2.id)
> LEFT JOIN users t4 ON(t3.user_id = t4.id)
> LEFT OUTER JOIN group_permissions t5 ON(t5.object_id = t2.id)
> LEFT JOIN groups t6 ON(t5.group_id = t6.id),
> objects t2       
> <--- this seems to be the problem
> WHERE ...

Hm, what version of MySQL are you using?  I just tried this query and it
worked for me.  Here's the schema and query:

---

CREATE TABLE projects
(
  id INT AUTO_INCREMENT PRIMARY KEY
);

create table objects
(
  id INT AUTO_INCREMENT PRIMARY KEY
);

create table users
(
  id INT AUTO_INCREMENT PRIMARY KEY
);

CREATE TABLE groups
(
  id INT AUTO_INCREMENT PRIMARY KEY
);

CREATE TABLE user_permissions
(
  id        INT AUTO_INCREMENT PRIMARY KEY,
  object_id INT REFERENCES objects (id),
  user_id   INT REFERENCES users (id),
  group_id  INT REFERENCES groups (id)
);

CREATE TABLE group_permissions
(
  id        INT AUTO_INCREMENT PRIMARY KEY,
  object_id INT REFERENCES objects (id),
  group_id  INT REFERENCES groups (id)
);

SELECT * FROM 
projects t1
LEFT OUTER JOIN user_permissions t3 ON(t3.object_id = t2.id)
LEFT JOIN users t4 ON(t3.user_id = t4.id)
LEFT OUTER JOIN group_permissions t5 ON(t5.object_id = t2.id)
LEFT JOIN groups t6 ON(t5.group_id = t6.id),
objects t2;

---

I'm using MySQL 4.0.25.

-John



Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to