aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-05-08 17:27:18 +0000
committerdrh <drh@noemail.net>2019-05-08 17:27:18 +0000
commit08652b5ea00316539c913fc936e2966c8d58d283 (patch)
tree40cfa96c99f4f74ca319aff933574eebcdf95ce0 /src
parenta7be6f355c3e474b7da48ea5a7e7fcff6d6bed47 (diff)
downloadsqlite-08652b5ea00316539c913fc936e2966c8d58d283.tar.gz
sqlite-08652b5ea00316539c913fc936e2966c8d58d283.zip
Provide the SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA compile-time option to
omit the case_sensitive_like pragma. This change, in combination with documentation changes, is the current solution to ticket [a340eef47b0cad5]. FossilOrigin-Name: eabe7f2d4ff0e0dd868dcab7ec1d4a9168a25f80d3a52f0eeea2f90bd33782f2
Diffstat (limited to 'src')
-rw-r--r--src/func.c7
-rw-r--r--src/pragma.c2
-rw-r--r--src/pragma.h2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/func.c b/src/func.c
index dae85d60a..15f648ab5 100644
--- a/src/func.c
+++ b/src/func.c
@@ -1811,9 +1811,9 @@ static void setLikeOptFlag(sqlite3 *db, const char *zName, u8 flagVal){
}
/*
-** Register the built-in LIKE and GLOB functions. The caseSensitive
+** Re-register the built-in LIKE functions. The caseSensitive
** parameter determines whether or not the LIKE operator is case
-** sensitive. GLOB is always case sensitive.
+** sensitive.
*/
void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
struct compareInfo *pInfo;
@@ -1824,9 +1824,6 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){
}
sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0, 0, 0);
sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0, 0, 0);
- sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8,
- (struct compareInfo*)&globInfo, likeFunc, 0, 0, 0, 0, 0);
- setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE);
setLikeOptFlag(db, "like",
caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE);
}
diff --git a/src/pragma.c b/src/pragma.c
index 1dcd21400..90ecdfcc5 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -1421,6 +1421,7 @@ void sqlite3Pragma(
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
+#ifndef SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA
/* Reinstall the LIKE and GLOB functions. The variant of LIKE
** used will be case sensitive or not depending on the RHS.
*/
@@ -1430,6 +1431,7 @@ void sqlite3Pragma(
}
}
break;
+#endif /* SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA */
#ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX
# define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100
diff --git a/src/pragma.h b/src/pragma.h
index c156e3a4f..d72e8cc94 100644
--- a/src/pragma.h
+++ b/src/pragma.h
@@ -178,11 +178,13 @@ static const PragmaName aPragmaName[] = {
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
+#if !defined(SQLITE_OMIT_CASE_SENSITIVE_LIKE_PRAGMA)
{/* zName: */ "case_sensitive_like",
/* ePragTyp: */ PragTyp_CASE_SENSITIVE_LIKE,
/* ePragFlg: */ PragFlg_NoColumns,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
+#endif
{/* zName: */ "cell_size_check",
/* ePragTyp: */ PragTyp_FLAG,
/* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,