That fixed the problem.  Thanks!

On 5/23/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> thats a use case that didnt get tested when i committed 2620, try 2640.
>
> On May 23, 2007, at 2:12 AM, Paul Kippes wrote:
>
> >
> > I have a query that started to fail with r2620.  Here is a portion on
> > the code and the exception that was thrown.  I've tested against the
> > most current revision and that also fails.  Is this something I'm
> > doing wrong or a real bug?  --Thanks, Paul
> >
> > in_sql = sql.select([db.module_inputs.c.signal_id],
> >                           db.module_inputs.c.module_id == m.module_id)
> > out_sql = sql.select([db.module_outputs.c.signal_id],
> >                           db.module_outputs.c.module_id ==
> > m.module_id)
> > select_sql = in_sql.union(out_sql)
> > # Do name ordering using the above select_sql in a subselect
> > signal_list = model.session.query(domain_model.Signal).select(
> >         db.signals.c.signal_id.in_(select_sql),
> >         order_by=[db.signals.c.signal_name])
> >
> >
> > Traceback (most recent call last):
> >   File "tests/test_domain/test_utils.py", line 638, in
> > test_module_signals_order_by_type
> >     domain_utils.TYPE_ORDER)
> >   File "/home/user/appl/scripts/lib/appl/domain/utils.py", line 914,
> > in module_signals
> >     db.signals.c.signal_name])
> >   File "/home/user/.python/sqlalchemy/orm/query.py", line 319, in
> > select
> >     return self.select_whereclause(whereclause=arg, **kwargs)
> >   File "/home/user/.python/sqlalchemy/orm/query.py", line 326, in
> > select_whereclause
> >     return self._select_statement(statement, params=params)
> >   File "/home/user/.python/sqlalchemy/orm/query.py", line 939, in
> > _select_statement
> >     return self.execute(statement, params=params, **kwargs)
> >   File "/home/user/.python/sqlalchemy/orm/query.py", line 843, in
> > execute
> >     result = self.session.execute(self.mapper, clauseelement,
> > params=params)
> >   File "/home/user/.python/sqlalchemy/orm/session.py", line 183, in
> > execute
> >     return self.connection(mapper,
> > close_with_result=True).execute(clause, params, **kwargs)
> >   File "/home/user/.python/sqlalchemy/engine/base.py", line 520, in
> > execute
> >     return Connection.executors[c](self, object, *multiparams,
> > **params)
> >   File "/home/user/.python/sqlalchemy/engine/base.py", line 560, in
> > execute_clauseelement
> >     return self.execute_compiled(elem.compile(dialect=self.dialect,
> > parameters=param), *multiparams, **params)
> >   File "/home/user/.python/sqlalchemy/engine/base.py", line 571, in
> > execute_compiled
> >     self._execute_raw(context)
> >   File "/home/user/.python/sqlalchemy/engine/base.py", line 584, in
> > _execute_raw
> >     self._execute(context)
> >   File "/home/user/.python/sqlalchemy/engine/base.py", line 602, in
> > _execute
> >     raise exceptions.SQLError(context.statement,
> > context.parameters, e)
> > SQLError: (OperationalError) near "SELECT": syntax error u'SELECT
> > signals.signal_type_id AS signals_signal_type_id, signals.signal_id AS
> > signals_signal_id, signals.signal_range AS signals_signal_range,
> > signals.signal_description AS signals_signal_description,
> > signals.signal_name AS signals_signal_name, signals.signal_units_id AS
> > signals_signal_units_id \nFROM signals JOIN signal_types ON
> > signal_types.signal_type_id = signals.signal_type_id \nWHERE
> > signals.signal_id IN SELECT module_inputs.signal_id \nFROM
> > module_inputs \nWHERE module_inputs.module_id = ? UNION SELECT
> > module_outputs.signal_id \nFROM module_outputs \nWHERE
> > module_outputs.module_id = ? ORDER BY
> > signal_types.signal_type_size_order, signals.signal_name' [21, 21]
> >
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to