diff options
author | drh <drh@noemail.net> | 2005-07-08 13:53:21 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-07-08 13:53:21 +0000 |
commit | 70031fa396c6e64d10f9cddb4ea2deecd8ecaf63 (patch) | |
tree | 46ff357130c03af304018a1f00e89607c1f2afc0 /src | |
parent | a01f79df494b0dbf05e142318670ea0762db1156 (diff) | |
download | sqlite-70031fa396c6e64d10f9cddb4ea2deecd8ecaf63.tar.gz sqlite-70031fa396c6e64d10f9cddb4ea2deecd8ecaf63.zip |
Add the SQLITE_CASE_SENSITIVE_LIKE compile-time option. (CVS 2539)
FossilOrigin-Name: b72bff81f9937378417a0af0610d8558279b67a7
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/func.c b/src/func.c index 7e8feadc0..dd2a0cda6 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.100 2005/06/25 18:42:14 drh Exp $ +** $Id: func.c,v 1.101 2005/07/08 13:53:22 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -309,7 +309,15 @@ struct compareInfo { u8 noCase; }; static const struct compareInfo globInfo = { '*', '?', '[', 0 }; -static const struct compareInfo likeInfo = { '%', '_', 0, 1 }; +#ifndef SQLITE_CASE_SENSITIVE_LIKE + /* The correct SQL-92 behavior is for the LIKE operator to ignore + ** case. Thus 'a' LIKE 'A' would be true. */ + static const struct compareInfo likeInfo = { '%', '_', 0, 1 }; +#else + /* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator + ** is case sensitive causing 'a' LIKE 'A' to be false */ + static const struct compareInfo likeInfo = { '%', '_', 0, 0 }; +#endif /* ** X is a pointer to the first byte of a UTF-8 character. Increment |