Hi,

Thanks a lot for your test case! I found the problem (actually there
were two) and I found a solution. The workaround is (as you know) to
use version 1.0.79 (2008-09-26). Another workaround is to disable the
system property h2.optimizeInJoin. I tried to run your test case,
unfortunately 'mvn' didn't work for me... I got this exception:
Missing: 1) org.apache.geronimo.specs:geronimo-jpa_3.0_spec:jar:1.1 -
but I am quite sure it works now.

I also found a simpler test case:

create table test(a int, b int, c int, d int)
  as select 1, 1, 1, 1 from dual;
SELECT 2 FROM TEST A
INNER JOIN (SELECT DISTINCT B.C AS X FROM TEST B
WHERE B.D = ?2) V ON 1=1 WHERE (A = ?1) AND (B = V.X) {1: 1, 2: 1};
drop table test;

Unfortunately this doesn't work with 1.0.79.

I am still testing the fix, but I am almost sure this problem will be
solved in the next release.

Regards,
Thomas


On Mon, Oct 13, 2008 at 6:24 AM, Prashant Bhat <[EMAIL PROTECTED]> wrote:
>
> Hi Thomas,
>
> I've uploaded a sample test project that uses Spring-2.5.5, OpenJpa
> and H2 here:
> http://groups.google.com/group/h2-database/web/openjpa-tests.tar.gz
>
> Just running 'mvn' should be ok, BTW h2-1.1.100 is not published to
> maven repo, so should be locally installed.
> CityDaoTests works with 1.0.79 but not with 1.1.100. I couldn't find
> the exact issue as the database/openjpa doesn't throw any exceptions.
>
> I noticed that if the first WHERE clause has only one condition then
> it works but not if one more condition is added.
> works: 'WHERE x.state.id IN (SELECT y.id FROM State AS y WHERE
> y.country.id = ?1) ORDER BY x.cityCode'
> but not this: 'WHERE x.active = ?1 AND x.state.id IN (SELECT y.id FROM
> State AS y WHERE y.country.id = ?2) ORDER BY x.cityCode'
>
> Thanks,
> Prashant
>
> On Oct 10, 8:07 pm, "Thomas Mueller" <[EMAIL PROTECTED]>
> wrote:
>> Hi,
>>
>> In version 1.1.x, the optimization for IN(SELECT...) is enabled by
>> default, while it was disabled in version 1.0.x. So far I couldn't
>> find a problem. Could you post some more details please (the query,
>> the tables, the indexes)? Or if possible, could you post a
>> reproducible test case?
>>
>> To disable the optimization, set the system property h2.optimizeInJoin
>> to false before loading the H2 JDBC driver.
>>
>> Regards,
>> Thomas
>>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to