]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the datacopy extension, used for testing only. branch-3.28
authordrh <>
Fri, 25 Jul 2025 20:37:56 +0000 (20:37 +0000)
committerdrh <>
Fri, 25 Jul 2025 20:37:56 +0000 (20:37 +0000)
FossilOrigin-Name: 06735507ae28fbcd0d43715434ddd74c5dfa4609cd9cb4d1994ca125b9d8dd68

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

diff --git a/ext/misc/datacopy.c b/ext/misc/datacopy.c
new file mode 100644 (file)
index 0000000..d5c23b8
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+** 2025-07-25
+**
+** 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 the DATACOPY collating sequence
+** which always returns zero.
+**
+** Hints for compiling:
+**
+**   Linux:    gcc -shared -fPIC -o datacopy.so datacopy.c
+**   OSX:      gcc -dynamiclib -fPIC -o datacopy.dylib datacopy.c
+**   Windows:  cl datacopy.c -link -dll -out:datacopy.dll
+*/
+#include "sqlite3ext.h"
+SQLITE_EXTENSION_INIT1
+#include <assert.h>
+#include <string.h>
+
+/*
+** Implement the DATACOPY collating sequence so that if
+**
+**      x=y COLLATE DATACOPY
+**
+** always returns zero (meaning that x is always equal to y).
+*/
+static int datacopyCollFunc(
+  void *notUsed,
+  int nKey1, const void *pKey1,
+  int nKey2, const void *pKey2
+){
+  (void)notUsed;
+  (void)nKey1;
+  (void)pKey1;
+  (void)nKey2;
+  (void)pKey2;
+  return 0;
+}
+
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int sqlite3_datacopy_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_collation(db, "DATACOPY", SQLITE_UTF8,
+                                0, datacopyCollFunc);
+  return rc;
+}
index d2410e7e2259d58142d65b7e908cb10ae0289afb..8fda3552bdad1154e6d79fecae9562ac3c09bf99 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Improvements\sto\sthe\sscope\sof\svalueFromFunction().
-D 2024-09-18T18:04:30.307
+C Add\sthe\sdatacopy\sextension,\sused\sfor\stesting\sonly.
+D 2025-07-25T20:37:56.306
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -284,6 +284,7 @@ F ext/misc/closure.c dbfd8543b2a017ae6b1a5843986b22ddf99ff126ec9634a2f4047cd14c8
 F ext/misc/completion.c cec672d40604075bb341a7f11ac48393efdcd90a979269b8fe7977ea62d0547f
 F ext/misc/compress.c dd4f8a6d0baccff3c694757db5b430f3bbd821d8686d1fc24df55cf9f035b189
 F ext/misc/csv.c 7f047aeb68f5802e7ce6639292095d622a488bb43526ed04810e0649faa71ceb
+F ext/misc/datacopy.c eac165b6120fe0060da0655774b0f1cd8b69668227e007bf1f08f822e2a1c8f0
 F ext/misc/dbdump.c baf6e37447c9d6968417b1cd34cbedb0b0ab3f91b5329501d8a8d5be3287c336
 F ext/misc/eval.c 4b4757592d00fd32e44c7a067e6a0e4839c81a4d57abc4131ee7806d1be3104e
 F ext/misc/explain.c d5c12962d79913ef774b297006872af1fccda388f61a11d37758f9179a09551f
@@ -1822,9 +1823,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 148d505ca08adcc776748d4d01fde022ab5add745d6b2573922a66e516b51681
-Q +a0f39419cb5bdfa42ab2978cf3819e3d7821212996571f8251d2efbeaa26c603
-R 1aec0b9a4c85c0e5c4b4a0fd66b01c71
+P b021399a6e93afbb3368a5ae94c0f29c97ec6603bf9a5b7f86ca63c94590c2c3
+R 9d7140bb1f9296ac7b0b83953ba9f03b
 U drh
-Z 252815416379df1b7cdbf62123df53d6
+Z 6b049eb05e75f32bb2613e16bba6d9dd
 # Remove this line to create a well-formed Fossil manifest.
index 929717d03edb48b07a9c1daaaf7da299c813f54b..e37de9d42946e45a4466ee51d9af64693013d168 100644 (file)
@@ -1 +1 @@
-b021399a6e93afbb3368a5ae94c0f29c97ec6603bf9a5b7f86ca63c94590c2c3
+06735507ae28fbcd0d43715434ddd74c5dfa4609cd9cb4d1994ca125b9d8dd68