I added issue/bug: http://code.google.com/p/h2database/issues/detail?id=384
On Feb 20, 9:35 am, Noel Grandin <[email protected]> wrote: > Hi > > Thomas, I have reduced the test case to a minimal version: > > create table a (id int) > select * from a union select * from a ORDER BY a.id > > But I don't understand the code in that section well enough to fix it. > > Regards, Noel Grandin > > On 2012-02-17 22:49, Victor wrote: > > > > > > > > > sorry that got. > > the problem in sorting. > > --------------------------------begin TEST 1 (- error) > > drop table if exists a, b; > > create table a (id int); > > create table b (id int, d date, n numeric(12,2)); > > insert into a values (1); > > insert into b values (1, now(), 100); > > select * from a > > --where id - (select coalesce(sum(id), 0) from b where id=a.id and d > >> null)<0 > > union > > select * from a > > --ORDER BY a.id > > --------------------------------begin TEST 1 (- error) > > drop table if exists a, b; > > Update count: 0 > > (0 ms) > > > create table a (id int); > > Update count: 0 > > (0 ms) > > > create table b (id int, d date, n numeric(12,2)); > > Update count: 0 > > (1 ms) > > > insert into a values (1); > > Update count: 1 > > (0 ms) > > > insert into b values (1, now(), 100); > > Update count: 1 > > (0 ms) > > > select * from a > > --where id - (select coalesce(sum(id), 0) from b where id=a.id and d > >> null)<0 > > union > > select * from a > > --ORDER BY a.id; > > ID > > 1 > > --------------------------------end TEST 1 (- error) > > --------------------------------begin TEST 2 (+ error) > > drop table if exists a, b; > > create table a (id int); > > create table b (id int, d date, n numeric(12,2)); > > insert into a values (1); > > insert into b values (1, now(), 100); > > select * from a > > --where id - (select coalesce(sum(id), 0) from b where id=a.id and d > >> null)<0 > > union > > select * from a > > ORDER BY a.id > > --------------------------------begin TEST 2 (+ error) > > drop table if exists a, b; > > Update count: 0 > > (1 ms) > > > create table a (id int); > > Update count: 0 > > (1 ms) > > > create table b (id int, d date, n numeric(12,2)); > > Update count: 0 > > (0 ms) > > > insert into a values (1); > > Update count: 1 > > (0 ms) > > > insert into b values (1, now(), 100); > > Update count: 1 > > (0 ms) > > > select * from a > > --where id - (select coalesce(sum(id), 0) from b where id=a.id and d > >> null)<0 > > union > > select * from a > > ORDER BY a.id; > > General error: "java.lang.NullPointerException" [50000-164] > > HY000/50000 (Help) > > --------------------------------end TEST 2 (+ error) -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
