Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch deferred-fk-quirk Excluding Merge-Ins
This is equivalent to a diff from a764915b87 to 8063197ef1
2011-02-04
| ||
05:47 | If a deferred foreign key constraint fails on a statement that is not part of a larger transation, make sure that the statement fully ends so that subsequent invocations of the same statement will not pass the constraint because they think the transaction is not closed. This is a merge of the deferred-fk-quirk branch together with a test case. (check-in: 2f94d4623f user: drh tags: trunk) | |
2011-01-24
| ||
19:14 | Fix a harmless compiler warning (a shadowed local variable) in analyze.c. (check-in: a1ad7fb38b user: drh tags: trunk) | |
16:00 | Ensure that if a deferred FK constraint is violated by a statement that creates its own implicit transaction, the statement is not an "active-write" after sqlite3_step() returns. (Closed-Leaf check-in: 8063197ef1 user: dan tags: deferred-fk-quirk) | |
2011-01-22
| ||
13:32 | Modify the trace callback mechanism so that SQL commands executed from within virtual table or user function callbacks are passed to the trace callback without parameter expansion and enclosed in SQL comments. (check-in: a764915b87 user: dan tags: trunk) | |
2011-01-21
| ||
18:25 | Change sqlite3StrAccumAppend() to use realloc instead of malloc. (check-in: 380f61df07 user: dan tags: trunk) | |
Changes to src/vdbeaux.c.
2104 2104 ** above has occurred. 2105 2105 */ 2106 2106 if( !sqlite3VtabInSync(db) 2107 2107 && db->autoCommit 2108 2108 && db->writeVdbeCnt==(p->readOnly==0) 2109 2109 ){ 2110 2110 if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ 2111 - if( sqlite3VdbeCheckFk(p, 1) ){ 2112 - sqlite3BtreeMutexArrayLeave(&p->aMutex); 2113 - return SQLITE_ERROR; 2111 + rc = sqlite3VdbeCheckFk(p, 1); 2112 + if( rc!=SQLITE_OK ){ 2113 + if( p->readOnly ){ 2114 + sqlite3BtreeMutexArrayLeave(&p->aMutex); 2115 + return SQLITE_ERROR; 2116 + } 2117 + rc = SQLITE_CONSTRAINT; 2118 + }else{ 2119 + /* The auto-commit flag is true, the vdbe program was successful 2120 + ** or hit an 'OR FAIL' constraint and there are no deferred foreign 2121 + ** key constraints to hold up the transaction. This means a commit 2122 + ** is required. */ 2123 + rc = vdbeCommit(db, p); 2114 2124 } 2115 - /* The auto-commit flag is true, the vdbe program was successful 2116 - ** or hit an 'OR FAIL' constraint and there are no deferred foreign 2117 - ** key constraints to hold up the transaction. This means a commit 2118 - ** is required. */ 2119 - rc = vdbeCommit(db, p); 2120 - if( rc==SQLITE_BUSY ){ 2125 + if( rc==SQLITE_BUSY && p->readOnly ){ 2121 2126 sqlite3BtreeMutexArrayLeave(&p->aMutex); 2122 2127 return SQLITE_BUSY; 2123 2128 }else if( rc!=SQLITE_OK ){ 2124 2129 p->rc = rc; 2125 2130 sqlite3RollbackAll(db); 2126 2131 }else{ 2127 2132 db->nDeferredCons = 0; ................................................................................ 2212 2217 ** to invoke any required unlock-notify callbacks. 2213 2218 */ 2214 2219 if( db->autoCommit ){ 2215 2220 sqlite3ConnectionUnlocked(db); 2216 2221 } 2217 2222 2218 2223 assert( db->activeVdbeCnt>0 || db->autoCommit==0 || db->nStatement==0 ); 2219 - return SQLITE_OK; 2224 + return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK); 2220 2225 } 2221 2226 2222 2227 2223 2228 /* 2224 2229 ** Each VDBE holds the result of the most recent sqlite3_step() call 2225 2230 ** in p->rc. This routine sets that result back to SQLITE_OK. 2226 2231 */