/ Check-in [f825205d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add further test cases to savepoint.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f825205dbf3ebbfba0add86aa41f477281a13b0e
User & Date: dan 2010-07-07 18:38:36
Context
2010-07-07
20:00
Fix issue in mallocI test script where db handle not released. check-in: dd59cea6 user: shaneh tags: trunk
18:38
Add further test cases to savepoint.test. check-in: f825205d user: dan tags: trunk
17:53
When rolling back a savepoint, reset the changeCountDone flag. check-in: fb62f4e3 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/savepoint.test.

   913    913   do_multiclient_test tn {
   914    914     do_test savepoint-14.$tn.1 {
   915    915       sql1 {
   916    916         CREATE TABLE foo(x);
   917    917         INSERT INTO foo VALUES(1);
   918    918         INSERT INTO foo VALUES(2);
   919    919       }
   920         -  
   921    920       sql2 {
   922    921         BEGIN;
   923    922           SELECT * FROM foo;
   924    923       }
   925    924     } {1 2}
   926    925     do_test savepoint-14.$tn.2 {
   927    926       sql1 {
................................................................................
   955    954         ROLLBACK TO one;
   956    955         INSERT INTO foo VALUES(3);
   957    956         INSERT INTO foo VALUES(4);
   958    957         INSERT INTO foo VALUES(5);
   959    958         RELEASE one;
   960    959       }
   961    960     } {}
   962         -
   963    961     do_test savepoint-14.$tn.7 {
   964    962       sql2 { CREATE INDEX fooidx ON foo(x); }
   965    963       sql3 { PRAGMA integrity_check }
   966    964     } {ok}
   967    965   }
          966  +
          967  +do_multiclient_test tn {
          968  +  do_test savepoint-15.$tn.1 {
          969  +    sql1 {
          970  +      CREATE TABLE foo(x);
          971  +      INSERT INTO foo VALUES(1);
          972  +      INSERT INTO foo VALUES(2);
          973  +    }
          974  +    sql2 { BEGIN; SELECT * FROM foo; }
          975  +  } {1 2}
          976  +  do_test savepoint-15.$tn.2 {
          977  +    sql1 {
          978  +      PRAGMA locking_mode = EXCLUSIVE;
          979  +      BEGIN;
          980  +        INSERT INTO foo VALUES(3);
          981  +    }
          982  +    csql1 { COMMIT }
          983  +  } {1 {database is locked}}
          984  +  do_test savepoint-15.$tn.3 {
          985  +    sql1 { ROLLBACK }
          986  +    sql2 { COMMIT }
          987  +    sql1 {
          988  +      INSERT INTO foo VALUES(3);
          989  +      PRAGMA locking_mode = NORMAL;
          990  +      INSERT INTO foo VALUES(4);
          991  +    }
          992  +    sql2 { CREATE INDEX fooidx ON foo(x); }
          993  +    sql3 { PRAGMA integrity_check }
          994  +  } {ok}
          995  +}
          996  +
          997  +do_multiclient_test tn {
          998  +  do_test savepoint-16.$tn.1 {
          999  +    sql1 {
         1000  +      CREATE TABLE foo(x);
         1001  +      INSERT INTO foo VALUES(1);
         1002  +      INSERT INTO foo VALUES(2);
         1003  +    }
         1004  +  } {}
         1005  +  do_test savepoint-16.$tn.2 {
         1006  +
         1007  +    db eval {SELECT * FROM foo} {
         1008  +      sql1 { INSERT INTO foo VALUES(3) }
         1009  +      sql2 { SELECT * FROM foo }
         1010  +      sql1 { INSERT INTO foo VALUES(4) }
         1011  +      break
         1012  +    }
         1013  +
         1014  +    sql2 { CREATE INDEX fooidx ON foo(x); }
         1015  +    sql3 { PRAGMA integrity_check }
         1016  +  } {ok}
         1017  +  do_test savepoint-16.$tn.3 {
         1018  +    sql1 { SELECT * FROM foo }
         1019  +  } {1 2 3 4}
         1020  +}
   968   1021   
   969   1022   finish_test