Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Add coverage test cases for fts3. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
8fcb0478c82507403165719724b62a30 |
User & Date: | dan 2009-12-12 09:51:25.000 |
Context
2009-12-12
| ||
13:16 | Extra tests for coverage of fts3 code. (check-in: eee921a99e user: dan tags: trunk) | |
09:51 | Add coverage test cases for fts3. (check-in: 8fcb0478c8 user: dan tags: trunk) | |
2009-12-11
| ||
23:11 | Additional changes to C-language interface documentation. (check-in: 1342916fd3 user: drh tags: trunk) | |
Changes
Changes to ext/fts3/fts3.c.
︙ | |||
617 618 619 620 621 622 623 624 625 626 627 628 629 630 | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | + | p->db = db; p->nColumn = nCol; p->nPendingData = 0; p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nNodeSize = 1000; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; zCsr = (char *)&p->azColumn[nCol]; fts3HashInit(&p->pendingTerms, FTS3_HASH_STRING, 1); /* Fill in the zName and zDb fields of the vtab structure. */ p->zName = zCsr; memcpy(zCsr, argv[2], nName); |
︙ | |||
2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 | 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | + + + + | #ifdef SQLITE_ENABLE_ICU || (pIcu && sqlite3Fts3HashInsert(pHash, "icu", 4, (void *)pIcu)) #endif ){ rc = SQLITE_NOMEM; } } #ifdef SQLITE_TEST sqlite3Fts3ExprInitTestInterface(db); #endif /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ if( SQLITE_OK==rc && SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) |
︙ |
Changes to ext/fts3/fts3Int.h.
︙ | |||
116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | - + + | sqlite3_stmt **aLeavesStmt; /* Array of prepared zSelectLeaves stmts */ int nNodeSize; /* Soft limit for node size */ /* The following hash table is used to buffer pending index updates during ** transactions. Variable nPendingData estimates the memory size of the ** pending data, including hash table overhead, but not malloc overhead. |
︙ |
Changes to ext/fts3/fts3_write.c.
︙ | |||
290 291 292 293 294 295 296 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | - - + + | rc = sqlite3_step(pStmt); if( rc!=SQLITE_ROW ){ return (rc==SQLITE_DONE ? SQLITE_CORRUPT : rc); } *pnBlock = sqlite3_column_bytes(pStmt, 0); *pzBlock = (char *)sqlite3_column_blob(pStmt, 0); |
︙ | |||
506 507 508 509 510 511 512 | 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | - + | static int fts3PendingTermsDocid(Fts3Table *p, sqlite_int64 iDocid){ /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ |
︙ | |||
2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 | 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 | + + + | if( rc==SQLITE_DONE || rc==SQLITE_OK ){ rc = SQLITE_OK; sqlite3Fts3PendingTermsClear(p); } #ifdef SQLITE_TEST }else if( nVal>9 && 0==sqlite3_strnicmp(zVal, "nodesize=", 9) ){ p->nNodeSize = atoi(&zVal[9]); rc = SQLITE_OK; }else if( nVal>11 && 0==sqlite3_strnicmp(zVal, "maxpending=", 9) ){ p->nMaxPendingData = atoi(&zVal[11]); rc = SQLITE_OK; #endif }else{ rc = SQLITE_ERROR; } return rc; |
︙ |
Changes to src/test_hexio.c.
︙ | |||
326 327 328 329 330 331 332 | 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | - + - + | x += y * (*q++); *v = (sqlite_int64) x; return (int) (q - (unsigned char *)p); } /* |
︙ | |||
369 370 371 372 373 374 375 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | - + | } aObjCmd[] = { { "hexio_read", hexio_read }, { "hexio_write", hexio_write }, { "hexio_get_int", hexio_get_int }, { "hexio_render_int16", hexio_render_int16 }, { "hexio_render_int32", hexio_render_int32 }, { "utf8_to_utf8", utf8_to_utf8 }, |
Changes to test/fts3_common.tcl.
︙ | |||
204 205 206 207 208 209 210 | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | - + | join $lDoc " " } ########################################################################### proc gobble_varint {varname} { upvar $varname blob |
︙ | |||
306 307 308 309 310 311 312 | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | - + + + + + - + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + - - + + - - - + - - - + + + - + | # by parameter $result, or (b) TCL throws an "out of memory" error. # # If DO_MALLOC_TEST is defined and set to zero, then the SELECT statement # is executed just once. In this case the test case passes if the results # match the expected results passed via parameter $result. # proc do_select_test {name sql result} { |
︙ |
Added test/fts3cov.test.