Patches item #1516675, was opened at 2006-07-04 01:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1516675&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Pau Aliagas (linux4u)
Assigned to: Nobody/Anonymous (nobody)
Summary: multiple left join fix
Initial Comment:
I having problems trying to create a query with two
left joins as only one allows having the left table
specified, the rest have to be None, otherwise it
generates invalid SQL.
The theory is that if you don't specify the left table,
it joins agains the first table defined. In this case
you don't need a comma before the left join.
But if you want to define both tables (the recommended
procedure), you need a leading comma.
As it is now, you cannot mix them:
if tables and join[0].table1:
join_str = ", "
else:
join_str = ' '
join_str += " ".join([self.sqlrepr(j) for j
in join])
As I propose, every joind is treated individually:
join_str = ""
for j in join:
if tables and j.table1:
sep = ", "
else:
sep = ' '
join_str += sep + self.sqlrepr(j)
I attach the patch. I posted it in the mailing lisrt
without any reposnse.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1516675&group_id=74338
|