/ Check-in [9211e14c]
Login

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

Overview
Comment:Code cleanup in build.c. (CVS 1265)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9211e14cf81f4de125bad246d8a289786f2854aa
User & Date: drh 2004-02-22 18:56:49
Context
2004-02-22
20:05
Use sqliteVdbeOp3 instead of sqliteVdbeChangeP3 where applicable. (CVS 1266) check-in: 51f1e8f7 user: drh tags: trunk
18:56
Code cleanup in build.c. (CVS 1265) check-in: 9211e14c user: drh tags: trunk
18:40
Use sqliteErrorMsg instead of sqliteSetString whereever practical. (CVS 1264) check-in: 69aac043 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

    19     19   **     DROP INDEX
    20     20   **     creating ID lists
    21     21   **     BEGIN TRANSACTION
    22     22   **     COMMIT
    23     23   **     ROLLBACK
    24     24   **     PRAGMA
    25     25   **
    26         -** $Id: build.c,v 1.172 2004/02/22 18:40:57 drh Exp $
           26  +** $Id: build.c,v 1.173 2004/02/22 18:56:49 drh Exp $
    27     27   */
    28     28   #include "sqliteInt.h"
    29     29   #include <ctype.h>
    30     30   
    31     31   /*
    32     32   ** This routine is called when a new SQL statement is beginning to
    33     33   ** be parsed.  Check to see if the schema for the database needs
................................................................................
   724    724   ** The collation type is text (SQLITE_SO_TEXT) if the type
   725    725   ** name contains the character stream "text" or "blob" or
   726    726   ** "clob".  Any other type name is collated as numeric
   727    727   ** (SQLITE_SO_NUM).
   728    728   */
   729    729   int sqliteCollateType(const char *zType, int nType){
   730    730     int i;
   731         -  for(i=0; i<nType-1; i++){
   732         -    switch( zType[i] ){
   733         -      case 'b':
   734         -      case 'B': {
   735         -        if( i<nType-3 && sqliteStrNICmp(&zType[i],"blob",4)==0 ){
   736         -          return SQLITE_SO_TEXT;
   737         -        }
   738         -        break;
   739         -      }
   740         -      case 'c':
   741         -      case 'C': {
   742         -        if( i<nType-3 && (sqliteStrNICmp(&zType[i],"char",4)==0 ||
   743         -                           sqliteStrNICmp(&zType[i],"clob",4)==0)
   744         -        ){
   745         -          return SQLITE_SO_TEXT;
   746         -        }
   747         -        break;
   748         -      }
   749         -      case 'x':
   750         -      case 'X': {
   751         -        if( i>=2 && sqliteStrNICmp(&zType[i-2],"text",4)==0 ){
   752         -          return SQLITE_SO_TEXT;
   753         -        }
   754         -        break;
   755         -      }
   756         -      default: {
   757         -        break;
   758         -      }
          731  +  for(i=0; i<nType-3; i++){
          732  +    int c = *(zType++) | 0x60;
          733  +    if( (c=='b' || c=='c') && sqliteStrNICmp(zType, "lob", 3)==0 ){
          734  +      return SQLITE_SO_TEXT;
          735  +    }
          736  +    if( c=='c' && sqliteStrNICmp(zType, "har", 3)==0 ){
          737  +      return SQLITE_SO_TEXT;
          738  +    }
          739  +    if( c=='t' && sqliteStrNICmp(zType, "ext", 3)==0 ){
          740  +      return SQLITE_SO_TEXT;
   759    741       }
   760    742     }
   761    743     return SQLITE_SO_NUM;
   762    744   }
   763    745   
   764    746   /*
   765    747   ** This routine is called by the parser while in the middle of