Re: possible change/bug in NOT NULL?
Russ Tyndall <[email protected]> Tue, 13 Dec 2011 09:07:18 -0500
| Newsgroups | gmane.lisp.clsql.general |
|---|---|
| Message-ID | <[email protected]> |
Clsql 6 refactored much of the sql output layer to be more consistent
with its quoting. This operation must have gotten missed; I think
that I had always been testing and using things like:
(clsql-sys::sql [not [null 'foo]])
as opposed to:
(clsql-sys::sql [is 'foo [not-null]]) (currently fails)
This also works currently:
(clsql-sys::sql [not [is 'foo 'null]])
I have a patch set to fix this that I will try to get pushed up soon.
With this patch in place:
(clsql-sys::sql [and [not-null [foo.bar]] [is [foo.bar] [not-null]]])
returns what I believe are the expected results:
"((FOO.BAR IS NOT NULL) AND (FOO.BAR IS NOT NULL))"
Also your expression:
(clsql-sys::sql-output
(clsql:sql-operation 'is
(clsql:sql-expression :table "xtable" :attribute "yval")
(clsql:sql-operation 'not-null)))
outputs correctly with the patch applied:
"(\"xtable\".\"yval\" IS NOT NULL)".
Thanks for your bug report,
Russ Tyndall
Acceleration.net
On 12/13/2011 4:46 AM, JTK wrote:
>
> In my previous version of clsql 5.1.3 the following:
>
> (clsql-sys::sql-output (clsql:sql-operation 'is (clsql:sql-expression :table "xtable" :attribute "yval") (clsql:sql-operation 'not-null)))
>
> evaluates to
>
> => "(\"xtable\".\"yval\" IS NOT NULL)"
>
> But in the latest one I downloaded (clsql 6.0.1), it gives
>
>
> => "(\"xtable\".\"yval\" IS \"NOT NULL\")" ;; note quotes around "NOT NULL"
>
> This seems to be invalid sql syntax, judging from a failed query.
>
> Apologies if I'm missing something.
>
> J.Klein
>
>
>
>
> _______________________________________________
> CLSQL mailing list
> [email protected]
> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql