~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/savepoints.rst

  • Committer: Jay Pipes
  • Date: 2009-02-28 17:49:22 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090228174922-jczgt4d0662fqmnf
Merging in old r902 temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
SAVEPOINT
2
 
=========
3
 
 
4
 
A savepoint is a marker inside a transaction that allows all commands that are executed after it was established to be rolled back. It effectively restores the transaction state to what it was at the time of the savepoint. ::
5
 
 
6
 
        SAVEPOINT identifier
7
 
 
8
 
This sets a savepoint that can be returned to in the current transaction. The "identifier" is the name given to the new savepoint. If the identifier has already been used then the original identifier is replaced. Example:
9
 
 
10
 
     SAVEPOINT A;
11
 
     INSERT INTO t1 values (1);
12
 
     SAVEPOINT A;
13
 
     INSERT INTO t1 values (2);
14
 
     ROLLBACK TO SAVEPOINT A;
15
 
 
16
 
Will only roll back the second insert statement.