I think everyone agrees that SQLite does not strictly follow the SQL standards 
for WHERE clause expressions.

The question is... should it?  One must ask, "what makes SQLite lite?"  I think 
this kind of simplification is of them.  However, I can understand that it 
might rankle some people.  Coming from a C background, when I see that SELECT 1 
WHERE 1-1 compiles and treats 1-1 as FALSE, I can work with that.  

Heavens knows the number of times I've been caught by using a single '=' or 
tacking on a spare ';' on the end of while statement.  And it irritated me that 
the language even allowed it.  (Of course, the language DID allow it, so I have 
no right to complain.)

So, since this is an SQL system designed to cut corners but still get the basic 
job done, I really have to ask why there's an argument at all on this topic?  
Both sides are right.   Yes, SQLite accepts queries that go against SQL 
standard.  Yes, if your query is formatted correctly, it executes correctly, so 
the fact that it takes a non-standard query is still an error on the 
programmer's part, even if SQLite didn't flag it.  At least it does have rules 
on how those are handled.

Marc

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Petite Abeille
Sent: Monday, May 05, 2014 2:46 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] select 1 where 1 - 1;


On May 5, 2014, at 8:21 PM, RSmith <rsm...@rsweb.co.za> wrote:

> the idea that introducing more complication will make erros/bugs less is just 
> false.

Straw man argument, unrelated to the topic at hand.

This is solely about the SQL parser failing short of reporting syntax errors 
for nonsensical queries.

select 1 where null;

select 1 where is null;
Error: near "is": syntax error

select 1 where not null;

select 1 where is not null;
Error: near "is": syntax error

select 1 where not( not null);

elect 1 where not( is null );
Error: near "is": syntax error

select 1 where not( 1 );

select 1 where 'When I use a word, Humpty Dumpty said, in rather a scornful 
tone, it means just what I choose it to mean - neither more nor less.';

select 1 where not 'The question is, said Alice, whether you can make words 
mean so many different things.';

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


This email and any attachments are only for use by the intended recipient(s) 
and may contain legally privileged, confidential, proprietary or otherwise 
private information. Any unauthorized use, reproduction, dissemination, 
distribution or other disclosure of the contents of this e-mail or its 
attachments is strictly prohibited. If you have received this email in error, 
please notify the sender immediately and delete the original.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to