On Sun, 20 Jul 2008 09:03:44 +0200, you wrote:
>Hello to all,
>
>I think I have found a bug in the RTree extension (I'm using version 3.6.0)
>If I run this script :
It works perfectly for me.
Here is my version of the script:
sqlite_version():3.6.0
DROP TABLE IF EXISTS GEO_TEST;
DROP TABLE IF EXISTS SI_GEO_TEST;
CREATE TABLE GEO_TEST (FID INTEGER PRIMARY KEY NOT NULL,
NAME CHAR NOT NULL, E_UTMX REAL, E_UTMY REAL);
CREATE VIRTUAL TABLE SI_GEO_TEST USING rtree(si_pkid_si,
si_xmin_si, si_xmax_si, si_ymin_si, si_ymax_si);
CREATE TRIGGER TSII_GEO_TEST
AFTER INSERT ON GEO_TEST FOR EACH ROW
BEGIN
INSERT INTO SI_GEO_TEST (si_pkid_si, si_xmin_si,
si_xmax_si, si_ymin_si, si_ymax_si) VALUES (NEW.ROWID,
NEW.E_UTMX, NEW.E_UTMX, NEW.E_UTMY, NEW.E_UTMY);
END;
CREATE TRIGGER TSIU_GEO_TEST
AFTER UPDATE ON GEO_TEST FOR EACH ROW
BEGIN
UPDATE SI_GEO_TEST
SET si_xmin_si = NEW.E_UTMX, si_xmax_si = NEW.E_UTMX,
si_ymin_si = NEW.E_UTMY, si_ymax_si = NEW.E_UTMY
WHERE si_pkid_si = NEW.ROWID;
END;
CREATE TRIGGER TSID_GEO_TEST
AFTER DELETE ON GEO_TEST FOR EACH ROW
BEGIN
DELETE FROM SI_GEO_TEST WHERE si_pkid_si = OLD.ROWID;
END;
BEGIN;
INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (1,
'A', 10.0, 10.0);
INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (2,
'B', 20.0, 20.0);
INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (3,
'C', 30.0, 30.0);
INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (4,
'D', 40.0, 40.0);
INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (5,
'E', 50.0, 50.0);
END;
SELECT * FROM GEO_TEST;
1|A|10.0|10.0
2|B|20.0|20.0
3|C|30.0|30.0
4|D|40.0|40.0
5|E|50.0|50.0
SELECT * FROM SI_GEO_TEST;
1|10.0|10.0|10.0|10.0
2|20.0|20.0|20.0|20.0
3|30.0|30.0|30.0|30.0
4|40.0|40.0|40.0|40.0
5|50.0|50.0|50.0|50.0
>
>The first row is not inserted in the GEO_TEST table.
>
>If I do the inserts this way (with the first insert out of the transaction):
>
> INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (1, 'A',
>10.0, 10.0);
> BEGIN;
> INSERT INTO GEO_TEST(FID, NAME, E_UTMX, E_UTMY) VALUES (2, 'B',
>20.0, 20.0);
[snip]
>then every thing goes right.
>
>Am I doing something wrong ?
I don't see any errors, I copied your code verbatim, only
changed some indentation.
>Thanks in advance.
>
>Xevi
--
( Kees Nuyt
)
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users