Hi,

Nicolas, thanks for the remark, and sorry for not providing an example. I 
do have the latest version so the handling of null geometries is up to 
date. One test function that has been added in the pull request you 
mentioned only checks for a small table (size one I believe). However, in 
that case, the spatial key is not used for lookup because the MVTree is 
small enough to contain only leaves.


Here is a small example that yields the error I mean. Note that the test 
script *passes for small table sizes.*

public void testIndexUpdateNullGeometry2() throws SQLException {
deleteDb("spatial");
Connection conn = getConnection(URL);
Statement stat = conn.createStatement();
stat.execute("drop table if exists DUMMY_11;");
stat.execute(
"CREATE TABLE PUBLIC.DUMMY_11 (fid serial,  GEOM GEOMETRY, Name 
varchar(255));");
stat.execute("CREATE SPATIAL INDEX PUBLIC_DUMMY_11_SPATIAL_INDEX on"
+ " PUBLIC.DUMMY_11(GEOM);");
for (int i = 0; i < 100; i++) {
stat.execute("insert into PUBLIC.DUMMY_11(geom) values(null);");
}
stat.execute("update PUBLIC.DUMMY_11 set Name='test' where fid = 5");
conn.close();
deleteDb("spatial");
}



The row fails to be found here, because with larger tables, the root Page 
is not a leaf any more, relying on the above mentioned contains relation...

protected Object get(Page p, Object key) {
if (!p.isLeaf()) {
List<Object> l = new ArrayList<Object>();
for (int i = 0; i < p.getKeyCount(); i++) {
Object o = get(p.getChildPage(i), key);
if (o != null) {
l.add(o);
}
}
for (int i = 0; i < p.getKeyCount(); i++) {
if (contains(p, i, key)) {
Object o = get(p.getChildPage(i), key);
if (o != null) {
return o;
}
}
}
} else
{
for (int i = 0; i < p.getKeyCount(); i++) {
if (keyType.equals(p.getKey(i), key)) {
return p.getValue(i);
}
}
}
return null;
}


kind regards,

Sven

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

Reply via email to