Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch read-after-rollback Excluding Merge-Ins
This is equivalent to a diff from 8289c3e9 to fa6e6a9a
2014-11-11
| ||
14:59 | Permit read operations to continue after a ROLLBACK as long as the schema does not change. (check-in: b5df5ac0 user: drh tags: trunk) | |
12:20 | Add new test file e_blobclose.test, containing tests for sqlite3_blob_close(). (check-in: 5a1eac24 user: dan tags: trunk) | |
01:33 | Experimental changes that permit read operations to continue after a ROLLBACK, as long as the schema is unchanged. (Closed-Leaf check-in: fa6e6a9a user: drh tags: read-after-rollback) | |
2014-11-10
| ||
19:16 | New test cases for deleting content out from under a SELECT statement. (check-in: 8289c3e9 user: drh tags: trunk) | |
17:53 | Add test file e_blobwrite.test, containing tests for the sqlite3_blob_write() interface. (check-in: 1df77e5f user: dan tags: trunk) | |
Changes to src/backup.c.
︙ | |||
603 604 605 606 607 608 609 | 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | - + | while( *pp!=p ){ pp = &(*pp)->pNext; } *pp = p->pNext; } /* If a transaction is still open on the Btree, roll it back. */ |
︙ |
Changes to src/btree.c.
︙ | |||
2209 2210 2211 2212 2213 2214 2215 | 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 | - + | } } /* Rollback any active transaction and free the handle structure. ** The call to sqlite3BtreeRollback() drops any table-locks held by ** this handle. */ |
︙ | |||
3502 3503 3504 3505 3506 3507 3508 | 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 | - - + + + - - - + + + - + - - - - - + + + + - - + + + - - + + + + + - - + - + + + + - + | } sqlite3BtreeLeave(p); return rc; } /* ** This routine sets the state to CURSOR_FAULT and the error |
︙ |
Changes to src/btree.h.
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | #endif int sqlite3BtreeSetAutoVacuum(Btree *, int); int sqlite3BtreeGetAutoVacuum(Btree *); int sqlite3BtreeBeginTrans(Btree*,int); int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster); int sqlite3BtreeCommitPhaseTwo(Btree*, int); int sqlite3BtreeCommit(Btree*); |
︙ | |||
112 113 114 115 116 117 118 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | - + | */ #define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */ #define BTREE_BLOBKEY 2 /* Table has keys only - no data */ int sqlite3BtreeDropTable(Btree*, int, int*); int sqlite3BtreeClearTable(Btree*, int, int*); int sqlite3BtreeClearTableOfCursor(BtCursor*); |
︙ |
Changes to src/main.c.
︙ | |||
1107 1108 1109 1110 1111 1112 1113 | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 | - + - + + + + - + | sqlite3_free(db->lookaside.pStart); } sqlite3_free(db); } /* ** Rollback all database files. If tripCode is not SQLITE_OK, then |
︙ |
Changes to src/vdbe.c.
︙ | |||
2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 | 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 | + + - + + + + - + | db->autoCommit = 0; p->rc = rc = SQLITE_BUSY; goto vdbe_return; } db->isTransactionSavepoint = 0; rc = p->rc; }else{ int isSchemaChange; iSavepoint = db->nSavepoint - iSavepoint - 1; if( p1==SAVEPOINT_ROLLBACK ){ isSchemaChange = (db->flags & SQLITE_InternChanges)!=0; for(ii=0; ii<db->nDb; ii++){ |
︙ | |||
3230 3231 3232 3233 3234 3235 3236 | 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 | - + | assert( (pOp->p5&(OPFLAG_P2ISREG|OPFLAG_BULKCSR))==pOp->p5 ); assert( pOp->opcode==OP_OpenWrite || pOp->p5==0 ); assert( p->bIsReader ); assert( pOp->opcode==OP_OpenRead || pOp->opcode==OP_ReopenIdx || p->readOnly==0 ); if( p->expired ){ |
︙ |
Changes to src/wal.c.
︙ | |||
2502 2503 2504 2505 2506 2507 2508 | 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 | - + - | /* Restore the clients cache of the wal-index header to the state it ** was in before the client began writing to the database. */ memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr)); for(iFrame=pWal->hdr.mxFrame+1; |
︙ |
Changes to test/capi3.test.
︙ | |||
908 909 910 911 912 913 914 | 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 | - + - + - + | } } {0 {}} do_test capi3-11.9.3 { sqlite3_get_autocommit $DB } 1 do_test capi3-11.10 { sqlite3_step $STMT |
︙ |
Changes to test/capi3c.test.
︙ | |||
859 860 861 862 863 864 865 | 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 | - + - + - + | } } {0 {}} do_test capi3c-11.9.3 { sqlite3_get_autocommit $DB } 1 do_test capi3c-11.10 { sqlite3_step $STMT |
︙ |
Changes to test/misc8.test.
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | + - - + + + + + + + + + + | do_execsql_test misc8-1.3 { INSERT INTO t1 VALUES(7,null,9); SELECT eval('SELECT * FROM t1 ORDER BY a',','); } {1,2,3,4,5,6,7,,9} do_catchsql_test misc8-1.4 { BEGIN; INSERT INTO t1 VALUES(10,11,12); SELECT a, coalesce(b, eval('ROLLBACK; SELECT ''bam'';')), c |
Changes to test/rollback.test.
︙ | |||
56 57 58 59 60 61 62 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + - + | } } {1 {UNIQUE constraint failed: t3.a}} # Try to continue with the SELECT statement # do_test rollback-1.5 { sqlite3_step $STMT |
︙ |
Changes to test/savepoint.test.
︙ | |||
311 312 313 314 315 316 317 | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | - + | } {0 {hellontyeight character blob}} do_test savepoint-5.3.2.2 { catchsql {ROLLBACK TO def} } {0 {}} do_test savepoint-5.3.2.3 { set rc [catch {seek $fd 0; read $fd} res] set rc |
︙ |
Changes to test/savepoint7.test.
︙ | |||
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + - + - + + | INSERT INTO t1 VALUES(4,5,6); INSERT INTO t1 VALUES(7,8,9); SAVEPOINT x1; } db eval {SELECT * FROM t1} { db eval { SAVEPOINT x2; CREATE TABLE IF NOT EXISTS t3(xyz); INSERT INTO t2 VALUES($a,$b,$c); RELEASE x2; } } db eval {SELECT * FROM t2; RELEASE x1} } {1 2 3 4 5 6 7 8 9} do_test savepoint7-1.2 { db eval {DELETE FROM t2;} db eval {SELECT * FROM t1} { db eval { SAVEPOINT x2; INSERT INTO t2 VALUES($a,$b,$c); RELEASE x2; } } |
Changes to test/tkt-f777251dc7a.test.
︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + + | proc force_rollback {} { catch {db eval {INSERT OR ROLLBACK INTO t1 VALUES(1)}} } db function force_rollback force_rollback do_test tkt-f7772-1.2 { breakpoint catchsql { BEGIN IMMEDIATE; CREATE TABLE xyzzy(abc); SELECT x, force_rollback(), EXISTS(SELECT 1 FROM t3 WHERE w=x) FROM t2; } } {1 {abort due to ROLLBACK}} do_test tkt-f7772-1.3 { sqlite3_get_autocommit db } {1} |
︙ | |||
63 64 65 66 67 68 69 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + | execsql { BEGIN IMMEDIATE; CREATE TEMP TABLE t3(w, z); } catchsql { SELECT x, force_rollback(), EXISTS(SELECT 1 FROM t3 WHERE w=x) FROM t2 } |
︙ |
Changes to test/trans3.test.
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + | do_test trans3-1.3.1 { sqlite3_get_autocommit db } 1 do_test trans3-1.4 { db eval {SELECT * FROM t1} } {1 2 3 4} do_test trans3-1.5 { |
︙ |