/ Check-in [6da39fa4]
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:In the "transaction" command of the TCL interface, if a COMMIT fails finish it with a rollback. (CVS 4059)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6da39fa4429400e21924074f5f219f4cb32415ff
User & Date: drh 2007-06-12 18:50:14
Context
2007-06-13
15:22
Fix for #2409. Return SQLITE_IOERR_BLOCKED instead of SQLITE_BUSY in cases where failure to obtain a database lock leaves the cache in an inconsistent state. See additional information at CorruptionFollowingBusyError. (CVS 4060) check-in: ce2c9925 user: danielk1977 tags: trunk
2007-06-12
18:50
In the "transaction" command of the TCL interface, if a COMMIT fails finish it with a rollback. (CVS 4059) check-in: 6da39fa4 user: drh tags: trunk
18:20
Minor comment edits from my prefix development client. No code changes. (CVS 4058) check-in: 6953cd09 user: shess tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/tclsqlite.c.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
2189
2190
2191
2192
2193
2194
2195
2196


2197
2198
2199
2200
2201
2202
2203
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** A TCL Interface to SQLite.  Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
** $Id: tclsqlite.c,v 1.187 2007/05/08 01:08:49 drh Exp $
*/
#include "tcl.h"
#include <errno.h>

/*
** Some additional include files are needed if this file is not
** appended to the amalgamation.
................................................................................
    if( !inTrans ){
      const char *zEnd;
      if( rc==TCL_ERROR ){
        zEnd = "ROLLBACK";
      } else {
        zEnd = "COMMIT";
      }
      (void)sqlite3_exec(pDb->db, zEnd, 0, 0, 0);


    }
    break;
  }

  /*
  **    $db update_hook ?script?
  **    $db rollback_hook ?script?







|







 







|
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** A TCL Interface to SQLite.  Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
** $Id: tclsqlite.c,v 1.188 2007/06/12 18:50:14 drh Exp $
*/
#include "tcl.h"
#include <errno.h>

/*
** Some additional include files are needed if this file is not
** appended to the amalgamation.
................................................................................
    if( !inTrans ){
      const char *zEnd;
      if( rc==TCL_ERROR ){
        zEnd = "ROLLBACK";
      } else {
        zEnd = "COMMIT";
      }
      if( sqlite3_exec(pDb->db, zEnd, 0, 0, 0) ){
        sqlite3_exec(pDb->db, "ROLLBACK", 0, 0, 0);
      }
    }
    break;
  }

  /*
  **    $db update_hook ?script?
  **    $db rollback_hook ?script?