Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch spellfix-constraints Excluding Merge-Ins
This is equivalent to a diff from fbf9c4325e to 1d04def785
2015-06-24
| ||
18:22 | Add "ON CONFLICT" handling to the spellfix module. (check-in: 07937a81c6 user: drh tags: trunk) | |
17:21 | Add "ON CONFLICT" handling to the spellfix module. (Closed-Leaf check-in: 1d04def785 user: dan tags: spellfix-constraints) | |
14:45 | In the fuzzcheck test program, use the progress handler to limit the number of VDBE cycles to avoid getting stuck if the SQL under test contains an infinite CTE loop. Add the --limit-vdbe command-line option. (check-in: fbf9c4325e user: drh tags: trunk) | |
14:36 | Fix the progress handler so that it does not fire too soon during an sqlite3_step() call other than the first. (check-in: b41ef5d6db user: drh tags: trunk) | |
Changes to ext/misc/spellfix.c.
︙ | |||
2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 | 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 | + + + + + + + + + + + + + + + + + + + + + + + + + | if( pCur->pFullScan ){ *pRowid = sqlite3_column_int64(pCur->pFullScan, 4); }else{ *pRowid = pCur->a[pCur->iRow].iRowid; } return SQLITE_OK; } /* ** This function is called by the xUpdate() method. It returns a string ** containing the conflict mode that xUpdate() should use for the current ** operation. One of: "ROLLBACK", "IGNORE", "ABORT" or "REPLACE". */ static const char *spellfix1GetConflict(sqlite3 *db){ static const char *azConflict[] = { /* Note: Instead of "FAIL" - "ABORT". */ "ROLLBACK", "IGNORE", "ABORT", "ABORT", "REPLACE" }; int eConflict = sqlite3_vtab_on_conflict(db); assert( eConflict==SQLITE_ROLLBACK || eConflict==SQLITE_IGNORE || eConflict==SQLITE_FAIL || eConflict==SQLITE_ABORT || eConflict==SQLITE_REPLACE ); assert( SQLITE_ROLLBACK==1 ); assert( SQLITE_IGNORE==2 ); assert( SQLITE_FAIL==3 ); assert( SQLITE_ABORT==4 ); assert( SQLITE_REPLACE==5 ); return azConflict[eConflict-1]; } /* ** The xUpdate() method. */ static int spellfix1Update( sqlite3_vtab *pVTab, int argc, |
︙ | |||
2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 | 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 | + | int iRank = sqlite3_value_int(argv[SPELLFIX_COL_RANK+2]); const unsigned char *zSoundslike = sqlite3_value_text(argv[SPELLFIX_COL_SOUNDSLIKE+2]); int nSoundslike = sqlite3_value_bytes(argv[SPELLFIX_COL_SOUNDSLIKE+2]); char *zK1, *zK2; int i; char c; const char *zConflict = spellfix1GetConflict(db); if( zWord==0 ){ /* Inserts of the form: INSERT INTO table(command) VALUES('xyzzy'); ** cause zWord to be NULL, so we look at the "command" column to see ** what special actions to take */ const char *zCmd = (const char*)sqlite3_value_text(argv[SPELLFIX_COL_COMMAND+2]); |
︙ | |||
2742 2743 2744 2745 2746 2747 2748 | 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 | - - - - + + + + - + - + | "VALUES(%d,%d,%Q,%Q,%Q)", p->zDbName, p->zTableName, iRank, iLang, zWord, zK1, zK2 ); }else{ newRowid = sqlite3_value_int64(argv[1]); spellfix1DbExec(&rc, db, |
︙ |
Changes to test/spellfix.test.
︙ | |||
279 280 281 282 283 284 285 | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 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 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | do_tracesql_test 6.2.3 { SELECT word, distance FROM t3 WHERE rowid = 10 AND word MATCH 'kiiner'; } {keener 300 {SELECT id, word, rank, k1 FROM "main"."t3_vocab" WHERE langid=0 AND k2>=?1 AND k2<?2} } } #------------------------------------------------------------------------- # Test that the spellfix1 table supports conflict handling (OR REPLACE # and so on). |