diff options
author | drh <drh@noemail.net> | 2005-08-28 17:00:23 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-08-28 17:00:23 +0000 |
commit | d64fe2f374f7a278bff67df9968f939b60faa222 (patch) | |
tree | 33eb0e4d64571066d5f3b49b5955b714c5292f3e /src/sqliteInt.h | |
parent | bfd6b03554bcc82881c433c0572c4ebe9a81798a (diff) | |
download | sqlite-d64fe2f374f7a278bff67df9968f939b60faa222.tar.gz sqlite-d64fe2f374f7a278bff67df9968f939b60faa222.zip |
The LIKE optimization does the right thing when collating sequences are
present. LIKE expressions where the left-hand side has COLLATE NOCASE
are optimized in the default case. (CVS 2637)
FossilOrigin-Name: ef84ff795c85e9d28f1cac84ff42d8d4ef84cfc4
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 180c0e287..dba03e1f1 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.403 2005/08/19 00:14:42 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.404 2005/08/28 17:00:23 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -511,7 +511,8 @@ struct FuncDef { /* ** Possible values for FuncDef.flags */ -#define SQLITE_FUNC_LIKEOPT 0x01 /* Candidate for the LIKE optimization */ +#define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ +#define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ /* ** information about each column of an SQL table is held in an instance @@ -551,11 +552,20 @@ struct Column { struct CollSeq { char *zName; /* Name of the collating sequence, UTF-8 encoded */ u8 enc; /* Text encoding handled by xCmp() */ + u8 type; /* One of the SQLITE_COLL_... values below */ void *pUser; /* First argument to xCmp() */ int (*xCmp)(void*,int, const void*, int, const void*); }; /* +** Allowed values of CollSeq flags: +*/ +#define SQLITE_COLL_BINARY 1 /* The default memcmp() collating sequence */ +#define SQLITE_COLL_NOCASE 2 /* The built-in NOCASE collating sequence */ +#define SQLITE_COLL_REVERSE 3 /* The built-in REVERSE collating sequence */ +#define SQLITE_COLL_USER 0 /* Any other user-defined collating sequence */ + +/* ** A sort order can be either ASC or DESC. */ #define SQLITE_SO_ASC 0 /* Sort in ascending order */ @@ -1583,7 +1593,7 @@ int sqlite3FindDb(sqlite3*, Token*); void sqlite3AnalysisLoad(sqlite3*,int iDB); void sqlite3DefaultRowEst(Index*); void sqlite3RegisterLikeFunctions(sqlite3*, int); -int sqlite3IsLikeFunction(sqlite3*,Expr*,char*); +int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*); #ifdef SQLITE_SSE #include "sseInt.h" |