Re: Fwd: Re: [Modeling-users] ec.fetch and SQL "in"
Status: Abandoned
Brought to you by:
sbigaret
From: Yannick G. <yan...@sa...> - 2003-07-08 18:13:32
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 8, 2003 01:42 pm, Yannick Gingras wrote: > Argh, I think we have a problem when there is only one elem in the > choice list : > > <Fault 1: 'Modeling.Adaptor.GeneralAdaptorException:Couldn\'t evaluate > expression SELECT t0.id, t0.gl_id, t0.fs2_id FROM FSLINK t0 WHERE > (t0.fs2_id NOT IN (4,) AND t0.gl_id LIKE 1). Reason: > _mysql_exceptions.ProgrammingError:(1064, "You have an error in your SQL > syntax near \') AND t0.gl_id LIKE 1)\' at line 1")'> > > I don't think that : "NOT IN (4,)" is legal... I don't know if it's where the test should go but the following patch fix the problem : =2D --- SQLExpression.old.py 2003-07-08 13:47:22.000000000 -0400 +++ SQLExpression.py 2003-07-08 14:08:58.000000000 -0400 @@ -1235,7 +1235,10 @@ See also: formatValueForAttribute() """ if aNumber is not None: =2D - return str(aNumber) + if type(aNumber) =3D=3D type((1,)) and len(aNumber) =3D=3D 1: + return "(%d)" % aNumber + else: + return str(aNumber) else: return 'NULL' def sqlStringForQualifier(self, aQualifier): =2D --=20 Yannick Gingras Byte Gardener, Savoir-faire Linux inc. (514) 276-5468 =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/CwnKrhy5Fqn/MRARAkczAJ47nHXmbSmCKeJ3oSbWU6fIW43VKgCfaw/h vgAAZO7sMF9YCjqWcJGYZU8=3D =3DyXzC =2D----END PGP SIGNATURE----- |