]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix the rot13.c extension to be deterministic. Add the noop.c extension.
authordrh <drh@noemail.net>
Wed, 8 Jan 2020 15:43:29 +0000 (15:43 +0000)
committerdrh <drh@noemail.net>
Wed, 8 Jan 2020 15:43:29 +0000 (15:43 +0000)
FossilOrigin-Name: a679122ca8ec95d5c8afba3a1a50170db9dd519a3810e56877b8f56e858d0175

ext/misc/noop.c [new file with mode: 0644]
ext/misc/rot13.c
manifest
manifest.uuid

diff --git a/ext/misc/noop.c b/ext/misc/noop.c
new file mode 100644 (file)
index 0000000..99091fb
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+** 2020-01-08
+**
+** The author disclaims copyright to this source code.  In place of
+** a legal notice, here is a blessing:
+**
+**    May you do good and not evil.
+**    May you find forgiveness for yourself and forgive others.
+**    May you share freely, never taking more than you give.
+**
+******************************************************************************
+**
+** This SQLite extension implements a noop() function used for testing.
+*/
+#include "sqlite3ext.h"
+SQLITE_EXTENSION_INIT1
+#include <assert.h>
+#include <string.h>
+
+/*
+** Implementation of the noop() function.
+**
+** The function returns its argument, unchanged.
+*/
+static void noopfunc(
+  sqlite3_context *context,
+  int argc,
+  sqlite3_value **argv
+){
+  assert( argc==1 );
+  sqlite3_result_value(context, argv[0]);
+}
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int sqlite3_noop_init(
+  sqlite3 *db, 
+  char **pzErrMsg, 
+  const sqlite3_api_routines *pApi
+){
+  int rc = SQLITE_OK;
+  SQLITE_EXTENSION_INIT2(pApi);
+  (void)pzErrMsg;  /* Unused parameter */
+  rc = sqlite3_create_function(db, "noop", 1,
+                     SQLITE_UTF8 | SQLITE_DETERMINISTIC,
+                     0, noopfunc, 0, 0);
+  if( rc ) return rc;
+  rc = sqlite3_create_function(db, "noop_i", 1,
+                     SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_INNOCUOUS,
+                     0, noopfunc, 0, 0);
+  if( rc ) return rc;
+  rc = sqlite3_create_function(db, "noop_do", 1,
+                     SQLITE_UTF8 | SQLITE_DETERMINISTIC | SQLITE_DIRECTONLY,
+                     0, noopfunc, 0, 0);
+  return rc;
+}
index 8bde54700e5c307f828bf1ddb038bc884000c6ff..05b4a188018227ecd3969a97ed1dfe2acac25f88 100644 (file)
@@ -105,8 +105,9 @@ int sqlite3_rot_init(
   int rc = SQLITE_OK;
   SQLITE_EXTENSION_INIT2(pApi);
   (void)pzErrMsg;  /* Unused parameter */
-  rc = sqlite3_create_function(db, "rot13", 1, SQLITE_UTF8|SQLITE_INNOCUOUS, 0,
-                               rot13func, 0, 0);
+  rc = sqlite3_create_function(db, "rot13", 1,
+                   SQLITE_UTF8|SQLITE_INNOCUOUS|SQLITE_DETERMINISTIC,
+                   0, rot13func, 0, 0);
   if( rc==SQLITE_OK ){
     rc = sqlite3_create_collation(db, "rot13", SQLITE_UTF8, 0, rot13CollFunc);
   }
index c3f7bec0f70d841daf35dd09b1d249a852d2f5c6..d090866118c96c9fb33d71568bcf6c59727862d7 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C In\sthe\sTreeView\sdebugging\soutput,\sshow\sa\s"DDL"\smark\son\sSrcList\sand\sExpr\snodes\nthat\sderive\sfrom\sa\snon-TEMP\sschema.
-D 2020-01-08T14:39:57.767
+C Fix\sthe\srot13.c\sextension\sto\sbe\sdeterministic.\s\sAdd\sthe\snoop.c\sextension.
+D 2020-01-08T15:43:29.452
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -302,12 +302,13 @@ F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2
 F ext/misc/memvfs.c ab36f49e02ebcdf85a1e08dc4d8599ea8f343e073ac9e0bca18a98b7e1ec9567
 F ext/misc/mmapwarm.c 8c5fe90d807a23e44a8b93e96e8b812b19b300d5fd8c1d40a4fd1d8224e33f46
 F ext/misc/nextchar.c 7877914c2a80c2f181dd04c3dbef550dfb54c93495dc03da2403b5dd58f34edd
+F ext/misc/noop.c 05e8263fb9998d675b5714a3d280b284b19ffe65256d6856fec807948485f6f0
 F ext/misc/normalize.c b4290464f542bae7a97b43f15bd197949b833ffd668b7c313631bd5d4610212c
 F ext/misc/percentile.c b9086e223d583bdaf8cb73c98a6539d501a2fc4282654adbfea576453d82e691
 F ext/misc/prefixes.c 0f4f8cff5aebc00a7e3ac4021fd59cfe1a8e17c800ceaf592859ecb9cbc38196
 F ext/misc/regexp.c 246244c714267f303df76acf73dcf110cf2eaf076896aaaba8db6d6d21a129db
 F ext/misc/remember.c add730f0f7e7436cd15ea3fd6a90fd83c3f706ab44169f7f048438b7d6baa69c
-F ext/misc/rot13.c 4a57b830f8cf23b96156e1e3cbd1115186243feae25010bf9b02af88a343ae1f
+F ext/misc/rot13.c 51ac5f51e9d5fd811db58a9c23c628ad5f333c173f1fc53c8491a3603d38556c
 F ext/misc/scrub.c db9fff56fed322ca587d73727c6021b11ae79ce3f31b389e1d82891d144f22ad
 F ext/misc/series.c a733a77d152983cc5d337c9df7b358ad17cfb44965476843cd03e2f571054914
 F ext/misc/sha1.c 1190aec0d9d886d9f5ffdf891142a626812327d11472c0cade3489db3b7b140a
@@ -1853,7 +1854,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 5962921fceaf2ec645379a5f1d18e2c2c13abbf92cf64606caee69f45a21c500
-R 93a7c1674ece8353922d12da4e1fe3fc
+P fe7472fd2a70b4df6cb62041b72ed1638ba27ed1e6ceb8aaf56d1c8a82d91889
+R ac5937459d1f32e763d72ee868f7675e
 U drh
-Z 848f5182d2c3a0564e6132972f60b9ae
+Z 35839f6156af9b997f99a45283c98dee
index 545d38920a2aaf003cadc08cf471275475fa9956..bbd4914395670458d8ddfdfdc359390f574a15ed 100644 (file)
@@ -1 +1 @@
-fe7472fd2a70b4df6cb62041b72ed1638ba27ed1e6ceb8aaf56d1c8a82d91889
\ No newline at end of file
+a679122ca8ec95d5c8afba3a1a50170db9dd519a3810e56877b8f56e858d0175
\ No newline at end of file