This may be specific to RTree indexes - I haven't taken the time to fully 
understand it.

Dangerous:
CREATE TRIGGER ON UPDATE ON tablename { SET RTREE MIN/MAX }

Fine:
CREATE TRIGGER ON UPDATE OF geometry OF tablename { SET RTREE MIN/MAX }

Failure to specify the field name explicitly results in a corrupt RTree.

I assume that either OLD.geometry or NEW.geometry is not available during
the execution of the trigger, so the engine doesn't run the MAXX,MINX,MAXY,
MINY functions, but I haven't taken the time to verify that.

All that I can verify is that if I place a breakpoint inside my MINX class of 
functions,
that breakpoint does not get hit, but the RTree is nevertheless updated.

One symptom of the corruption is:
SELECT * from idx_table_field_geometry,
and  you'll end up with a bunch of 0,0,0,0 MBRs.

Ben


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to