/ Check-in [b271ed56]
Login

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

Overview
Comment:Allow R-Tree geometry functions to take 8-byte BLOB arguments which are passed directly through to the underlying callback, and which can be used to pass pointers into the callback.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b271ed56532a78323accc8a7cb348d55f95c350e
User & Date: drh 2015-05-19 22:20:48
Context
2015-05-19
22:56
Fix the MSVC makefile so that it works with OTA. Fix a harmless compiler warning in FTS3. check-in: c7b16645 user: drh tags: trunk
22:42
Merge recent trunk changes, include the R-Tree enhancement that allows 8-byte BLOB arguments to geometry functions, and the fix for the TEXT affinity problem that could cause corrupt indexes. check-in: 0a0de8b7 user: drh tags: sessions
22:20
Allow R-Tree geometry functions to take 8-byte BLOB arguments which are passed directly through to the underlying callback, and which can be used to pass pointers into the callback. check-in: b271ed56 user: drh tags: trunk
19:44
Ensure that when the VM applies TEXT affinity to a value it discards any existing REAL or INTEGER value. Fix for [34cd55d6]. check-in: f5d0ce80 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rtree/rtree.c.

  3397   3397       sqlite3_result_error_nomem(ctx);
  3398   3398     }else{
  3399   3399       int i;
  3400   3400       pBlob->magic = RTREE_GEOMETRY_MAGIC;
  3401   3401       pBlob->cb = pGeomCtx[0];
  3402   3402       pBlob->nParam = nArg;
  3403   3403       for(i=0; i<nArg; i++){
         3404  +      if( sqlite3_value_type(aArg[i])==SQLITE_BLOB
         3405  +        && sqlite3_value_bytes(aArg[i])==sizeof(sqlite3_rtree_dbl)
         3406  +      ){
         3407  +        memcpy(&pBlob->aParam[i], sqlite3_value_blob(aArg[i]),
         3408  +               sizeof(sqlite3_rtree_dbl));
         3409  +      }else{
  3404   3410   #ifdef SQLITE_RTREE_INT_ONLY
  3405         -      pBlob->aParam[i] = sqlite3_value_int64(aArg[i]);
         3411  +        pBlob->aParam[i] = sqlite3_value_int64(aArg[i]);
  3406   3412   #else
  3407         -      pBlob->aParam[i] = sqlite3_value_double(aArg[i]);
         3413  +        pBlob->aParam[i] = sqlite3_value_double(aArg[i]);
  3408   3414   #endif
         3415  +      }
  3409   3416       }
  3410   3417       sqlite3_result_blob(ctx, pBlob, nBlob, sqlite3_free);
  3411   3418     }
  3412   3419   }
  3413   3420   
  3414   3421   /*
  3415   3422   ** Register a new geometry function for use with the r-tree MATCH operator.