aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2012-09-28 13:05:48 +0000
committerdrh <drh@noemail.net>2012-09-28 13:05:48 +0000
commitc4645dacfb435002911b187b474fa0788db9cde0 (patch)
treee757051bb0f952d0cb149b62ff6bdbbfdb99eb82 /src/main.c
parent40eaa08620a75a29f4849cd3572e64feaafce5ec (diff)
parentf784c1ede942139d136f7c00a1d8fb30a4a31f18 (diff)
downloadsqlite-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/main.c')
-rw-r--r--src/main.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 34109c40f..5778f8780 100644
--- a/src/main.c
+++ b/src/main.c
@@ -475,6 +475,11 @@ int sqlite3_config(int op, ...){
break;
}
+ case SQLITE_CONFIG_COVERING_INDEX_SCAN: {
+ sqlite3GlobalConfig.bUseCis = va_arg(ap, int);
+ break;
+ }
+
default: {
rc = SQLITE_ERROR;
break;
@@ -1116,6 +1121,7 @@ int sqlite3_busy_handler(
db->busyHandler.xFunc = xBusy;
db->busyHandler.pArg = pArg;
db->busyHandler.nBusy = 0;
+ db->busyTimeout = 0;
sqlite3_mutex_leave(db->mutex);
return SQLITE_OK;
}
@@ -1153,8 +1159,8 @@ void sqlite3_progress_handler(
*/
int sqlite3_busy_timeout(sqlite3 *db, int ms){
if( ms>0 ){
- db->busyTimeout = ms;
sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
+ db->busyTimeout = ms;
}else{
sqlite3_busy_handler(db, 0, 0);
}
@@ -1789,6 +1795,15 @@ int sqlite3_extended_errcode(sqlite3 *db){
}
/*
+** Return a string that describes the kind of error specified in the
+** argument. For now, this simply calls the internal sqlite3ErrStr()
+** function.
+*/
+const char *sqlite3_errstr(int rc){
+ return sqlite3ErrStr(rc);
+}
+
+/*
** Create a new collating function for database "db". The name is zName
** and the encoding is enc.
*/
@@ -2762,7 +2777,7 @@ int sqlite3_table_column_metadata(
zDataType = pCol->zType;
zCollSeq = pCol->zColl;
notnull = pCol->notNull!=0;
- primarykey = pCol->isPrimKey!=0;
+ primarykey = (pCol->colFlags & COLFLAG_PRIMKEY)!=0;
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0;
}else{
zDataType = "INTEGER";
@@ -3025,8 +3040,7 @@ int sqlite3_test_control(int op, ...){
*/
case SQLITE_TESTCTRL_OPTIMIZATIONS: {
sqlite3 *db = va_arg(ap, sqlite3*);
- int x = va_arg(ap,int);
- db->flags = (x & SQLITE_OptMask) | (db->flags & ~SQLITE_OptMask);
+ db->dbOptFlags = (u16)(va_arg(ap, int) & 0xffff);
break;
}