aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-12-02 20:40:26 +0000
committerdrh <drh@noemail.net>2015-12-02 20:40:26 +0000
commit1bb15fc973f5b1b472897095f629abcc663bd453 (patch)
tree4eda31846a69354eb5ba5ff9dc91602a18d942ac /src/func.c
parent769dc6e2a22b3104583ad357b01f31a22e146a5c (diff)
parentf7ce4291a94573cdb04e5f3fcf59ed9e69226479 (diff)
downloadsqlite-1bb15fc973f5b1b472897095f629abcc663bd453.tar.gz
sqlite-1bb15fc973f5b1b472897095f629abcc663bd453.zip
Merge recent enhancements from trunk.
FossilOrigin-Name: d1a1278d7f3306536dc9cbd8fb300898f1e373e8
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/func.c b/src/func.c
index 8ea116932..3fbd2b736 100644
--- a/src/func.c
+++ b/src/func.c
@@ -764,6 +764,13 @@ int sqlite3_strglob(const char *zGlobPattern, const char *zString){
}
/*
+** The sqlite3_strlike() interface.
+*/
+int sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){
+ return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0;
+}
+
+/*
** Count the number of times that the LIKE operator (or GLOB which is
** just a variation of LIKE) gets called. This is used for testing
** only.
@@ -795,6 +802,17 @@ static void likeFunc(
int nPat;
sqlite3 *db = sqlite3_context_db_handle(context);
+#ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
+ if( sqlite3_value_type(argv[0])==SQLITE_BLOB
+ || sqlite3_value_type(argv[1])==SQLITE_BLOB
+ ){
+#ifdef SQLITE_TEST
+ sqlite3_like_count++;
+#endif
+ sqlite3_result_int(context, 0);
+ return;
+ }
+#endif
zB = sqlite3_value_text(argv[0]);
zA = sqlite3_value_text(argv[1]);