Home | History | Annotate | Download | only in dist

Lines Matching defs:pConfig

166359 static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig);
166362 Fts5Config *pConfig, /* FTS5 Configuration object */
166485 static int sqlite3Fts5IndexOpen(Fts5Config *pConfig, int bCreate, Fts5Index**, char**);
166770 Fts5Config *pConfig,
169127 ** configuration object pConfig as appropriate.
169129 ** If successful, object pConfig is updated and SQLITE_OK returned. If
169136 Fts5Config *pConfig, /* Configuration object to update */
169146 if( pConfig->aPrefix ){
169150 pConfig->aPrefix = sqlite3Fts5MallocZero(&rc, nByte);
169171 pConfig->aPrefix[pConfig->nPrefix] = nPre;
169172 pConfig->nPrefix++;
169185 if( pConfig->pTok ){
169209 (const char**)azArg, nArg, &pConfig->pTok, &pConfig->pTokApi,
169222 if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){
169227 pConfig->eContent = FTS5_CONTENT_EXTERNAL;
169228 pConfig->zContent = sqlite3Fts5Mprintf(&rc, "%Q.%Q", pConfig->zDb,zArg);
169230 pConfig->eContent = FTS5_CONTENT_NONE;
169237 if( pConfig->zContentRowid ){
169241 pConfig->zContentRowid = sqlite3Fts5Strndup(&rc, zArg, -1);
169251 pConfig->bColumnsize = (zArg[0]=='1');
169265 static int fts5ConfigDefaultTokenizer(Fts5Global *pGlobal, Fts5Config *pConfig){
169266 assert( pConfig->pTok==0 && pConfig->pTokApi==0 );
169268 pGlobal, 0, 0, &pConfig->pTok, &pConfig->pTokApi, 0
169504 static void sqlite3Fts5ConfigFree(Fts5Config *pConfig){
169505 if( pConfig ){
169507 if( pConfig->pTok ){
169508 pConfig->pTokApi->xDelete(pConfig->pTok);
169510 sqlite3_free(pConfig->zDb);
169511 sqlite3_free(pConfig->zName);
169512 for(i=0; i<pConfig->nCol; i++){
169513 sqlite3_free(pConfig->azCol[i]);
169515 sqlite3_free(pConfig->azCol);
169516 sqlite3_free(pConfig->aPrefix);
169517 sqlite3_free(pConfig->zRank);
169518 sqlite3_free(pConfig->zRankArgs);
169519 sqlite3_free(pConfig->zContent);
169520 sqlite3_free(pConfig->zContentRowid);
169521 sqlite3_free(pConfig->zContentExprlist);
169522 sqlite3_free(pConfig);
169531 static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){
169537 for(i=0; zSql && i<pConfig->nCol; i++){
169539 zSql = sqlite3Fts5Mprintf(&rc, "%z%s%Q", zSql, zSep, pConfig->azCol[i]);
169542 zSql, pConfig->zName, FTS5_RANK_NAME
169547 rc = sqlite3_declare_vtab(pConfig->db, zSql);
169578 Fts5Config *pConfig, /* FTS5 Configuration object */
169585 return pConfig->pTokApi->xTokenize(
169586 pConfig->pTok, pCtx, flags, pText, nText, xToken
169679 Fts5Config *pConfig,
169694 pConfig->pgsz = pgsz;
169707 pConfig->nAutomerge = nAutomerge;
169720 pConfig->nCrisisMerge = nCrisisMerge;
169730 sqlite3_free(pConfig->zRank);
169731 sqlite3_free(pConfig->zRankArgs);
169732 pConfig->zRank = zRank;
169733 pConfig->zRankArgs = zRankArgs;
169747 static int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){
169755 pConfig->pgsz = FTS5_DEFAULT_PAGE_SIZE;
169756 pConfig->nAutomerge = FTS5_DEFAULT_AUTOMERGE;
169757 pConfig->nCrisisMerge = FTS5_DEFAULT_CRISISMERGE;
169759 zSql = sqlite3Fts5Mprintf(&rc, zSelect, pConfig->zDb, pConfig->zName);
169761 rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &p, 0);
169774 sqlite3Fts5ConfigSetValue(pConfig, zK, pVal, &bDummy);
169782 if( pConfig->pzErrmsg ){
169783 assert( 0==*pConfig->pzErrmsg );
169784 *pConfig->pzErrmsg = sqlite3_mprintf(
169792 pConfig->iCookie = iCookie;
169908 Fts5Config *pConfig;
169999 Fts5Config *pConfig, /* FTS5 Configuration */
170016 sParse.pConfig = pConfig;
171303 Fts5Config *pConfig = pParse->pConfig;
171317 rc = sqlite3Fts5Tokenize(pConfig, flags, z, n, &sCtx, fts5ParseTokenize);
171354 Fts5Config *pConfig,
171477 assert( iCol>=0 && iCol<pParse->pConfig->nCol );
171515 Fts5Config *pConfig = pParse->pConfig;
171517 for(iCol=0; iCol<pConfig->nCol; iCol++){
171518 if( 0==sqlite3_stricmp(pConfig->azCol[iCol], z) ) break;
171520 if( iCol==pConfig->nCol ){
171678 Fts5Config *pConfig,
171740 char *z = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->apChild[i]);
171753 static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){
171762 zRet = fts5PrintfAppend(zRet, "%s : ", pConfig->azCol[iCol]);
171809 char *z = fts5ExprPrint(pConfig, pExpr->apChild[i]);
171849 Fts5Config *pConfig = 0;
171881 rc = sqlite3Fts5ConfigParse(pGlobal, db, nConfig, azConfig, &pConfig, &zErr);
171883 rc = sqlite3Fts5ExprNew(pConfig, zExpr, &pExpr, &zErr);
171890 zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot);
171892 zText = fts5ExprPrint(pConfig, pExpr->pRoot);
171911 sqlite3Fts5ConfigFree(pConfig);
172785 Fts5Config *pConfig; /* Virtual table configuration */
173167 Fts5Config *pConfig = p->pConfig;
173168 rc = sqlite3_blob_open(pConfig->db,
173169 pConfig->zDb, p->zDataTbl, "block", iRowid, 0, &p->pReader
173226 p->rc = sqlite3_prepare_v2(p->pConfig->db, zSql, -1, ppStmt, 0);
173243 Fts5Config *pConfig = p->pConfig;
173246 pConfig->zDb, pConfig->zName
173267 Fts5Config *pConfig = p->pConfig;
173270 pConfig->zDb, pConfig->zName
173275 rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &p->pDeleter, 0);
173298 Fts5Config *pConfig = p->pConfig;
173301 pConfig->zDb, pConfig->zName
173474 Fts5Config *pConfig = p->pConfig;
173484 if( p->rc==SQLITE_OK && pConfig->iCookie!=iCookie ){
173485 p->rc = sqlite3Fts5ConfigLoad(pConfig, iCookie);
173530 iCookie = p->pConfig->iCookie;
174607 Fts5Config *pConfig = p->pConfig;
174611 pConfig->zDb, pConfig->zName
175567 if( pDlidx->buf.n>=p->pConfig->pgsz ){
175675 if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){
175748 if( (pPage->buf.n + pPage->pgidx.n)>=p->pConfig->pgsz ){
175785 assert( p->pConfig->pgsz>0 );
175787 && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz
175789 int nReq = p->pConfig->pgsz - pPage->buf.n - pPage->pgidx.n;
175840 const int nBuffer = p->pConfig->pgsz + FTS5_DATA_PADDING;
175855 Fts5Config *pConfig = p->pConfig;
175858 pConfig->zDb, pConfig->zName
176114 if( nBest<p->pConfig->nAutomerge
176140 if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 ){
176160 const int nCrisis = p->pConfig->nCrisisMerge;
176235 const int pgsz = p->pConfig->pgsz;
176954 Fts5Config *pConfig,
176964 p->pConfig = pConfig;
176967 p->zDataTbl = sqlite3Fts5Mprintf(&rc, "%s_data", pConfig->zName);
176970 pConfig, "data", "id INTEGER PRIMARY KEY, block BLOB", 0, pzErr
176973 rc = sqlite3Fts5CreateTable(pConfig, "idx",
177062 Fts5Config *pConfig = p->pConfig;
177072 for(i=0; i<pConfig->nPrefix && rc==SQLITE_OK; i++){
177073 int nByte = fts5IndexCharlenToBytelen(pToken, nToken, pConfig->aPrefix[i]);
177095 Fts5Config *pConfig = p->pConfig;
177114 if( pConfig->bPrefixIndex==0 || (flags & FTS5INDEX_QUERY_TEST_NOIDX) ){
177116 iIdx = 1+pConfig->nPrefix;
177121 for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){
177122 if( pConfig->aPrefix[iIdx-1]==nChar ) break;
177126 if( iIdx<=pConfig->nPrefix ){
177309 int nCol = p->pConfig->nCol;
177355 Fts5Config *pConfig = p->pConfig; /* Configuration object */
177362 rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl,
177644 Fts5Config *pConfig = p->pConfig;
177654 pConfig->zDb, pConfig->zName, pSeg->iSegid
177861 Fts5Config *pConfig, /* Configuration object */
177872 for(iIdx=0; iIdx<pConfig->nPrefix; iIdx++){
177873 int nByte = fts5IndexCharlenToBytelen(pTerm, nTerm, pConfig->aPrefix[iIdx]);
178356 Fts5Config *pConfig; /* Virtual table configuration */
178547 return pTab->pConfig->eContent==FTS5_CONTENT_NONE;
178557 sqlite3Fts5ConfigFree(pTab->pConfig);
178575 int rc = sqlite3Fts5DropAll(pTab->pConfig);
178605 Fts5Config *pConfig = 0; /* Results of parsing argc/argv */
178611 rc = sqlite3Fts5ConfigParse(pGlobal, db, argc, azConfig, &pConfig, pzErr);
178612 assert( (rc==SQLITE_OK && *pzErr==0) || pConfig==0 );
178615 pTab->pConfig = pConfig;
178621 rc = sqlite3Fts5IndexOpen(pConfig, bCreate, &pTab->pIndex, pzErr);
178627 pConfig, pTab->pIndex, bCreate, &pTab->pStorage, pzErr
178633 rc = sqlite3Fts5ConfigDeclareVtab(pConfig);
178733 Fts5Config *pConfig = pTab->pConfig;
178759 aColMap[1] = pConfig->nCol;
178760 aColMap[2] = pConfig->nCol+1;
178785 if( iSort==(pConfig->nCol+1) && BitFlagTest(idxFlags, FTS5_BI_MATCH) ){
178830 Fts5Config *pConfig = pTab->pConfig;
178835 nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
179068 Fts5Config *pConfig = pTab->pConfig;
179093 pConfig->zDb, pConfig->zName, zRank, pConfig->zName,
179099 rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pSorter->pStmt, 0);
179186 Fts5Config *pConfig = pTab->pConfig;
179196 rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pStmt, 0);
179235 Fts5Config *pConfig,
179260 if( pConfig->zRank ){
179261 pCsr->zRank = (char*)pConfig->zRank;
179262 pCsr->zRankArgs = (char*)pConfig->zRankArgs;
179300 Fts5Config *pConfig = pTab->pConfig;
179311 char **pzErrmsg = pConfig->pzErrmsg;
179326 pConfig->pzErrmsg = &pTab->base.zErrMsg;
179375 rc = fts5CursorParseRank(pConfig, pCsr, pRank);
179384 rc = sqlite3Fts5ExprNew(pConfig, zExpr, &pCsr->pExpr, pzErr);
179396 }else if( pConfig->zContent==0 ){
179397 *pConfig->pzErrmsg = sqlite3_mprintf(
179398 "%s: table does not support scanning", pConfig->zName
179419 pConfig->pzErrmsg = pzErrmsg;
179544 Fts5Config *pConfig = pTab->pConfig;
179549 if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
179559 if( pConfig->eContent==FTS5_CONTENT_NONE ){
179576 pConfig->bPrefixIndex = sqlite3_value_int(pVal);
179581 rc = sqlite3Fts5ConfigSetValue(pTab->pConfig, zCmd, pVal, &bError);
179645 Fts5Config *pConfig = pTab->pConfig;
179653 assert( nArg==1 || nArg==(2+pConfig->nCol+2) );
179658 assert( pTab->pConfig->pzErrmsg==0 );
179659 pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg;
179666 && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL
179669 const char *z = (const char*)sqlite3_value_text(apVal[2+pConfig->nCol]);
179670 if( pConfig->eContent!=FTS5_CONTENT_NORMAL
179675 rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]);
179689 int eConflict = sqlite3_vtab_on_conflict(pConfig->db);
179699 (nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName
179749 pTab->pConfig->pzErrmsg = 0;
179760 pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg;
179763 pTab->pConfig->pzErrmsg = 0;
179804 return ((Fts5Table*)(pCsr->base.pVtab))->pConfig->nCol;
179832 pTab->pConfig, FTS5_TOKENIZE_AUX, pText, nText, pUserData, xToken
180002 Fts5Config *pConfig = pTab->pConfig;
180006 if( pConfig->bColumnsize ){
180009 }else if( pConfig->zContent==0 ){
180011 for(i=0; i<pConfig->nCol; i++){
180012 if( pConfig->abUnindexed[i]==0 ){
180018 for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
180019 if( pConfig->abUnindexed[i]==0 ){
180026 pConfig, FTS5_TOKENIZE_AUX, z, n, p, fts5ColumnSizeCb
180037 for(i=0; i<pConfig->nCol; i++){
180040 }else if( iCol<pConfig->nCol ){
180184 Fts5Config *pConf = pTab->pConfig;
180272 *pnCol = pTab->pConfig->nCol;
180329 Fts5Config *pConfig = pTab->pConfig;
180336 if( iCol==pConfig->nCol ){
180341 if( iCol==pConfig->nCol ){
180347 }else if( iCol==pConfig->nCol+1 ){
180758 Fts5Config *pConfig;
180802 assert( p->pConfig->bColumnsize || (
180826 Fts5Config *pC = p->pConfig;
180918 static int sqlite3Fts5DropAll(Fts5Config *pConfig){
180919 int rc = fts5ExecPrintf(pConfig->db, 0,
180923 pConfig->zDb, pConfig->zName,
180924 pConfig->zDb, pConfig->zName,
180925 pConfig->zDb, pConfig->zName
180927 if( rc==SQLITE_OK && pConfig->bColumnsize ){
180928 rc = fts5ExecPrintf(pConfig->db, 0,
180930 pConfig->zDb, pConfig->zName
180933 if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
180934 rc = fts5ExecPrintf(pConfig->db, 0,
180936 pConfig->zDb, pConfig->zName
180943 Fts5Config *pConfig, /* Current FTS5 configuration */
180949 *pRc = fts5ExecPrintf(pConfig->db, 0,
180951 pConfig->zDb, pConfig->zName, zTail, zName, zTail
180957 Fts5Config *pConfig = pStorage->pConfig;
180960 fts5StorageRenameOne(pConfig, &rc, "data", zName);
180961 fts5StorageRenameOne(pConfig, &rc, "idx", zName);
180962 fts5StorageRenameOne(pConfig, &rc, "config", zName);
180963 if( pConfig->bColumnsize ){
180964 fts5StorageRenameOne(pConfig, &rc, "docsize", zName);
180966 if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
180967 fts5StorageRenameOne(pConfig, &rc, "content", zName);
180977 Fts5Config *pConfig, /* FTS5 configuration */
180986 rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s",
180987 pConfig->zDb, pConfig->zName, zPost, zDefn, bWithout?" WITHOUT ROWID":""
180992 pConfig->zName, zPost, zErr
181008 Fts5Config *pConfig,
181019 + pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */
181025 p->pConfig = pConfig;
181029 if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
181030 int nDefn = 32 + pConfig->nCol*10;
181031 char *zDefn = sqlite3_malloc(32 + pConfig->nCol * 10);
181039 for(i=0; i<pConfig->nCol; i++){
181043 rc = sqlite3Fts5CreateTable(pConfig, "content", zDefn, 0, pzErr);
181048 if( rc==SQLITE_OK && pConfig->bColumnsize ){
181050 pConfig, "docsize", "id INTEGER PRIMARY KEY, sz BLOB", 0, pzErr
181055 pConfig, "config", "k PRIMARY KEY, v", 1, pzErr
181120 Fts5Config *pConfig = p->pConfig;
181134 for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){
181135 if( pConfig->abUnindexed[iCol-1] ) continue;
181137 rc = sqlite3Fts5Tokenize(pConfig,
181170 if( p->pConfig->bColumnsize ){
181210 int nCol = p->pConfig->nCol;
181232 Fts5Config *pConfig = p->pConfig;
181244 if( rc==SQLITE_OK && pConfig->bColumnsize ){
181276 Fts5Config *pConfig = p->pConfig;
181280 assert( pConfig->eContent!=FTS5_CONTENT_NORMAL );
181291 for(iCol=0; rc==SQLITE_OK && iCol<pConfig->nCol; iCol++){
181292 if( pConfig->abUnindexed[iCol] ) continue;
181294 rc = sqlite3Fts5Tokenize(pConfig,
181307 if( pConfig->bColumnsize ){
181330 Fts5Config *pConfig = p->pConfig;
181334 rc = fts5ExecPrintf(pConfig->db, 0,
181337 pConfig->zDb, pConfig->zName,
181338 pConfig->zDb, pConfig->zName
181340 if( rc==SQLITE_OK && pConfig->bColumnsize ){
181341 rc = fts5ExecPrintf(pConfig->db, 0,
181343 pConfig->zDb, pConfig->zName
181360 Fts5Config *pConfig = p->pConfig;
181381 for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
181383 if( pConfig->abUnindexed[ctx.iCol]==0 ){
181384 rc = sqlite3Fts5Tokenize(pConfig,
181429 if( p->pConfig->bColumnsize ){
181439 *piRowid = sqlite3_last_insert_rowid(p->pConfig->db);
181453 Fts5Config *pConfig = p->pConfig;
181457 if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){
181477 for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){
181484 *piRowid = sqlite3_last_insert_rowid(pConfig->db);
181498 Fts5Config *pConfig = p->pConfig;
181510 for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
181512 if( pConfig->abUnindexed[ctx.iCol]==0 ){
181513 rc = sqlite3Fts5Tokenize(pConfig,
181541 Fts5Config *pConfig = p->pConfig;
181546 pConfig->zDb, pConfig->zName, zSuffix
181552 rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pCnt, 0);
181574 Fts5Config *pConfig;
181593 pCtx->pConfig, pCtx->iRowid, pCtx->iCol, pCtx->szCol-1, pToken, nToken
181605 Fts5Config *pConfig = p->pConfig;
181607 int *aColSize; /* Array of size pConfig->nCol */
181608 i64 *aTotalSize; /* Array of size pConfig->nCol */
181613 ctx.pConfig = p->pConfig;
181614 aTotalSize = (i64*)sqlite3_malloc(pConfig->nCol * (sizeof(int)+sizeof(i64)));
181616 aColSize = (int*)&aTotalSize[pConfig->nCol];
181617 memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol);
181628 if( pConfig->bColumnsize ){
181631 for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
181632 if( pConfig->abUnindexed[i] ) continue;
181635 rc = sqlite3Fts5Tokenize(pConfig,
181642 if( pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){
181657 for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
181664 if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
181669 if( rc==SQLITE_OK && pConfig->bColumnsize ){
181753 int nCol = p->pConfig->nCol; /* Number of user columns in table */
181757 assert( p->pConfig->bColumnsize );
181784 for(i=0; i<p->pConfig->nCol; i++){
181787 }else if( iCol<p->pConfig->nCol ){
181840 int iNew = p->pConfig->iCookie + 1;
181843 p->pConfig->iCookie = iNew;