From: drh Date: Sun, 16 Apr 2017 22:08:31 +0000 (+0000) Subject: Add the anycollseq.c loadable extension in etc/misc X-Git-Tag: version-3.19.0~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b65b3e429afce35f9bb99788391ca8bfbab339f6;p=thirdparty%2Fsqlite.git Add the anycollseq.c loadable extension in etc/misc FossilOrigin-Name: d7b9813cb17615c3d00afd6994a4309d6d48c8e924b6cd813c543e1fa65c7719 --- diff --git a/ext/misc/anycollseq.c b/ext/misc/anycollseq.c new file mode 100644 index 0000000000..27b7049d5f --- /dev/null +++ b/ext/misc/anycollseq.c @@ -0,0 +1,58 @@ +/* +** 2017-04-16 +** +** 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 file implements a run-time loadable extension to SQLite that +** registers a sqlite3_collation_needed() callback to register a fake +** collating function for any unknown collating sequence. The fake +** collating function works like BINARY. +** +** This extension can be used to load schemas that contain one or more +** unknown collating sequences. +*/ +#include "sqlite3ext.h" +SQLITE_EXTENSION_INIT1 +#include + +static int anyCollFunc( + void *NotUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + int rc, n; + n = nKey1