On 6/18/17, Robert Cousins <r...@rcousins.com> wrote:
> Summary:
>       Leaving out the space after the word 'limit' causes the limit
> clause to be ignored.

Not a syntax error.  Omitting the space makes the parser think that
"limit1" is an alias for the final table name - the equivalent of:

   SELECT * FROM foo AS limit1;

Only, without the (optional) AS keyword.

>     I've reproduced it on version 3.19.2 2017-05-25 16:50:27
> edb4e819b0c058c7d74d27ebd14cc5ceb2bad6a6144a486a970182b7afe3f8b9
>     A sample output is below.
>     On one hand, this is a failure to catch a syntax error. On the other
> hand, the fact that it isn't caught is perhaps problematic and indicates
> an underlying parser issue.
> Thanx
>
> sqlite> create table foo(id Integer not null primary key, bar int);
> sqlite> insert into foo values (NULL,1),(NULL,2),(NULL,3);
> sqlite> select * from foo limit1;
> id          bar
> ----------  ----------
> 1           1
> 2           2
> 3           3
> sqlite> select * from foo limit2;
> id          bar
> ----------  ----------
> 1           1
> 2           2
> 3           3
> sqlite> select * from foo limit 1;
> id          bar
> ----------  ----------
> 1           1
> sqlite> select * from foo limit 2;
> id          bar
> ----------  ----------
> 1           1
> 2           2
> sqlite>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to