Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove some unreachable code. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | fts3-prefix-search |
Files: | files | file ages | folders |
SHA1: |
650e1a79eda5a2134a1fbd305ab1f205 |
User & Date: | dan 2011-06-04 20:13:24.690 |
Context
2011-06-06
| ||
06:55 | Clean up the code for processing FTS4 options a bit. (check-in: 0425138a23 user: dan tags: fts3-prefix-search) | |
2011-06-04
| ||
20:13 | Remove some unreachable code. (check-in: 650e1a79ed user: dan tags: fts3-prefix-search) | |
20:04 | Allow the "order=DESC" and "order=ASC" parameters in FTS4 "CREATE VIRTUAL TABLE" statements. Tables created with "order=DESC" store all doclists in descending order, which allows optimizations normally applied to "ORDER BY docid ASC" queries to be used with "ORDER BY docid DESC" queries instead. (check-in: f6a0193f5a user: dan tags: fts3-prefix-search) | |
Changes
Changes to ext/fts3/fts3.c.
︙ | ︙ | |||
443 444 445 446 447 448 449 | p++; *pp = p; sqlite3Fts3GetVarint(p, &iVal); *pVal = iVal; } | < < < < < < < < < < < < < < | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | p++; *pp = p; sqlite3Fts3GetVarint(p, &iVal); *pVal = iVal; } /* ** The xDisconnect() virtual table method. */ static int fts3DisconnectMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table *)pVtab; int i; |
︙ | ︙ | |||
1908 1909 1910 1911 1912 1913 1914 | res = 0; } return res; } } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 | res = 0; } return res; } } /* ** A pointer to an instance of this structure is used as the context ** argument to sqlite3Fts3SegReaderIterate() */ typedef struct TermSelect TermSelect; struct TermSelect { int isReqPos; |
︙ | ︙ | |||
2249 2250 2251 2252 2253 2254 2255 | /* ** This function merges two doclists according to the requirements of a ** NEAR operator. */ static int fts3DoclistNearMerge( int bDescIdx, | < | 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 | /* ** This function merges two doclists according to the requirements of a ** NEAR operator. */ static int fts3DoclistNearMerge( int bDescIdx, int nNear, /* Parameter to NEAR operator */ int nTokenLeft, /* Number of tokens in LHS phrase arg */ char *aLeft, /* Doclist for LHS (incl. positions) */ int nLeft, /* Size of LHS doclist in bytes */ int nTokenRight, /* As nTokenLeft */ char *aRight, /* As aLeft */ int nRight, /* As nRight */ |
︙ | ︙ | |||
2332 2333 2334 2335 2336 2337 2338 | ** other doclists (except the aaOutput[0] one) and return SQLITE_OK. ** ** If an OOM error occurs, return SQLITE_NOMEM. In this case it is ** the responsibility of the caller to free any doclists left in the ** TermSelect.aaOutput[] array. */ static int fts3TermSelectMerge(Fts3Table *p, TermSelect *pTS){ | < | 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 | ** other doclists (except the aaOutput[0] one) and return SQLITE_OK. ** ** If an OOM error occurs, return SQLITE_NOMEM. In this case it is ** the responsibility of the caller to free any doclists left in the ** TermSelect.aaOutput[] array. */ static int fts3TermSelectMerge(Fts3Table *p, TermSelect *pTS){ char *aOut = 0; int nOut = 0; int i; /* Loop through the doclists in the aaOutput[] array. Merge them all ** into a single doclist. */ |
︙ | ︙ | |||
2402 2403 2404 2405 2406 2407 2408 | pTS->anOutput[0] = nDoclist; if( pTS->aaOutput[0] ){ memcpy(pTS->aaOutput[0], aDoclist, nDoclist); }else{ return SQLITE_NOMEM; } }else{ | < | 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 | pTS->anOutput[0] = nDoclist; if( pTS->aaOutput[0] ){ memcpy(pTS->aaOutput[0], aDoclist, nDoclist); }else{ return SQLITE_NOMEM; } }else{ char *aMerge = aDoclist; int nMerge = nDoclist; int iOut; for(iOut=0; iOut<SizeofArray(pTS->aaOutput); iOut++){ if( pTS->aaOutput[iOut]==0 ){ assert( iOut>0 ); |
︙ | ︙ | |||
3812 3813 3814 3815 3816 3817 3818 | sqlite3_free(pRight->doclist.aAll); pRight->doclist.aAll = 0; pRight->doclist.nAll = 0; }else if( pRight->doclist.aAll ){ char *aOut; /* Buffer in which to assemble new doclist */ int nOut; /* Size of buffer aOut in bytes */ | | | 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 | sqlite3_free(pRight->doclist.aAll); pRight->doclist.aAll = 0; pRight->doclist.nAll = 0; }else if( pRight->doclist.aAll ){ char *aOut; /* Buffer in which to assemble new doclist */ int nOut; /* Size of buffer aOut in bytes */ *pRc = fts3DoclistNearMerge(bDescIdx, nNear, pLeft->nToken, pLeft->doclist.aAll, pLeft->doclist.nAll, pRight->nToken, pRight->doclist.aAll, pRight->doclist.nAll, &aOut, &nOut ); sqlite3_free(pRight->doclist.aAll); pRight->doclist.aAll = aOut; pRight->doclist.nAll = nOut; |
︙ | ︙ |