/ Check-in [c2a84430]
Login

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

Overview
Comment:Do not clear the internal "schema has changed" flag when performing a savepoint rollback. The schema changes may not have taken place within the savepoint being rolled back.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c2a84430d3b6bb53b19af9294973575178290f93
User & Date: dan 2010-08-31 16:25:20
Context
2010-09-01
02:37
Ensure randomly generated rowids never go negative. check-in: 63142367 user: shaneh tags: trunk
2010-08-31
16:25
Do not clear the internal "schema has changed" flag when performing a savepoint rollback. The schema changes may not have taken place within the savepoint being rolled back. check-in: c2a84430 user: dan tags: trunk
15:54
Changes to comments and type names in rtree.c. check-in: 7c4f80ad user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

2602
2603
2604
2605
2606
2607
2608

2609
2610
2611
2612
2613
2614
2615
          if( rc!=SQLITE_OK ){
            goto abort_due_to_error;
          }
        }
        if( p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){
          sqlite3ExpirePreparedStatements(db);
          sqlite3ResetInternalSchema(db, 0);

        }
      }
  
      /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all 
      ** savepoints nested inside of the savepoint being operated on. */
      while( db->pSavepoint!=pSavepoint ){
        pTmp = db->pSavepoint;







>







2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
          if( rc!=SQLITE_OK ){
            goto abort_due_to_error;
          }
        }
        if( p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){
          sqlite3ExpirePreparedStatements(db);
          sqlite3ResetInternalSchema(db, 0);
          db->flags = (db->flags | SQLITE_InternChanges);
        }
      }
  
      /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all 
      ** savepoints nested inside of the savepoint being operated on. */
      while( db->pSavepoint!=pSavepoint ){
        pTmp = db->pSavepoint;

Changes to test/savepoint.test.

1014
1015
1016
1017
1018
1019
1020
1021






















1022
    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








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

1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
    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}
}

#-------------------------------------------------------------------------
# This next block of tests verifies that a problem reported on the mailing
# list has been resolved. At one point the second "CREATE TABLE t6" would
# fail as table t6 still existed in the internal cache of the db schema
# (even though it had been removed from the database by the ROLLBACK 
# command).
#
do_execsql_test savepoint-17.1 {
  BEGIN;
    CREATE TABLE t6(a, b);
    INSERT INTO t6 VALUES(1, 2);
    SAVEPOINT one;
      INSERT INTO t6 VALUES(3, 4);
    ROLLBACK TO one;
    SELECT * FROM t6;
  ROLLBACK;
} {1 2}

do_execsql_test savepoint-17.2 {
  CREATE TABLE t6(a, b);
} {}

finish_test