/ Check-in [29ec855e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The extensions functions in spellfix are all deterministic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 29ec855e13e0dcd675dcf12948b42f9e669d0a31c5d9efb95857888aba0beeee
User & Date: drh 2017-11-03 08:46:48
Context
2017-11-04
08:53
Fix an LSM problem with read-only connections and compression (not compression-factory) callbacks. check-in: 51ee5188 user: dan tags: trunk
2017-11-03
17:51
Merge latest trunk changes with this branch. check-in: 585e0a09 user: dan tags: fcntl_shm_read
08:46
The extensions functions in spellfix are all deterministic. check-in: 29ec855e user: drh tags: trunk
06:45
Fix harmless compiler warnings. check-in: d088c5a3 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to ext/misc/spellfix.c.

  1118   1118   */
  1119   1119   static int editDist3Install(sqlite3 *db){
  1120   1120     int rc;
  1121   1121     EditDist3Config *pConfig = sqlite3_malloc64( sizeof(*pConfig) );
  1122   1122     if( pConfig==0 ) return SQLITE_NOMEM;
  1123   1123     memset(pConfig, 0, sizeof(*pConfig));
  1124   1124     rc = sqlite3_create_function_v2(db, "editdist3",
  1125         -              2, SQLITE_UTF8, pConfig, editDist3SqlFunc, 0, 0, 0);
         1125  +              2, SQLITE_UTF8|SQLITE_DETERMINISTIC, pConfig,
         1126  +              editDist3SqlFunc, 0, 0, 0);
  1126   1127     if( rc==SQLITE_OK ){
  1127   1128       rc = sqlite3_create_function_v2(db, "editdist3",
  1128         -                3, SQLITE_UTF8, pConfig, editDist3SqlFunc, 0, 0, 0);
         1129  +                3, SQLITE_UTF8|SQLITE_DETERMINISTIC, pConfig,
         1130  +                editDist3SqlFunc, 0, 0, 0);
  1129   1131     }
  1130   1132     if( rc==SQLITE_OK ){
  1131   1133       rc = sqlite3_create_function_v2(db, "editdist3",
  1132         -                1, SQLITE_UTF8, pConfig, editDist3SqlFunc, 0, 0,
  1133         -                editDist3ConfigDelete);
         1134  +                1, SQLITE_UTF8|SQLITE_DETERMINISTIC, pConfig,
         1135  +                editDist3SqlFunc, 0, 0, editDist3ConfigDelete);
  1134   1136     }else{
  1135   1137       sqlite3_free(pConfig);
  1136   1138     }
  1137   1139     return rc;
  1138   1140   }
  1139   1141   /* End configurable cost unicode edit distance routines
  1140   1142   ******************************************************************************
................................................................................
  2891   2893   
  2892   2894   /*
  2893   2895   ** Register the various functions and the virtual table.
  2894   2896   */
  2895   2897   static int spellfix1Register(sqlite3 *db){
  2896   2898     int rc = SQLITE_OK;
  2897   2899     int i;
  2898         -  rc = sqlite3_create_function(db, "spellfix1_translit", 1, SQLITE_UTF8, 0,
         2900  +  rc = sqlite3_create_function(db, "spellfix1_translit", 1,
         2901  +                               SQLITE_UTF8|SQLITE_DETERMINISTIC, 0,
  2899   2902                                     transliterateSqlFunc, 0, 0);
  2900   2903     if( rc==SQLITE_OK ){
  2901         -    rc = sqlite3_create_function(db, "spellfix1_editdist", 2, SQLITE_UTF8, 0,
         2904  +    rc = sqlite3_create_function(db, "spellfix1_editdist", 2,
         2905  +                                 SQLITE_UTF8|SQLITE_DETERMINISTIC, 0,
  2902   2906                                     editdistSqlFunc, 0, 0);
  2903   2907     }
  2904   2908     if( rc==SQLITE_OK ){
  2905         -    rc = sqlite3_create_function(db, "spellfix1_phonehash", 1, SQLITE_UTF8, 0,
         2909  +    rc = sqlite3_create_function(db, "spellfix1_phonehash", 1,
         2910  +                                 SQLITE_UTF8|SQLITE_DETERMINISTIC, 0,
  2906   2911                                     phoneticHashSqlFunc, 0, 0);
  2907   2912     }
  2908   2913     if( rc==SQLITE_OK ){
  2909         -    rc = sqlite3_create_function(db, "spellfix1_scriptcode", 1, SQLITE_UTF8, 0,
         2914  +    rc = sqlite3_create_function(db, "spellfix1_scriptcode", 1,
         2915  +                                  SQLITE_UTF8|SQLITE_DETERMINISTIC, 0,
  2910   2916                                     scriptCodeSqlFunc, 0, 0);
  2911   2917     }
  2912   2918     if( rc==SQLITE_OK ){
  2913   2919       rc = sqlite3_create_module(db, "spellfix1", &spellfix1Module, 0);
  2914   2920     }
  2915   2921     if( rc==SQLITE_OK ){
  2916   2922       rc = editDist3Install(db);