diff options
author | drh <drh@noemail.net> | 2012-09-28 13:05:48 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2012-09-28 13:05:48 +0000 |
commit | c4645dacfb435002911b187b474fa0788db9cde0 (patch) | |
tree | e757051bb0f952d0cb149b62ff6bdbbfdb99eb82 /src/pragma.c | |
parent | 40eaa08620a75a29f4849cd3572e64feaafce5ec (diff) | |
parent | f784c1ede942139d136f7c00a1d8fb30a4a31f18 (diff) | |
download | sqlite-c4645dacfb435002911b187b474fa0788db9cde0.tar.gz sqlite-c4645dacfb435002911b187b474fa0788db9cde0.zip |
Merge the latest trunk changes (especially "PRAGMA busy_timeout" and the
ORDER BY query planner optimizations) into the sessions branch.
FossilOrigin-Name: 6ca8eae1f89d19ee23cbc3a869d85b57d29b4a7d
Diffstat (limited to 'src/pragma.c')
-rw-r--r-- | src/pragma.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/pragma.c b/src/pragma.c index a41e0e433..f41f2db06 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -974,7 +974,8 @@ void sqlite3Pragma( }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, 5); } - sqlite3VdbeAddOp2(v, OP_Integer, pCol->isPrimKey, 6); + sqlite3VdbeAddOp2(v, OP_Integer, + (pCol->colFlags&COLFLAG_PRIMKEY)!=0, 6); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 6); } } @@ -1233,7 +1234,7 @@ void sqlite3Pragma( sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zName), P4_DYNAMIC); - sqlite3VdbeAddOp3(v, OP_Move, 2, 4, 1); + sqlite3VdbeAddOp2(v, OP_Move, 2, 4); sqlite3VdbeAddOp3(v, OP_Concat, 4, 3, 2); sqlite3VdbeAddOp2(v, OP_ResultRow, 2, 1); sqlite3VdbeJumpHere(v, addr); @@ -1536,6 +1537,22 @@ void sqlite3Pragma( sqlite3_db_release_memory(db); }else + /* + ** PRAGMA busy_timeout + ** PRAGMA busy_timeout = N + ** + ** Call sqlite3_busy_timeout(db, N). Return the current timeout value + ** if one is set. If no busy handler or a different busy handler is set + ** then 0 is returned. Setting the busy_timeout to 0 or negative + ** disables the timeout. + */ + if( sqlite3StrICmp(zLeft, "busy_timeout")==0 ){ + if( zRight ){ + sqlite3_busy_timeout(db, sqlite3Atoi(zRight)); + } + returnSingleInt(pParse, "timeout", db->busyTimeout); + }else + #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) /* ** Report the current state of file logs for all databases |