/ Check-in [6adbe91e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a macro in func.c that causes problems for the amalgamation. (CVS 4605)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6adbe91efffc6b3f53dae87494430ede61d40ecc
User & Date: drh 2007-12-10 18:07:21
Context
2007-12-10
18:51
Further modifications to do with ORDER BY and compound SELECT queries. Related to ticket #2822. (CVS 4606) check-in: 0d9b0e6e user: danielk1977 tags: trunk
18:07
Fix a macro in func.c that causes problems for the amalgamation. (CVS 4605) check-in: 6adbe91e user: drh tags: trunk
17:55
Fix a bug in the compilation procedures for the Linux shared library that includes the TCL bindings. (CVS 4604) check-in: d384810a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

    12     12   ** This file contains the C functions that implement various SQL
    13     13   ** functions of SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: func.c,v 1.178 2007/12/07 18:39:05 drh Exp $
           19  +** $Id: func.c,v 1.179 2007/12/10 18:07:21 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   #include <ctype.h>
    23     23   #include <stdlib.h>
    24     24   #include <assert.h>
    25     25   #include "vdbeInt.h"
    26     26   
................................................................................
   409    409   ** For LIKE and GLOB matching on EBCDIC machines, assume that every
   410    410   ** character is exactly one byte in size.  Also, all characters are
   411    411   ** able to participate in upper-case-to-lower-case mappings in EBCDIC
   412    412   ** whereas only characters less than 0x80 do in ASCII.
   413    413   */
   414    414   #if defined(SQLITE_EBCDIC)
   415    415   # define sqlite3Utf8Read(A,B,C)  (*(A++))
   416         -# define UpperToLower(A)         A = sqlite3UpperToLower[A]
          416  +# define GlogUpperToLower(A)     A = sqlite3UpperToLower[A]
   417    417   #else
   418         -# define UpperToLower(A)         if( A<0x80 ){ A = sqlite3UpperToLower[A]; }
          418  +# define GlogUpperToLower(A)     if( A<0x80 ){ A = sqlite3UpperToLower[A]; }
   419    419   #endif
   420    420   
   421    421   static const struct compareInfo globInfo = { '*', '?', '[', 0 };
   422    422   /* The correct SQL-92 behavior is for the LIKE operator to ignore
   423    423   ** case.  Thus  'a' LIKE 'A' would be true. */
   424    424   static const struct compareInfo likeInfoNorm = { '%', '_',   0, 1 };
   425    425   /* If SQLITE_CASE_SENSITIVE_LIKE is defined, then the LIKE operator
................................................................................
   490    490           while( *zString && patternCompare(&zPattern[-1],zString,pInfo,esc)==0 ){
   491    491             SQLITE_SKIP_UTF8(zString);
   492    492           }
   493    493           return *zString!=0;
   494    494         }
   495    495         while( (c2 = sqlite3Utf8Read(zString,0,&zString))!=0 ){
   496    496           if( noCase ){
   497         -          UpperToLower(c2);
   498         -          UpperToLower(c);
          497  +          GlogUpperToLower(c2);
          498  +          GlogUpperToLower(c);
   499    499             while( c2 != 0 && c2 != c ){
   500    500               c2 = sqlite3Utf8Read(zString, 0, &zString);
   501         -            UpperToLower(c2);
          501  +            GlogUpperToLower(c2);
   502    502             }
   503    503           }else{
   504    504             while( c2 != 0 && c2 != c ){
   505    505               c2 = sqlite3Utf8Read(zString, 0, &zString);
   506    506             }
   507    507           }
   508    508           if( c2==0 ) return 0;
................................................................................
   546    546           return 0;
   547    547         }
   548    548       }else if( esc==c && !prevEscape ){
   549    549         prevEscape = 1;
   550    550       }else{
   551    551         c2 = sqlite3Utf8Read(zString, 0, &zString);
   552    552         if( noCase ){
   553         -        UpperToLower(c);
   554         -        UpperToLower(c2);
          553  +        GlogUpperToLower(c);
          554  +        GlogUpperToLower(c2);
   555    555         }
   556    556         if( c!=c2 ){
   557    557           return 0;
   558    558         }
   559    559         prevEscape = 0;
   560    560       }
   561    561     }