Update, i made a "logical fix" where i modified the method in the interface
SpatialIndex from:
Cursor findByGeometry(TableFilter filter, SearchRow intersection);
to:
Cursor findByGeometry(TableFilter filter, SearchRow intersection, SearchRow
first, SearchRow last);
and then update the code in the required places, such as:
public Cursor findByGeometry(TableFilter filter, SearchRow
intersection) {
return find(filter.getSession(), null, null, intersection);
}
is now:
public Cursor findByGeometry(TableFilter filter, SearchRow
intersection, SearchRow first, SearchRow last) {
return find(filter.getSession(), first, last, intersection);
}
...
now the request works as expected.
But the question is: Is this a correct fix?
Dne četrtek, 24. marec 2016 23.32.49 UTC+1 je oseba Blaž Repnik napisala:
>
> Hey, i'm using the latest H2 (1.4.191) and my where clause is a mixture of
> spatial intersectio and regular attributes. This is what i do (not exactly
> this, this is just a basic example to replicate the problem):
>
> this works:
> select * from vectors WHERE GEOM && 'POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))'
> and s=0
>
> this does not: (throws a NPE)
> select * from (select * from vectors) WHERE GEOM && 'POLYGON ((0 0, 1 0, 1
> 1, 0 1, 0 0))' and s=0
>
> If i remove the s=0 from the last one, the statement works
>
> So is this a bug or an error on my side?
>
> NPE is:
> Caused by: java.lang.NullPointerException
> at org.h2.index.ViewIndex.find(ViewIndex.java:260)
> at org.h2.index.ViewIndex.findByGeometry(ViewIndex.java:182)
> at org.h2.index.IndexCursor.find(IndexCursor.java:156)
> at org.h2.table.TableFilter.next(TableFilter.java:329)
> at org.h2.command.dml.Select.queryFlat(Select.java:531)
>
> Thanks!
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.