[Sqlalchemy-tickets] Issue #3280: bug with JOIN precedence (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: yoch <iss...@bi...> - 2014-12-22 17:40:28
|
New issue 3280: bug with JOIN precedence https://bitbucket.org/zzzeek/sqlalchemy/issue/3280/bug-with-join-precedence yoch: Hi, I wrote this code in python : db.query(A, B, C).\ filter(func.coalesce(A.idB,A.idC)==B.id).\ outerjoin(C, C.id==B.id).\ all() And it cause an strange error: (1054, "Unknown column 'A.id' in 'on clause'") This happens because the produced SQL code looks like : SELECT A.*, B.*, C.* FROM B, A LEFT OUTER JOIN C ON C.id = B.id WHERE coalesce(A.idB, A.idC) = B.id; And this code is broken, because it mix commas joins withs others types of joins, and this lead an error. http://stackoverflow.com/questions/10483421/mysql-unknown-column-in-on-clause |