mirror of
https://github.com/sqlite/sqlite.git
synced 2026-01-06 08:01:16 +03:00
Merge trunk changes into experimental fts3-prefix-search branch.
FossilOrigin-Name: f0f0a03db214b68a37069f64c27ae8520220c900
This commit is contained in:
@@ -3781,7 +3781,7 @@ static int fts3ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
TESTONLY( Fts3Table *p = (Fts3Table*)pVtab );
|
||||
assert( p->inTransaction );
|
||||
assert( p->mxSavepoint >= iSavepoint );
|
||||
TESTONLY( p->mxSavepoint = iSavepoint>0 ? iSavepoint-1 : 0 );
|
||||
TESTONLY( p->mxSavepoint = iSavepoint-1 );
|
||||
return SQLITE_OK;
|
||||
}
|
||||
static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
|
||||
20
manifest
20
manifest
@@ -1,5 +1,5 @@
|
||||
C Change\sfts4\sso\sthat\sthe\sprefix=\sparameter\sis\spasses\sa\scomma-separated\slist\sof\sintegers.\sFor\seach\sinteger\sN,\sa\sseparate\sindex\sof\sall\sprefixes\sof\slength\sN\sbytes\sis\screated.
|
||||
D 2011-05-25T18:34:53.807
|
||||
C Merge\strunk\schanges\sinto\sexperimental\sfts3-prefix-search\sbranch.
|
||||
D 2011-05-25T18:47:26.259
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@@ -61,7 +61,7 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c 9ebda4cd406e5aa234977caa97c2045d36048753
|
||||
F ext/fts3/fts3.c 925360f6c043fb87719e56520470265d69c5f870
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h deeeac21d17da06683a79b40ae119b93cf86f90a
|
||||
F ext/fts3/fts3_aux.c 2817a1ec9ffbad673cb1a1527ad807811bc7645b
|
||||
@@ -181,7 +181,7 @@ F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff
|
||||
F src/shell.c decd04236a7ef26be5ef46d4ea963044bfad9a48
|
||||
F src/sqlite.h.in 91c63a69eeddbd62182ec00dbfee390016972bdb
|
||||
F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754
|
||||
F src/sqliteInt.h 558170329f2b9cc3ac1a697fda69d6136b1052a1
|
||||
F src/sqliteInt.h d9ff5f198b5bac7ee0c6e1ea55f76897ba4dda87
|
||||
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
|
||||
F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf
|
||||
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
|
||||
@@ -236,15 +236,15 @@ F src/update.c 5bcb56e5c7380a2eecb0e71891dbd4ad7437748f
|
||||
F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60
|
||||
F src/util.c 0f33bbbdfcc4a2d8cf20c3b2a16ffc3b57c58a70
|
||||
F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e
|
||||
F src/vdbe.c 408cc051fab3f16af2ccfe5a5eb0c86499ebb10c
|
||||
F src/vdbe.c 4812f0e5813b3969307ec466d26d9b32b7b814e9
|
||||
F src/vdbe.h 8a675fefdf7119441fe817c800a9a52440c2e797
|
||||
F src/vdbeInt.h fe8f58d305e629fff02f61f655aca1d299f1f6ae
|
||||
F src/vdbeapi.c e0e2672e0a96ae3f8575c8ecd02912a3e8a554a1
|
||||
F src/vdbeaux.c 535851211df61d83213c83d5ffd3c6ce9ecbdc18
|
||||
F src/vdbeaux.c 07a5226ae6e9c6e54b5fcd3c395b86e7ffdba3a4
|
||||
F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562
|
||||
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
|
||||
F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114
|
||||
F src/vtab.c abc63828276619d7eb8f45ab265ebc2204c85ddd
|
||||
F src/vtab.c 9ba8c7fdb7d39260c033a402f6032d3e7bc5d336
|
||||
F src/wal.c de27c34c8016c00be348fc6bed588816557ceb66
|
||||
F src/wal.h 66b40bd91bc29a5be1c88ddd1f5ade8f3f48728a
|
||||
F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
|
||||
@@ -939,7 +939,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
P b5bdc639898ee22eebedeb560810e94e74de8aa4
|
||||
R e9f427c5bc714eae400763155f710174
|
||||
P be59bf49402d2e2f4b95fb6668849f3745cb7bf2 d807304a695fc85402b86e1cd32a6e3bbb2823c8
|
||||
R 2e09e5d0236bf18c24c777dcd7acf739
|
||||
U dan
|
||||
Z 6f0f673a9e9eaf0f72d887565c9f2227
|
||||
Z fd8764569a495dba32fc732cd25f7598
|
||||
|
||||
@@ -1 +1 @@
|
||||
be59bf49402d2e2f4b95fb6668849f3745cb7bf2
|
||||
f0f0a03db214b68a37069f64c27ae8520220c900
|
||||
@@ -1235,7 +1235,7 @@ struct VTable {
|
||||
sqlite3_vtab *pVtab; /* Pointer to vtab instance */
|
||||
int nRef; /* Number of pointers to this structure */
|
||||
u8 bConstraint; /* True if constraints are supported */
|
||||
u8 bInSavepoint; /* True if within a SAVEPOINT */
|
||||
int iSavepoint; /* Depth of the SAVEPOINT stack */
|
||||
VTable *pNext; /* Next in linked list (see above) */
|
||||
};
|
||||
|
||||
|
||||
@@ -2840,7 +2840,7 @@ case OP_Transaction: {
|
||||
p->iStatement = db->nSavepoint + db->nStatement;
|
||||
}
|
||||
|
||||
rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement);
|
||||
rc = sqlite3VtabSavepoint(db, SAVEPOINT_BEGIN, p->iStatement-1);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3BtreeBeginStmt(pBt, p->iStatement);
|
||||
}
|
||||
|
||||
@@ -2202,17 +2202,11 @@ int sqlite3VdbeHalt(Vdbe *p){
|
||||
** do so. If this operation returns an error, and the current statement
|
||||
** error code is SQLITE_OK or SQLITE_CONSTRAINT, then promote the
|
||||
** current statement error code.
|
||||
**
|
||||
** Note that sqlite3VdbeCloseStatement() can only fail if eStatementOp
|
||||
** is SAVEPOINT_ROLLBACK. But if p->rc==SQLITE_OK then eStatementOp
|
||||
** must be SAVEPOINT_RELEASE. Hence the NEVER(p->rc==SQLITE_OK) in
|
||||
** the following code.
|
||||
*/
|
||||
if( eStatementOp ){
|
||||
rc = sqlite3VdbeCloseStatement(p, eStatementOp);
|
||||
if( rc ){
|
||||
assert( eStatementOp==SAVEPOINT_ROLLBACK );
|
||||
if( NEVER(p->rc==SQLITE_OK) || p->rc==SQLITE_CONSTRAINT ){
|
||||
if( p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT ){
|
||||
p->rc = rc;
|
||||
sqlite3DbFree(db, p->zErrMsg);
|
||||
p->zErrMsg = 0;
|
||||
|
||||
40
src/vtab.c
40
src/vtab.c
@@ -577,11 +577,11 @@ int sqlite3VtabCallConnect(Parse *pParse, Table *pTab){
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Add the virtual table pVTab to the array sqlite3.aVTrans[].
|
||||
** Grow the db->aVTrans[] array so that there is room for at least one
|
||||
** more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
|
||||
*/
|
||||
static int addToVTrans(sqlite3 *db, VTable *pVTab){
|
||||
static int growVTrans(sqlite3 *db){
|
||||
const int ARRAY_INCR = 5;
|
||||
|
||||
/* Grow the sqlite3.aVTrans array if required */
|
||||
@@ -596,10 +596,17 @@ static int addToVTrans(sqlite3 *db, VTable *pVTab){
|
||||
db->aVTrans = aVTrans;
|
||||
}
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
|
||||
** have already been reserved using growVTrans().
|
||||
*/
|
||||
static void addToVTrans(sqlite3 *db, VTable *pVTab){
|
||||
/* Add pVtab to the end of sqlite3.aVTrans */
|
||||
db->aVTrans[db->nVTrans++] = pVTab;
|
||||
sqlite3VtabLock(pVTab);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -637,7 +644,10 @@ int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){
|
||||
/* Justification of ALWAYS(): The xConstructor method is required to
|
||||
** create a valid sqlite3_vtab if it returns SQLITE_OK. */
|
||||
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){
|
||||
rc = addToVTrans(db, sqlite3GetVTable(db, pTab));
|
||||
rc = growVTrans(db);
|
||||
if( rc==SQLITE_OK ){
|
||||
addToVTrans(db, sqlite3GetVTable(db, pTab));
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -753,6 +763,7 @@ static void callFinaliser(sqlite3 *db, int offset){
|
||||
x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset);
|
||||
if( x ) x(p);
|
||||
}
|
||||
pVTab->iSavepoint = 0;
|
||||
sqlite3VtabUnlock(pVTab);
|
||||
}
|
||||
sqlite3DbFree(db, db->aVTrans);
|
||||
@@ -842,10 +853,14 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){
|
||||
}
|
||||
}
|
||||
|
||||
/* Invoke the xBegin method */
|
||||
rc = pModule->xBegin(pVTab->pVtab);
|
||||
/* Invoke the xBegin method. If successful, add the vtab to the
|
||||
** sqlite3.aVTrans[] array. */
|
||||
rc = growVTrans(db);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = addToVTrans(db, pVTab);
|
||||
rc = pModule->xBegin(pVTab->pVtab);
|
||||
if( rc==SQLITE_OK ){
|
||||
addToVTrans(db, pVTab);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
@@ -870,17 +885,18 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
assert( op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN );
|
||||
assert( iSavepoint>=0 );
|
||||
if( db->aVTrans ){
|
||||
int i;
|
||||
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
|
||||
VTable *pVTab = db->aVTrans[i];
|
||||
const sqlite3_module *pMod = pVTab->pMod->pModule;
|
||||
if( pMod->iVersion>=2 && (pVTab->bInSavepoint || op==SAVEPOINT_BEGIN) ){
|
||||
if( pMod->iVersion>=2 ){
|
||||
int (*xMethod)(sqlite3_vtab *, int);
|
||||
switch( op ){
|
||||
case SAVEPOINT_BEGIN:
|
||||
xMethod = pMod->xSavepoint;
|
||||
pVTab->bInSavepoint = 1;
|
||||
pVTab->iSavepoint = iSavepoint+1;
|
||||
break;
|
||||
case SAVEPOINT_ROLLBACK:
|
||||
xMethod = pMod->xRollbackTo;
|
||||
@@ -889,7 +905,9 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
|
||||
xMethod = pMod->xRelease;
|
||||
break;
|
||||
}
|
||||
if( xMethod ) rc = xMethod(db->aVTrans[i]->pVtab, iSavepoint);
|
||||
if( xMethod && pVTab->iSavepoint>iSavepoint ){
|
||||
rc = xMethod(db->aVTrans[i]->pVtab, iSavepoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user