mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-25 20:58:26 +03:00
Get the LIKE and GLOB operators working again on systems using the
EBCDIC character set. (CVS 4597) FossilOrigin-Name: 754298a74e3d889f3767daba058262613d20a601
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\sleaking\sdatabase\sconnection\sin\sthe\svacuum2\stest\sscript.\nTicket\s#2827.\s(CVS\s4596)
|
C Get\sthe\sLIKE\sand\sGLOB\soperators\sworking\sagain\son\ssystems\susing\sthe\nEBCDIC\scharacter\sset.\s(CVS\s4597)
|
||||||
D 2007-12-06T17:41:28
|
D 2007-12-07T18:39:05
|
||||||
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
|
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
|
||||||
F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
|
F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -93,7 +93,7 @@ F src/date.c 49c5a6d2de6c12000905b4d36868b07d3011bbf6
|
|||||||
F src/delete.c 034b87768c4135a22038a86a205f9d2d5f68a143
|
F src/delete.c 034b87768c4135a22038a86a205f9d2d5f68a143
|
||||||
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
|
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
|
||||||
F src/expr.c 8c32309dedd13b8ab220348eb90dc221ee0a5174
|
F src/expr.c 8c32309dedd13b8ab220348eb90dc221ee0a5174
|
||||||
F src/func.c 49f98cfe26b9ab507b96a34404295c4d89dfc620
|
F src/func.c a8548fbc55373505c077cfb57baa43c1e48b71d2
|
||||||
F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c
|
F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c
|
||||||
F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
|
F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
|
||||||
F src/insert.c a090c7258f2be707cca8f0cf376142f141621241
|
F src/insert.c a090c7258f2be707cca8f0cf376142f141621241
|
||||||
@@ -597,7 +597,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
|
|||||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||||
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
||||||
P f015a38771d98996366d66787b9b066f9ef5e248
|
P f29deb5f0bfcd6d00795aeb66dece717a6c1768a
|
||||||
R e9e837a4042d6084a729569c423b2c7a
|
R 914411460f2d77a89cfca0420655917f
|
||||||
U drh
|
U drh
|
||||||
Z 08cf3b638db479f84c486346a51305c0
|
Z dab0e24c447ca0aa1c74119b9b014915
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
f29deb5f0bfcd6d00795aeb66dece717a6c1768a
|
754298a74e3d889f3767daba058262613d20a601
|
||||||
25
src/func.c
25
src/func.c
@@ -16,7 +16,7 @@
|
|||||||
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
|
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
|
||||||
** All other code has file scope.
|
** All other code has file scope.
|
||||||
**
|
**
|
||||||
** $Id: func.c,v 1.177 2007/11/28 22:36:41 drh Exp $
|
** $Id: func.c,v 1.178 2007/12/07 18:39:05 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -405,6 +405,19 @@ struct compareInfo {
|
|||||||
u8 noCase;
|
u8 noCase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
** For LIKE and GLOB matching on EBCDIC machines, assume that every
|
||||||
|
** character is exactly one byte in size. Also, all characters are
|
||||||
|
** able to participate in upper-case-to-lower-case mappings in EBCDIC
|
||||||
|
** whereas only characters less than 0x80 do in ASCII.
|
||||||
|
*/
|
||||||
|
#if defined(SQLITE_EBCDIC)
|
||||||
|
# define sqlite3Utf8Read(A,B,C) (*(A++))
|
||||||
|
# define UpperToLower(A) A = sqlite3UpperToLower[A]
|
||||||
|
#else
|
||||||
|
# define UpperToLower(A) if( A<0x80 ){ A = sqlite3UpperToLower[A]; }
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct compareInfo globInfo = { '*', '?', '[', 0 };
|
static const struct compareInfo globInfo = { '*', '?', '[', 0 };
|
||||||
/* The correct SQL-92 behavior is for the LIKE operator to ignore
|
/* The correct SQL-92 behavior is for the LIKE operator to ignore
|
||||||
** case. Thus 'a' LIKE 'A' would be true. */
|
** case. Thus 'a' LIKE 'A' would be true. */
|
||||||
@@ -481,11 +494,11 @@ static int patternCompare(
|
|||||||
}
|
}
|
||||||
while( (c2 = sqlite3Utf8Read(zString,0,&zString))!=0 ){
|
while( (c2 = sqlite3Utf8Read(zString,0,&zString))!=0 ){
|
||||||
if( noCase ){
|
if( noCase ){
|
||||||
c2 = c2<0x80 ? sqlite3UpperToLower[c2] : c2;
|
UpperToLower(c2);
|
||||||
c = c<0x80 ? sqlite3UpperToLower[c] : c;
|
UpperToLower(c);
|
||||||
while( c2 != 0 && c2 != c ){
|
while( c2 != 0 && c2 != c ){
|
||||||
c2 = sqlite3Utf8Read(zString, 0, &zString);
|
c2 = sqlite3Utf8Read(zString, 0, &zString);
|
||||||
if( c2<0x80 ) c2 = sqlite3UpperToLower[c2];
|
UpperToLower(c2);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
while( c2 != 0 && c2 != c ){
|
while( c2 != 0 && c2 != c ){
|
||||||
@@ -537,8 +550,8 @@ static int patternCompare(
|
|||||||
}else{
|
}else{
|
||||||
c2 = sqlite3Utf8Read(zString, 0, &zString);
|
c2 = sqlite3Utf8Read(zString, 0, &zString);
|
||||||
if( noCase ){
|
if( noCase ){
|
||||||
c = c<0x80 ? sqlite3UpperToLower[c] : c;
|
UpperToLower(c);
|
||||||
c2 = c2<0x80 ? sqlite3UpperToLower[c2] : c2;
|
UpperToLower(c2);
|
||||||
}
|
}
|
||||||
if( c!=c2 ){
|
if( c!=c2 ){
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user