diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 6 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/test8.c | 16 | ||||
-rw-r--r-- | src/update.c | 7 | ||||
-rw-r--r-- | src/vdbe.c | 6 | ||||
-rw-r--r-- | src/vdbeaux.c | 7 | ||||
-rw-r--r-- | src/where.c | 4 |
7 files changed, 25 insertions, 24 deletions
diff --git a/src/func.c b/src/func.c index 375346aa7..4f697713f 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.131 2006/06/17 14:12:48 drh Exp $ +** $Id: func.c,v 1.132 2006/06/24 11:51:33 danielk1977 Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -681,13 +681,13 @@ static void soundexFunc(sqlite3_context *context, int argc, sqlite3_value **argv ** A function that loads a shared-library extension then returns NULL. */ static void loadExt(sqlite3_context *context, int argc, sqlite3_value **argv){ - const char *zFile = sqlite3_value_text(argv[0]); + const char *zFile = (const char *)sqlite3_value_text(argv[0]); const char *zProc = 0; sqlite3 *db = sqlite3_user_data(context); char *zErrMsg = 0; if( argc==2 ){ - zProc = sqlite3_value_text(argv[1]); + zProc = (const char *)sqlite3_value_text(argv[1]); } if( sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){ sqlite3_result_error(context, zErrMsg, -1); diff --git a/src/main.c b/src/main.c index ae5f99cc6..6a5cac321 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.347 2006/06/23 11:34:55 danielk1977 Exp $ +** $Id: main.c,v 1.348 2006/06/24 11:51:33 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -474,6 +474,7 @@ int sqlite3CreateFunc( p->xStep = xStep; p->xFinalize = xFinal; p->pUserData = pUserData; + p->nArg = nArg; } return SQLITE_OK; } diff --git a/src/test8.c b/src/test8.c index 8d737f6ea..8555b9b81 100644 --- a/src/test8.c +++ b/src/test8.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test8.c,v 1.36 2006/06/24 09:34:23 danielk1977 Exp $ +** $Id: test8.c,v 1.37 2006/06/24 11:51:34 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -189,7 +189,7 @@ static int getIndexArray( ** corresponding entry in aIndex[] to 1. */ while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ - const char *zIdx = sqlite3_column_text(pStmt, 1); + const char *zIdx = (const char *)sqlite3_column_text(pStmt, 1); sqlite3_stmt *pStmt2 = 0; zSql = sqlite3MPrintf("PRAGMA index_info(%s)", zIdx); if( !zSql ){ @@ -268,7 +268,7 @@ static int echoDeclareVtab( -1, &pStmt, 0); sqlite3_bind_text(pStmt, 1, argv[3], -1, 0); if( sqlite3_step(pStmt)==SQLITE_ROW ){ - const char *zCreateTable = sqlite3_column_text(pStmt, 0); + const char *zCreateTable = (const char *)sqlite3_column_text(pStmt, 0); sqlite3_declare_vtab(db, zCreateTable); rc = sqlite3_finalize(pStmt); } else { @@ -542,7 +542,7 @@ static int echoFilter( appendToEchoModule(pVtab->interp, "xFilter"); appendToEchoModule(pVtab->interp, idxStr); for(i=0; i<argc; i++){ - appendToEchoModule(pVtab->interp, sqlite3_value_text(argv[i])); + appendToEchoModule(pVtab->interp, (const char*)sqlite3_value_text(argv[i])); } sqlite3_finalize(pCur->pStmt); @@ -695,8 +695,12 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ ** the ORDER BY clause. */ if( pIdxInfo->nOrderBy==1 && pVtab->aIndex[pIdxInfo->aOrderBy->iColumn] ){ - char *zCol = pVtab->aCol[pIdxInfo->aOrderBy->iColumn]; + int iCol = pIdxInfo->aOrderBy->iColumn; + char *zCol = pVtab->aCol[iCol]; char *zDir = pIdxInfo->aOrderBy->desc?"DESC":"ASC"; + if( iCol<0 ){ + zCol = "rowid"; + } zNew = sqlite3_mprintf(" ORDER BY %s %s", zCol, zDir); string_concat(&zQuery, zNew, 1); pIdxInfo->orderByConsumed = 1; @@ -965,7 +969,7 @@ static int declare_vtab( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; rc = sqlite3_declare_vtab(db, Tcl_GetString(objv[2])); if( rc!=SQLITE_OK ){ - Tcl_SetResult(interp, sqlite3_errmsg(db), TCL_VOLATILE); + Tcl_SetResult(interp, (char *)sqlite3_errmsg(db), TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; diff --git a/src/update.c b/src/update.c index 22d6b7a02..5a8ac92f7 100644 --- a/src/update.c +++ b/src/update.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** -** $Id: update.c,v 1.131 2006/06/19 03:05:10 danielk1977 Exp $ +** $Id: update.c,v 1.132 2006/06/24 11:51:34 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -571,10 +571,9 @@ static void updateVirtualTable( if( pRowid ){ pEList = sqlite3ExprListAppend(pEList, sqlite3ExprDup(pRowid), 0); } + assert( pTab->iPKey<0 ); for(i=0; i<pTab->nCol; i++){ - if( i==pTab->iPKey ){ - pExpr = sqlite3Expr(TK_NULL, 0, 0, 0); - }else if( aXRef[i]>=0 ){ + if( aXRef[i]>=0 ){ pExpr = sqlite3ExprDup(pChanges->a[aXRef[i]].pExpr); }else{ pExpr = sqlite3CreateIdExpr(pTab->aCol[i].zName); diff --git a/src/vdbe.c b/src/vdbe.c index ccef8f81d..0ae5669e6 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.568 2006/06/23 14:32:08 danielk1977 Exp $ +** $Id: vdbe.c,v 1.569 2006/06/24 11:51:34 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -4548,9 +4548,9 @@ case OP_TableLock: { /* no-push */ #endif /* SQLITE_OMIT_SHARED_CACHE */ #ifndef SQLITE_OMIT_VIRTUALTABLE -/* Opcode: VCreate P1 * P3 +/* Opcode: VBegin * * P3 ** -** P3 is the name of a virtual table in database P1. Call the xCreate method +** P3 a pointer to an sqlite3_vtab structure. Call the xBegin method ** for that table. */ case OP_VBegin: { /* no-push */ diff --git a/src/vdbeaux.c b/src/vdbeaux.c index d9b54e025..ca88ec9ee 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -261,10 +261,6 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs, int *pMaxStack){ if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){ doesStatementRollback = 1; } - }else if( opcode==OP_IdxInsert ){ - if( pOp->p2 ){ - doesStatementRollback = 1; - } }else if( opcode==OP_Statement ){ hasStatementBegin = 1; }else if( opcode==OP_VFilter ){ @@ -1384,7 +1380,8 @@ int sqlite3VdbeHalt(Vdbe *p){ } } - if( p->pc>=0 ){ + /* We have successfully halted and closed the VM. Record this fact. */ + if( p->pc>=0 ){ db->activeVdbeCnt--; } p->magic = VDBE_MAGIC_HALT; diff --git a/src/where.c b/src/where.c index 197f2f31d..963f0db29 100644 --- a/src/where.c +++ b/src/where.c @@ -16,7 +16,7 @@ ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** -** $Id: where.c,v 1.222 2006/06/23 08:05:31 danielk1977 Exp $ +** $Id: where.c,v 1.223 2006/06/24 11:51:35 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -1900,7 +1900,7 @@ WhereInfo *sqlite3WhereBegin( #ifndef SQLITE_OMIT_VIRTUALTABLE else if( pLevel->pIdxInfo ){ sqlite3_index_info *pIdxInfo = pLevel->pIdxInfo; - zMsg = sqlite3MPrintf("%z VIRTUAL TABLE INDEX %d:%s", + zMsg = sqlite3MPrintf("%z VIRTUAL TABLE INDEX %d:%s", zMsg, pIdxInfo->idxNum, pIdxInfo->idxStr); } #endif |