I experience some strange behaviour with SAVEPOINT in combination with 
locking_mode=exclusive. Below is a script which I assembled from savepoint.text 
13.1 to 13.4. Those tests run OK in normal locking mode, but fail in exclusive 
locking more.

To reproduce, run the script below on a NEW and EMPTY database. The result 
difference is marked as follows:

  a  b
  1  2 
  3  4 
  5  6 
  7  8 
  9  10 
  11 12 
  13 14 <- missing rows if run in exclusive mode 
  15 16 <- on a new and empty database

<SQL>

PRAGMA locking_mode=exclusive;

DROP TABLE IF EXISTS t1;

BEGIN;
  CREATE TABLE t1(a PRIMARY KEY, b);
  INSERT INTO t1 VALUES(1, 2);
COMMIT;

PRAGMA journal_mode = off;

BEGIN;
  INSERT INTO t1 VALUES(3, 4);
  INSERT INTO t1 SELECT a+4,b+4  FROM t1;
COMMIT;

BEGIN;
  INSERT INTO t1 VALUES(9, 10);
  SAVEPOINT s1;
    INSERT INTO t1 VALUES(11, 12);
COMMIT;

BEGIN;
  INSERT INTO t1 VALUES(13, 14);
  SAVEPOINT s1;
    INSERT INTO t1 VALUES(15, 16);
    ROLLBACK TO s1;
ROLLBACK;

SELECT * FROM t1;

</SQL>

I wonder if this behaviour is intended of if there is an error in the library?

Ralf

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

Reply via email to