File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / sqlite3 / test / savepoint5.test
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:04:16 2012 UTC (12 years, 10 months ago) by misho
Branches: sqlite3, MAIN
CVS tags: v3_7_10, HEAD
sqlite3

    1: # 2009 January 2
    2: #
    3: # The author disclaims copyright to this source code.  In place of
    4: # a legal notice, here is a blessing:
    5: #
    6: #    May you do good and not evil.
    7: #    May you find forgiveness for yourself and forgive others.
    8: #    May you share freely, never taking more than you give.
    9: #
   10: #***********************************************************************
   11: #
   12: # Verify that a SAVEPOINT on a new, empty database followed by a
   13: # ROLLBACK TO that savepoint starts over again with another new
   14: # empty database.
   15: #
   16: # $Id: savepoint5.test,v 1.1.1.1 2012/02/21 17:04:16 misho Exp $
   17: 
   18: set testdir [file dirname $argv0]
   19: source $testdir/tester.tcl
   20: 
   21: do_test savepoint5-1.1 {
   22:   db eval {
   23:     SAVEPOINT sp1;
   24:     CREATE TABLE t1(x);
   25:     INSERT INTO t1 VALUES(1);
   26:     SELECT count(*) FROM sqlite_master;
   27:     SELECT * FROM t1;
   28:   }
   29: } {1 1}
   30: do_test savepoint5-1.2 {
   31:   db eval {
   32:     ROLLBACK TO sp1;
   33:     SELECT count(*) FROM sqlite_master;
   34:   }
   35: } {0}
   36: do_test savepoint5-1.3 {
   37:   db eval {
   38:     CREATE TABLE t1(x);
   39:     INSERT INTO t1 VALUES(1);
   40:     SELECT count(*) FROM sqlite_master;
   41:     SELECT * FROM t1;
   42:   }
   43: } {1 1}
   44: 
   45: 
   46: finish_test

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>