]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Make most geopoly functions pure.
authordrh <drh@noemail.net>
Fri, 28 Sep 2018 13:18:24 +0000 (13:18 +0000)
committerdrh <drh@noemail.net>
Fri, 28 Sep 2018 13:18:24 +0000 (13:18 +0000)
FossilOrigin-Name: 944e167a98e995c5750c1fcd44df857d6b10c1cbb91731fad2849415c42b2cfc

ext/rtree/geopoly.c
manifest
manifest.uuid

index 3f1b89ad46c52955018b15ddff3f5e138522a7d7..66a0ce2487b24cae9150400c46a049ffa30d4f73 100644 (file)
@@ -1640,19 +1640,20 @@ static int sqlite3_geopoly_init(sqlite3 *db){
   int rc = SQLITE_OK;
   static const struct {
     void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
-    int nArg;
+    signed char nArg;
+    unsigned char bPure;
     const char *zName;
   } aFunc[] = {
-     { geopolyAreaFunc,          1,    "geopoly_area"             },
-     { geopolyBlobFunc,          1,    "geopoly_blob"             },
-     { geopolyJsonFunc,          1,    "geopoly_json"             },
-     { geopolySvgFunc,          -1,    "geopoly_svg"              },
-     { geopolyWithinFunc,        2,    "geopoly_within"           },
-     { geopolyContainsPointFunc, 3,    "geopoly_contains_point"   },
-     { geopolyOverlapFunc,       2,    "geopoly_overlap"          },
-     { geopolyDebugFunc,         1,    "geopoly_debug"            },
-     { geopolyBBoxFunc,          1,    "geopoly_bbox"             },
-     { geopolyXformFunc,         7,    "geopoly_xform"            },
+     { geopolyAreaFunc,          1, 1,    "geopoly_area"             },
+     { geopolyBlobFunc,          1, 1,    "geopoly_blob"             },
+     { geopolyJsonFunc,          1, 1,    "geopoly_json"             },
+     { geopolySvgFunc,          -1, 1,    "geopoly_svg"              },
+     { geopolyWithinFunc,        2, 1,    "geopoly_within"           },
+     { geopolyContainsPointFunc, 3, 1,    "geopoly_contains_point"   },
+     { geopolyOverlapFunc,       2, 1,    "geopoly_overlap"          },
+     { geopolyDebugFunc,         1, 0,    "geopoly_debug"            },
+     { geopolyBBoxFunc,          1, 1,    "geopoly_bbox"             },
+     { geopolyXformFunc,         7, 1,    "geopoly_xform"            },
   };
   static const struct {
     void (*xStep)(sqlite3_context*,int,sqlite3_value**);
@@ -1663,8 +1664,9 @@ static int sqlite3_geopoly_init(sqlite3 *db){
   };
   int i;
   for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){
+    int enc = aFunc[i].bPure ? SQLITE_UTF8|SQLITE_DETERMINISTIC : SQLITE_UTF8;
     rc = sqlite3_create_function(db, aFunc[i].zName, aFunc[i].nArg,
-                                 SQLITE_UTF8, 0,
+                                 enc, 0,
                                  aFunc[i].xFunc, 0, 0);
   }
   for(i=0; i<sizeof(aAgg)/sizeof(aAgg[0]) && rc==SQLITE_OK; i++){
index c7305bb3bdc963910d3a1354e21bfa36b73becd4..364404f98fa693eab255c84117d2ee1dc8215d34 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Rig\sgeopoly\sto\suse\ssqlite3AtoF()\sif\sit\sis\savailable,\sas\sthat\sroutine\sis\smuch\nfaster\sthan\satof().
-D 2018-09-28T00:16:57.366
+C Make\smost\sgeopoly\sfunctions\spure.
+D 2018-09-28T13:18:24.886
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F Makefile.in 01e95208a78b57d056131382c493c963518f36da4c42b12a97eb324401b3a334
@@ -361,7 +361,7 @@ F ext/repair/test/checkfreelist01.test 3e8aa6aeb4007680c94a8d07b41c339aa635cc782
 F ext/repair/test/checkindex01.test 6945d0ffc0c1dc993b2ce88036b26e0f5d6fcc65da70fc9df27c2647bb358b0f
 F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c
 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761
-F ext/rtree/geopoly.c d8eb33517c2d1a3f5ab3a8a8502d3182e4a11115749c03e969c162b47112c06a
+F ext/rtree/geopoly.c c92eb2c5df436c0be3cffceb00769794ed8a28b38fe6e40cde2c68b026d20c8c
 F ext/rtree/rtree.c 6cc2e673cf1e9ea1619f13ab990f12389dfb951b131acbc2fbe164cee8992a20
 F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412
 F ext/rtree/rtree1.test 309afc04d4287542b2cd74f933296832cc681c7b014d9405cb329b62053a5349
@@ -1770,7 +1770,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P fb520e71035258d5490be33ee28575df2caefa5d5a301c8bbdf1471551c96282
-R 47c3c7c1359809e24fc02c3047f697ad
+P 470c6c07d0eb70806ac257c1c8ad877e041bbc14ff9a5c490edb51b2956ae726
+R fa3505d48ffa9af9252dfb9f6f5b940e
 U drh
-Z ad03ded0c726f90176bebeb637053950
+Z 9e0a18a5e5cb49bc10f6b45134fb4708
index 015826b4468e4568d8fa03509bf15fb8cbe80158..f492a69ede802dce4a020c3ff6f1cc0ebcdfe0e2 100644 (file)
@@ -1 +1 @@
-470c6c07d0eb70806ac257c1c8ad877e041bbc14ff9a5c490edb51b2956ae726
\ No newline at end of file
+944e167a98e995c5750c1fcd44df857d6b10c1cbb91731fad2849415c42b2cfc
\ No newline at end of file