Changes fts2 to use only sqlite3_malloc() and not system malloc.
Backports (4554) and (4555) from fts3. (CVS 5454) FossilOrigin-Name: ecf2dec66cb979cb7d8db3b7ce5c64cab57fe2bb
This commit is contained in:
parent
29647900e2
commit
b2822a2b5e
114
ext/fts2/fts2.c
114
ext/fts2/fts2.c
@ -470,13 +470,13 @@ static void dataBufferInit(DataBuffer *pBuffer, int nCapacity){
|
||||
assert( nCapacity>=0 );
|
||||
pBuffer->nData = 0;
|
||||
pBuffer->nCapacity = nCapacity;
|
||||
pBuffer->pData = nCapacity==0 ? NULL : malloc(nCapacity);
|
||||
pBuffer->pData = nCapacity==0 ? NULL : sqlite3_malloc(nCapacity);
|
||||
}
|
||||
static void dataBufferReset(DataBuffer *pBuffer){
|
||||
pBuffer->nData = 0;
|
||||
}
|
||||
static void dataBufferDestroy(DataBuffer *pBuffer){
|
||||
if( pBuffer->pData!=NULL ) free(pBuffer->pData);
|
||||
if( pBuffer->pData!=NULL ) sqlite3_free(pBuffer->pData);
|
||||
SCRAMBLE(pBuffer);
|
||||
}
|
||||
static void dataBufferExpand(DataBuffer *pBuffer, int nAddCapacity){
|
||||
@ -487,7 +487,7 @@ static void dataBufferExpand(DataBuffer *pBuffer, int nAddCapacity){
|
||||
*/
|
||||
if( pBuffer->nData+nAddCapacity>pBuffer->nCapacity ){
|
||||
pBuffer->nCapacity = pBuffer->nData+nAddCapacity;
|
||||
pBuffer->pData = realloc(pBuffer->pData, pBuffer->nCapacity);
|
||||
pBuffer->pData = sqlite3_realloc(pBuffer->pData, pBuffer->nCapacity);
|
||||
}
|
||||
}
|
||||
static void dataBufferAppend(DataBuffer *pBuffer,
|
||||
@ -1082,7 +1082,7 @@ static void dlcAddPos(DLCollector *pCollector, int iColumn, int iPos,
|
||||
}
|
||||
|
||||
static DLCollector *dlcNew(sqlite_int64 iDocid, DocListType iType){
|
||||
DLCollector *pCollector = malloc(sizeof(DLCollector));
|
||||
DLCollector *pCollector = sqlite3_malloc(sizeof(DLCollector));
|
||||
dataBufferInit(&pCollector->b, 0);
|
||||
dlwInit(&pCollector->dlw, iType, &pCollector->b);
|
||||
plwInit(&pCollector->plw, &pCollector->dlw, iDocid);
|
||||
@ -1093,7 +1093,7 @@ static void dlcDelete(DLCollector *pCollector){
|
||||
dlwDestroy(&pCollector->dlw);
|
||||
dataBufferDestroy(&pCollector->b);
|
||||
SCRAMBLE(pCollector);
|
||||
free(pCollector);
|
||||
sqlite3_free(pCollector);
|
||||
}
|
||||
|
||||
|
||||
@ -1608,7 +1608,7 @@ static void docListExceptMerge(
|
||||
}
|
||||
|
||||
static char *string_dup_n(const char *s, int n){
|
||||
char *str = malloc(n + 1);
|
||||
char *str = sqlite3_malloc(n + 1);
|
||||
memcpy(str, s, n);
|
||||
str[n] = '\0';
|
||||
return str;
|
||||
@ -1641,7 +1641,7 @@ static char *string_format(const char *zFormat,
|
||||
}
|
||||
len += 1; /* for null terminator */
|
||||
|
||||
r = result = malloc(len);
|
||||
r = result = sqlite3_malloc(len);
|
||||
for(p = zFormat; *p; ++p){
|
||||
if( *p=='%' ){
|
||||
memcpy(r, zDb, nDb);
|
||||
@ -1664,7 +1664,7 @@ static int sql_exec(sqlite3 *db, const char *zDb, const char *zName,
|
||||
int rc;
|
||||
TRACE(("FTS2 sql: %s\n", zCommand));
|
||||
rc = sqlite3_exec(db, zCommand, NULL, 0, NULL);
|
||||
free(zCommand);
|
||||
sqlite3_free(zCommand);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -1674,7 +1674,7 @@ static int sql_prepare(sqlite3 *db, const char *zDb, const char *zName,
|
||||
int rc;
|
||||
TRACE(("FTS2 prepare: %s\n", zCommand));
|
||||
rc = sqlite3_prepare_v2(db, zCommand, -1, ppStmt, NULL);
|
||||
free(zCommand);
|
||||
sqlite3_free(zCommand);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -1938,7 +1938,7 @@ static int sql_get_statement(fulltext_vtab *v, fulltext_statement iStmt,
|
||||
}
|
||||
rc = sql_prepare(v->db, v->zDb, v->zName, &v->pFulltextStatements[iStmt],
|
||||
zStmt);
|
||||
if( zStmt != fulltext_zStatement[iStmt]) free((void *) zStmt);
|
||||
if( zStmt != fulltext_zStatement[iStmt]) sqlite3_free((void *) zStmt);
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
} else {
|
||||
int rc = sqlite3_reset(v->pFulltextStatements[iStmt]);
|
||||
@ -2023,9 +2023,9 @@ static void freeStringArray(int nString, const char **pString){
|
||||
int i;
|
||||
|
||||
for (i=0 ; i < nString ; ++i) {
|
||||
if( pString[i]!=NULL ) free((void *) pString[i]);
|
||||
if( pString[i]!=NULL ) sqlite3_free((void *) pString[i]);
|
||||
}
|
||||
free((void *) pString);
|
||||
sqlite3_free((void *) pString);
|
||||
}
|
||||
|
||||
/* select * from %_content where rowid = [iRow]
|
||||
@ -2052,7 +2052,7 @@ static int content_select(fulltext_vtab *v, sqlite_int64 iRow,
|
||||
rc = sqlite3_step(s);
|
||||
if( rc!=SQLITE_ROW ) return rc;
|
||||
|
||||
values = (const char **) malloc(v->nColumn * sizeof(const char *));
|
||||
values = (const char **) sqlite3_malloc(v->nColumn * sizeof(const char *));
|
||||
for(i=0; i<v->nColumn; ++i){
|
||||
if( sqlite3_column_type(s, i)==SQLITE_NULL ){
|
||||
values[i] = NULL;
|
||||
@ -2294,12 +2294,12 @@ static void fulltext_vtab_destroy(fulltext_vtab *v){
|
||||
|
||||
clearPendingTerms(v);
|
||||
|
||||
free(v->azColumn);
|
||||
sqlite3_free(v->azColumn);
|
||||
for(i = 0; i < v->nColumn; ++i) {
|
||||
sqlite3_free(v->azContentColumn[i]);
|
||||
}
|
||||
free(v->azContentColumn);
|
||||
free(v);
|
||||
sqlite3_free(v->azContentColumn);
|
||||
sqlite3_free(v);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2410,7 +2410,7 @@ typedef struct Token {
|
||||
*/
|
||||
static char **tokenizeString(const char *z, int *pnToken){
|
||||
int nToken = 0;
|
||||
Token *aToken = malloc( strlen(z) * sizeof(aToken[0]) );
|
||||
Token *aToken = sqlite3_malloc( strlen(z) * sizeof(aToken[0]) );
|
||||
int n = 1;
|
||||
int e, i;
|
||||
int totalSize = 0;
|
||||
@ -2426,7 +2426,7 @@ static char **tokenizeString(const char *z, int *pnToken){
|
||||
}
|
||||
z += n;
|
||||
}
|
||||
azToken = (char**)malloc( nToken*sizeof(char*) + totalSize );
|
||||
azToken = (char**)sqlite3_malloc( nToken*sizeof(char*) + totalSize );
|
||||
zCopy = (char*)&azToken[nToken];
|
||||
nToken--;
|
||||
for(i=0; i<nToken; i++){
|
||||
@ -2437,7 +2437,7 @@ static char **tokenizeString(const char *z, int *pnToken){
|
||||
zCopy += n+1;
|
||||
}
|
||||
azToken[nToken] = 0;
|
||||
free(aToken);
|
||||
sqlite3_free(aToken);
|
||||
*pnToken = nToken;
|
||||
return azToken;
|
||||
}
|
||||
@ -2575,9 +2575,9 @@ typedef struct TableSpec {
|
||||
** Reclaim all of the memory used by a TableSpec
|
||||
*/
|
||||
static void clearTableSpec(TableSpec *p) {
|
||||
free(p->azColumn);
|
||||
free(p->azContentColumn);
|
||||
free(p->azTokenizer);
|
||||
sqlite3_free(p->azColumn);
|
||||
sqlite3_free(p->azContentColumn);
|
||||
sqlite3_free(p->azTokenizer);
|
||||
}
|
||||
|
||||
/* Parse a CREATE VIRTUAL TABLE statement, which looks like this:
|
||||
@ -2612,7 +2612,7 @@ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv,
|
||||
for(i=n=0; i<argc; i++){
|
||||
n += strlen(argv[i]) + 1;
|
||||
}
|
||||
azArg = malloc( sizeof(char*)*argc + n );
|
||||
azArg = sqlite3_malloc( sizeof(char*)*argc + n );
|
||||
if( azArg==0 ){
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
@ -2657,7 +2657,7 @@ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv,
|
||||
** for the convenience of people who might examine the generated
|
||||
** %_content table and wonder what the columns are used for.
|
||||
*/
|
||||
pSpec->azContentColumn = malloc( pSpec->nColumn * sizeof(char *) );
|
||||
pSpec->azContentColumn = sqlite3_malloc( pSpec->nColumn * sizeof(char *) );
|
||||
if( pSpec->azContentColumn==0 ){
|
||||
clearTableSpec(pSpec);
|
||||
return SQLITE_NOMEM;
|
||||
@ -2726,7 +2726,7 @@ static int constructVtab(
|
||||
char const *zTok; /* Name of tokenizer to use for this fts table */
|
||||
int nTok; /* Length of zTok, including nul terminator */
|
||||
|
||||
v = (fulltext_vtab *) malloc(sizeof(fulltext_vtab));
|
||||
v = (fulltext_vtab *) sqlite3_malloc(sizeof(fulltext_vtab));
|
||||
if( v==0 ) return SQLITE_NOMEM;
|
||||
CLEAR(v);
|
||||
/* sqlite will initialize v->base */
|
||||
@ -2913,12 +2913,16 @@ static int fulltextDestroy(sqlite3_vtab *pVTab){
|
||||
static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
|
||||
fulltext_cursor *c;
|
||||
|
||||
c = (fulltext_cursor *) calloc(sizeof(fulltext_cursor), 1);
|
||||
/* sqlite will initialize c->base */
|
||||
*ppCursor = &c->base;
|
||||
TRACE(("FTS2 Open %p: %p\n", pVTab, c));
|
||||
|
||||
return SQLITE_OK;
|
||||
c = (fulltext_cursor *) sqlite3_malloc(sizeof(fulltext_cursor));
|
||||
if( c ){
|
||||
memset(c, 0, sizeof(fulltext_cursor));
|
||||
/* sqlite will initialize c->base */
|
||||
*ppCursor = &c->base;
|
||||
TRACE(("FTS2 Open %p: %p\n", pVTab, c));
|
||||
return SQLITE_OK;
|
||||
}else{
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2927,9 +2931,9 @@ static int fulltextOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
|
||||
static void queryClear(Query *q){
|
||||
int i;
|
||||
for(i = 0; i < q->nTerms; ++i){
|
||||
free(q->pTerms[i].pTerm);
|
||||
sqlite3_free(q->pTerms[i].pTerm);
|
||||
}
|
||||
free(q->pTerms);
|
||||
sqlite3_free(q->pTerms);
|
||||
CLEAR(q);
|
||||
}
|
||||
|
||||
@ -2937,9 +2941,9 @@ static void queryClear(Query *q){
|
||||
** Snippet
|
||||
*/
|
||||
static void snippetClear(Snippet *p){
|
||||
free(p->aMatch);
|
||||
free(p->zOffset);
|
||||
free(p->zSnippet);
|
||||
sqlite3_free(p->aMatch);
|
||||
sqlite3_free(p->zOffset);
|
||||
sqlite3_free(p->zSnippet);
|
||||
CLEAR(p);
|
||||
}
|
||||
/*
|
||||
@ -2954,7 +2958,7 @@ static void snippetAppendMatch(
|
||||
struct snippetMatch *pMatch;
|
||||
if( p->nMatch+1>=p->nAlloc ){
|
||||
p->nAlloc = p->nAlloc*2 + 10;
|
||||
p->aMatch = realloc(p->aMatch, p->nAlloc*sizeof(p->aMatch[0]) );
|
||||
p->aMatch = sqlite3_realloc(p->aMatch, p->nAlloc*sizeof(p->aMatch[0]) );
|
||||
if( p->aMatch==0 ){
|
||||
p->nMatch = 0;
|
||||
p->nAlloc = 0;
|
||||
@ -3181,7 +3185,7 @@ static void snippetText(
|
||||
int iMatch;
|
||||
|
||||
|
||||
free(pCursor->snippet.zSnippet);
|
||||
sqlite3_free(pCursor->snippet.zSnippet);
|
||||
pCursor->snippet.zSnippet = 0;
|
||||
aMatch = pCursor->snippet.aMatch;
|
||||
nMatch = pCursor->snippet.nMatch;
|
||||
@ -3283,7 +3287,7 @@ static int fulltextClose(sqlite3_vtab_cursor *pCursor){
|
||||
snippetClear(&c->snippet);
|
||||
if( c->result.nData!=0 ) dlrDestroy(&c->reader);
|
||||
dataBufferDestroy(&c->result);
|
||||
free(c);
|
||||
sqlite3_free(c);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -3388,14 +3392,14 @@ static int docListOfTerm(
|
||||
static void queryAdd(Query *q, const char *pTerm, int nTerm){
|
||||
QueryTerm *t;
|
||||
++q->nTerms;
|
||||
q->pTerms = realloc(q->pTerms, q->nTerms * sizeof(q->pTerms[0]));
|
||||
q->pTerms = sqlite3_realloc(q->pTerms, q->nTerms * sizeof(q->pTerms[0]));
|
||||
if( q->pTerms==0 ){
|
||||
q->nTerms = 0;
|
||||
return;
|
||||
}
|
||||
t = &q->pTerms[q->nTerms - 1];
|
||||
CLEAR(t);
|
||||
t->pTerm = malloc(nTerm+1);
|
||||
t->pTerm = sqlite3_malloc(nTerm+1);
|
||||
memcpy(t->pTerm, pTerm, nTerm);
|
||||
t->pTerm[nTerm] = 0;
|
||||
t->nTerm = nTerm;
|
||||
@ -3959,18 +3963,20 @@ typedef struct InteriorBlock {
|
||||
|
||||
static InteriorBlock *interiorBlockNew(int iHeight, sqlite_int64 iChildBlock,
|
||||
const char *pTerm, int nTerm){
|
||||
InteriorBlock *block = calloc(1, sizeof(InteriorBlock));
|
||||
InteriorBlock *block = sqlite3_malloc(sizeof(InteriorBlock));
|
||||
char c[VARINT_MAX+VARINT_MAX];
|
||||
int n;
|
||||
|
||||
dataBufferInit(&block->term, 0);
|
||||
dataBufferReplace(&block->term, pTerm, nTerm);
|
||||
|
||||
n = putVarint(c, iHeight);
|
||||
n += putVarint(c+n, iChildBlock);
|
||||
dataBufferInit(&block->data, INTERIOR_MAX);
|
||||
dataBufferReplace(&block->data, c, n);
|
||||
if( block ){
|
||||
memset(block, 0, sizeof(*block));
|
||||
dataBufferInit(&block->term, 0);
|
||||
dataBufferReplace(&block->term, pTerm, nTerm);
|
||||
|
||||
n = putVarint(c, iHeight);
|
||||
n += putVarint(c+n, iChildBlock);
|
||||
dataBufferInit(&block->data, INTERIOR_MAX);
|
||||
dataBufferReplace(&block->data, c, n);
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
@ -4135,11 +4141,11 @@ static int interiorWriterDestroy(InteriorWriter *pWriter){
|
||||
block = block->next;
|
||||
dataBufferDestroy(&b->term);
|
||||
dataBufferDestroy(&b->data);
|
||||
free(b);
|
||||
sqlite3_free(b);
|
||||
}
|
||||
if( pWriter->parentWriter!=NULL ){
|
||||
interiorWriterDestroy(pWriter->parentWriter);
|
||||
free(pWriter->parentWriter);
|
||||
sqlite3_free(pWriter->parentWriter);
|
||||
}
|
||||
dataBufferDestroy(&pWriter->term);
|
||||
SCRAMBLE(pWriter);
|
||||
@ -4173,7 +4179,7 @@ static int interiorWriterRootInfo(fulltext_vtab *v, InteriorWriter *pWriter,
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
*piEndBlockid = iBlockid;
|
||||
|
||||
pWriter->parentWriter = malloc(sizeof(*pWriter->parentWriter));
|
||||
pWriter->parentWriter = sqlite3_malloc(sizeof(*pWriter->parentWriter));
|
||||
interiorWriterInit(pWriter->iHeight+1,
|
||||
block->term.pData, block->term.nData,
|
||||
iBlockid, pWriter->parentWriter);
|
||||
@ -5563,7 +5569,7 @@ static int writeZeroSegment(fulltext_vtab *v, fts2Hash *pTerms){
|
||||
if( rc!=SQLITE_OK ) return rc;
|
||||
|
||||
n = fts2HashCount(pTerms);
|
||||
pData = malloc(n*sizeof(TermData));
|
||||
pData = sqlite3_malloc(n*sizeof(TermData));
|
||||
|
||||
for(i = 0, e = fts2HashFirst(pTerms); e; i++, e = fts2HashNext(e)){
|
||||
assert( i<n );
|
||||
@ -5594,7 +5600,7 @@ static int writeZeroSegment(fulltext_vtab *v, fts2Hash *pTerms){
|
||||
|
||||
err:
|
||||
dataBufferDestroy(&dl);
|
||||
free(pData);
|
||||
sqlite3_free(pData);
|
||||
leafWriterDestroy(&writer);
|
||||
return rc;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include "fts2_hash.h"
|
||||
|
||||
/*
|
||||
|
@ -66,9 +66,9 @@ static int porterCreate(
|
||||
sqlite3_tokenizer **ppTokenizer
|
||||
){
|
||||
porter_tokenizer *t;
|
||||
t = (porter_tokenizer *) calloc(sizeof(*t), 1);
|
||||
t = (porter_tokenizer *) sqlite3_malloc(sizeof(*t));
|
||||
if( t==NULL ) return SQLITE_NOMEM;
|
||||
|
||||
memset(t, 0, sizeof(*t));
|
||||
*ppTokenizer = &t->base;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -77,7 +77,7 @@ static int porterCreate(
|
||||
** Destroy a tokenizer
|
||||
*/
|
||||
static int porterDestroy(sqlite3_tokenizer *pTokenizer){
|
||||
free(pTokenizer);
|
||||
sqlite3_free(pTokenizer);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ static int porterOpen(
|
||||
){
|
||||
porter_tokenizer_cursor *c;
|
||||
|
||||
c = (porter_tokenizer_cursor *) malloc(sizeof(*c));
|
||||
c = (porter_tokenizer_cursor *) sqlite3_malloc(sizeof(*c));
|
||||
if( c==NULL ) return SQLITE_NOMEM;
|
||||
|
||||
c->zInput = zInput;
|
||||
@ -120,8 +120,8 @@ static int porterOpen(
|
||||
*/
|
||||
static int porterClose(sqlite3_tokenizer_cursor *pCursor){
|
||||
porter_tokenizer_cursor *c = (porter_tokenizer_cursor *) pCursor;
|
||||
free(c->zToken);
|
||||
free(c);
|
||||
sqlite3_free(c->zToken);
|
||||
sqlite3_free(c);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
/*
|
||||
@ -603,7 +603,7 @@ static int porterNext(
|
||||
int n = c->iOffset-iStartOffset;
|
||||
if( n>c->nAllocated ){
|
||||
c->nAllocated = n+20;
|
||||
c->zToken = realloc(c->zToken, c->nAllocated);
|
||||
c->zToken = sqlite3_realloc(c->zToken, c->nAllocated);
|
||||
if( c->zToken==NULL ) return SQLITE_NOMEM;
|
||||
}
|
||||
porter_stemmer(&z[iStartOffset], n, c->zToken, pnBytes);
|
||||
|
@ -65,8 +65,9 @@ static int simpleCreate(
|
||||
){
|
||||
simple_tokenizer *t;
|
||||
|
||||
t = (simple_tokenizer *) calloc(sizeof(*t), 1);
|
||||
t = (simple_tokenizer *) sqlite3_malloc(sizeof(*t));
|
||||
if( t==NULL ) return SQLITE_NOMEM;
|
||||
memset(t, 0, sizeof(*t));
|
||||
|
||||
/* TODO(shess) Delimiters need to remain the same from run to run,
|
||||
** else we need to reindex. One solution would be a meta-table to
|
||||
@ -79,7 +80,7 @@ static int simpleCreate(
|
||||
unsigned char ch = argv[1][i];
|
||||
/* We explicitly don't support UTF-8 delimiters for now. */
|
||||
if( ch>=0x80 ){
|
||||
free(t);
|
||||
sqlite3_free(t);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
t->delim[ch] = 1;
|
||||
@ -100,7 +101,7 @@ static int simpleCreate(
|
||||
** Destroy a tokenizer
|
||||
*/
|
||||
static int simpleDestroy(sqlite3_tokenizer *pTokenizer){
|
||||
free(pTokenizer);
|
||||
sqlite3_free(pTokenizer);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -117,7 +118,7 @@ static int simpleOpen(
|
||||
){
|
||||
simple_tokenizer_cursor *c;
|
||||
|
||||
c = (simple_tokenizer_cursor *) malloc(sizeof(*c));
|
||||
c = (simple_tokenizer_cursor *) sqlite3_malloc(sizeof(*c));
|
||||
if( c==NULL ) return SQLITE_NOMEM;
|
||||
|
||||
c->pInput = pInput;
|
||||
@ -143,8 +144,8 @@ static int simpleOpen(
|
||||
*/
|
||||
static int simpleClose(sqlite3_tokenizer_cursor *pCursor){
|
||||
simple_tokenizer_cursor *c = (simple_tokenizer_cursor *) pCursor;
|
||||
free(c->pToken);
|
||||
free(c);
|
||||
sqlite3_free(c->pToken);
|
||||
sqlite3_free(c);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@ -182,7 +183,7 @@ static int simpleNext(
|
||||
int i, n = c->iOffset-iStartOffset;
|
||||
if( n>c->nTokenAllocated ){
|
||||
c->nTokenAllocated = n+20;
|
||||
c->pToken = realloc(c->pToken, c->nTokenAllocated);
|
||||
c->pToken = sqlite3_realloc(c->pToken, c->nTokenAllocated);
|
||||
if( c->pToken==NULL ) return SQLITE_NOMEM;
|
||||
}
|
||||
for(i=0; i<n; i++){
|
||||
|
19
manifest
19
manifest
@ -1,5 +1,5 @@
|
||||
C fts2.c\sbuildTerms()\spasses\s-1\sfor\snInput.\r\nBackports\s(4511)\sfrom\sfts3.\s(CVS\s5453)
|
||||
D 2008-07-22T22:20:50
|
||||
C Changes\sfts2\sto\suse\sonly\ssqlite3_malloc()\sand\snot\ssystem\smalloc.\r\nBackports\s(4554)\sand\s(4555)\sfrom\sfts3.\s(CVS\s5454)
|
||||
D 2008-07-22T22:57:54
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in 77ff156061bb870aa0a8b3d545c670d08070f7e6
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@ -39,15 +39,15 @@ F ext/fts1/simple_tokenizer.c 1844d72f7194c3fd3d7e4173053911bf0661b70d
|
||||
F ext/fts1/tokenizer.h 0c53421b832366d20d720d21ea3e1f6e66a36ef9
|
||||
F ext/fts2/README.tokenizers 21e3684ea5a095b55d70f6878b4ce6af5932dfb7
|
||||
F ext/fts2/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts2/fts2.c 015d44a43d2a3586cd31b29f7fc1c60f21628dc3
|
||||
F ext/fts2/fts2.c f50c7faca742f40b14a2b279d652594c532e6523
|
||||
F ext/fts2/fts2.h da5f76c65163301d1068a971fd32f4119e3c95fa
|
||||
F ext/fts2/fts2_hash.c 25ad8043ce2e708840a8fb179b8ed04325f860eb
|
||||
F ext/fts2/fts2_hash.c 2689e42e1107ea67207f725cf69cf8972d00cf93
|
||||
F ext/fts2/fts2_hash.h 9a5b1be94664139f93217a0770d7144425cffb3a
|
||||
F ext/fts2/fts2_icu.c 53162e0dbe6d27a0cc24ad2c10cea8c48b7c839b
|
||||
F ext/fts2/fts2_porter.c 98c9dbd1eed20032c03ce05877164e262567443e
|
||||
F ext/fts2/fts2_porter.c 8a6369b0fae98c04db95e4fa95fac7c03d7182ec
|
||||
F ext/fts2/fts2_tokenizer.c 5cec41326fabe65323945a46fa9495ee85c3d5fd
|
||||
F ext/fts2/fts2_tokenizer.h a7e46462d935a314b2682287f12f27530a3ee08e
|
||||
F ext/fts2/fts2_tokenizer1.c 8a545c232bdffafd117c4eeaf59789691909f26a
|
||||
F ext/fts2/fts2_tokenizer1.c 8545ce12b41922004da46e91a7b023b92b76f94e
|
||||
F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
|
||||
F ext/fts3/README.tokenizers 226644a0eab97724e8de83061912e8bb248461b6
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
@ -299,6 +299,7 @@ F test/fts1m.test 2d9ca67b095d49f037a914087cc0a61e89da4f0c
|
||||
F test/fts1n.test a2317dcd27b1d087ee3878b30e0a59c593c98b7a
|
||||
F test/fts1o.test 382b8b07a2d6de5610814d9477117c4430464b9c
|
||||
F test/fts1porter.test d86e9c3e0c7f8ff95add6582b4b585fb4e02b96d
|
||||
F test/fts2.test 83704ba4d7956f6646c0c5192a0b16df61e4b2af
|
||||
F test/fts2a.test 473a5c8b473a4e21a8e3fddaed1e59666e0c6ab7
|
||||
F test/fts2b.test 964abc0236c849c07ca1ae496bb25c268ae94816
|
||||
F test/fts2c.test ffb5a35230ac72c4354535c547965ce6824537c0
|
||||
@ -608,7 +609,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
P e31d2f875c13ee41742c9aaee6291662cdbbf863
|
||||
R 6376acd2dc63d085f9c9b21e576d7486
|
||||
P d562515e1cdd05212674516033c64b5f5668b799
|
||||
R 2682d383bee51312a260e3583fb091fa
|
||||
U shess
|
||||
Z 32663cd2dfd230cb3d5b37a9b5daa7ee
|
||||
Z 7b59d5a322f77dacbe20c5139c2b6d35
|
||||
|
@ -1 +1 @@
|
||||
d562515e1cdd05212674516033c64b5f5668b799
|
||||
ecf2dec66cb979cb7d8db3b7ce5c64cab57fe2bb
|
68
test/fts2.test
Normal file
68
test/fts2.test
Normal file
@ -0,0 +1,68 @@
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file runs all tests.
|
||||
#
|
||||
# $Id: fts2.test,v 1.1 2008/07/22 22:57:54 shess Exp $
|
||||
|
||||
proc lshift {lvar} {
|
||||
upvar $lvar l
|
||||
set ret [lindex $l 0]
|
||||
set l [lrange $l 1 end]
|
||||
return $ret
|
||||
}
|
||||
while {[set arg [lshift argv]] != ""} {
|
||||
switch -- $arg {
|
||||
-sharedpagercache {
|
||||
sqlite3_enable_shared_cache 1
|
||||
}
|
||||
-soak {
|
||||
set SOAKTEST 1
|
||||
}
|
||||
default {
|
||||
set argv [linsert $argv 0 $arg]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
# If SQLITE_ENABLE_FTS2 is defined, omit this file.
|
||||
ifcapable !fts2 {
|
||||
puts stderr "this build does not include FTS2 capability"
|
||||
exit 1
|
||||
}
|
||||
rename finish_test really_finish_test
|
||||
proc finish_test {} {}
|
||||
set ISQUICK 1
|
||||
|
||||
set EXCLUDE {
|
||||
fts2.test
|
||||
}
|
||||
|
||||
# Files to include in the test. If this list is empty then everything
|
||||
# that is not in the EXCLUDE list is run.
|
||||
#
|
||||
set INCLUDE {
|
||||
}
|
||||
|
||||
foreach testfile [lsort -dictionary [glob $testdir/fts2*.test]] {
|
||||
set tail [file tail $testfile]
|
||||
if {[lsearch -exact $EXCLUDE $tail]>=0} continue
|
||||
if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
|
||||
source $testfile
|
||||
catch {db close}
|
||||
if {$sqlite_open_file_count>0} {
|
||||
puts "$tail did not close all files: $sqlite_open_file_count"
|
||||
incr nErr
|
||||
lappend ::failList $tail
|
||||
set sqlite_open_file_count 0
|
||||
}
|
||||
}
|
||||
|
||||
set sqlite_open_file_count 0
|
||||
really_finish_test
|
Loading…
x
Reference in New Issue
Block a user