On Wed, May 02, 2007 at 07:35:22PM +0400, Oleg Broytmann wrote:
> On Wed, May 02, 2007 at 12:25:13PM -0300, Claudio Martinez wrote:
> > It may be a bug, because the Aliased table behaves differently.
> 
>    Yes, a bug. DBConnection._fixTablesForJoins() doesn't remove aliases
> from the list of tables. I have to think about the fix. Thank you for
> helping me to understand the issue..

   Found the bug - it is in sqlbuilder.py. It adds excessive " AS " to the
names of the aliases.
   I'd like to ask you to test the attached patch. If you cannot apply the
patch but still is willing to help to test it - I will send you the entire
sqlbuilder.py.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.
Index: sqlbuilder.py
===================================================================
--- sqlbuilder.py       (revision 2623)
+++ sqlbuilder.py       (working copy)
@@ -733,12 +733,12 @@
     def __init__(self, table1, table2, op=','):
         if table1 and type(table1) <> str:
             if isinstance(table1, Alias):
-                table1 = "%s AS %s" % (table1.q.tableName, table1.q.alias)
+                table1 = "%s %s %s" % (table1.q.tableName, 
AliasField.as_string, table1.q.alias)
             else:
                 table1 = table1.sqlmeta.table
         if type(table2) <> str:
             if isinstance(table2, Alias):
-                table2 = "%s AS %s" % (table2.q.tableName, table2.q.alias)
+                table2 = "%s %s %s" % (table2.q.tableName, 
AliasField.as_string, table2.q.alias)
             else:
                 table2 = table2.sqlmeta.table
         self.table1 = table1
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to