/ Check-in [f825205d]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 Unified Diffs Show Whitespace Changes Patch

Changes to test/savepoint.test.

913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
...
955
956
957
958
959
960
961




962


963























964
965
966
967
968

























969
do_multiclient_test tn {
  do_test savepoint-14.$tn.1 {
    sql1 {
      CREATE TABLE foo(x);
      INSERT INTO foo VALUES(1);
      INSERT INTO foo VALUES(2);
    }
  
    sql2 {
      BEGIN;
        SELECT * FROM foo;
    }
  } {1 2}
  do_test savepoint-14.$tn.2 {
    sql1 {
................................................................................
      ROLLBACK TO one;
      INSERT INTO foo VALUES(3);
      INSERT INTO foo VALUES(4);
      INSERT INTO foo VALUES(5);
      RELEASE one;
    }
  } {}







  do_test savepoint-14.$tn.7 {























    sql2 { CREATE INDEX fooidx ON foo(x); }
    sql3 { PRAGMA integrity_check }
  } {ok}
}


























finish_test







<







 







>
>
>
>
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

913
914
915
916
917
918
919

920
921
922
923
924
925
926
...
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
do_multiclient_test tn {
  do_test savepoint-14.$tn.1 {
    sql1 {
      CREATE TABLE foo(x);
      INSERT INTO foo VALUES(1);
      INSERT INTO foo VALUES(2);
    }

    sql2 {
      BEGIN;
        SELECT * FROM foo;
    }
  } {1 2}
  do_test savepoint-14.$tn.2 {
    sql1 {
................................................................................
      ROLLBACK TO one;
      INSERT INTO foo VALUES(3);
      INSERT INTO foo VALUES(4);
      INSERT INTO foo VALUES(5);
      RELEASE one;
    }
  } {}
  do_test savepoint-14.$tn.7 {
    sql2 { CREATE INDEX fooidx ON foo(x); }
    sql3 { PRAGMA integrity_check }
  } {ok}
}

do_multiclient_test tn {
  do_test savepoint-15.$tn.1 {
    sql1 {
      CREATE TABLE foo(x);
      INSERT INTO foo VALUES(1);
      INSERT INTO foo VALUES(2);
    }
    sql2 { BEGIN; SELECT * FROM foo; }
  } {1 2}
  do_test savepoint-15.$tn.2 {
    sql1 {
      PRAGMA locking_mode = EXCLUSIVE;
      BEGIN;
        INSERT INTO foo VALUES(3);
    }
    csql1 { COMMIT }
  } {1 {database is locked}}
  do_test savepoint-15.$tn.3 {
    sql1 { ROLLBACK }
    sql2 { COMMIT }
    sql1 {
      INSERT INTO foo VALUES(3);
      PRAGMA locking_mode = NORMAL;
      INSERT INTO foo VALUES(4);
    }
    sql2 { CREATE INDEX fooidx ON foo(x); }
    sql3 { PRAGMA integrity_check }
  } {ok}
}

do_multiclient_test tn {
  do_test savepoint-16.$tn.1 {
    sql1 {
      CREATE TABLE foo(x);
      INSERT INTO foo VALUES(1);
      INSERT INTO foo VALUES(2);
    }
  } {}
  do_test savepoint-16.$tn.2 {

    db eval {SELECT * FROM foo} {
      sql1 { INSERT INTO foo VALUES(3) }
      sql2 { SELECT * FROM foo }
      sql1 { INSERT INTO foo VALUES(4) }
      break
    }

    sql2 { CREATE INDEX fooidx ON foo(x); }
    sql3 { PRAGMA integrity_check }
  } {ok}
  do_test savepoint-16.$tn.3 {
    sql1 { SELECT * FROM foo }
  } {1 2 3 4}
}

finish_test