This is already fixed in the SQLite's trunk code (see
http://www.sqlite.org/src/info/2a5629202f) and thus will be fixed in
next SQLite release, i.e. 3.7.12.

Pavel

On Sun, May 6, 2012 at 1:34 PM, William Parsons <wbpars...@alum.mit.edu> wrote:
> In my application, I've encountered a problem with ordering where the result
> doesn't match what I would have expected, and would like some clarification.
> The issue is illustrated by the following:
>
> % sqlite3 :memory:
> SQLite version 3.7.10 2012-01-16 13:28:40
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> create table x(a int, b int unique);
> sqlite> insert into x(a) values (1);
> sqlite> insert into x(a) values (4);
> sqlite> insert into x(a) values (3);
> sqlite> insert into x(a) values (5);
> sqlite> insert into x(b) values (6);
> sqlite> insert into x(b) values (8);
> sqlite> insert into x(b) values (7);
> sqlite> insert into x(a) values (2);
> sqlite> select * from x;
> 1|
> 4|
> 3|
> 5|
> |6
> |8
> |7
> 2|
> sqlite> select * from x order by b, a;
> 1|
> 4|
> 3|
> 5|
> 2|
> |6
> |7
> |8
> sqlite> .e
>
> Why aren't the numbers sorted as I would have expected?  Note that if I remove
> the unique constraint from column b it works as expected.
>
> --
> William Parsons
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to