/ Check-in [d8b4b0ef]
Login

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

Overview
Comment:Change to sqlite3AffinityType() to remove hex constants. (CVS 2298)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8b4b0ef13dddbf527e7440e7343c458210dceac
User & Date: danielk1977 2005-02-01 02:13:29
Context
2005-02-01
03:09
Avoid allocating a vdbe in sqlite3FinishCoding() if one has not been allocated already. (CVS 2299) check-in: eaf1866e user: danielk1977 tags: trunk
02:13
Change to sqlite3AffinityType() to remove hex constants. (CVS 2298) check-in: d8b4b0ef user: danielk1977 tags: trunk
01:40
Tweaks to the keyword hash generator. Tried to make it a little faster. If nothing else, the keyword hash table is now a little smaller. (CVS 2297) check-in: 4eca6c05 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

    18     18   **     CREATE INDEX
    19     19   **     DROP INDEX
    20     20   **     creating ID lists
    21     21   **     BEGIN TRANSACTION
    22     22   **     COMMIT
    23     23   **     ROLLBACK
    24     24   **
    25         -** $Id: build.c,v 1.305 2005/02/01 01:21:55 danielk1977 Exp $
           25  +** $Id: build.c,v 1.306 2005/02/01 02:13:29 danielk1977 Exp $
    26     26   */
    27     27   #include "sqliteInt.h"
    28     28   #include <ctype.h>
    29     29   
    30     30   /*
    31     31   ** This routine is called when a new SQL statement is beginning to
    32     32   ** be parsed.  Initialize the pParse structure as needed.
................................................................................
   881    881     char aff = SQLITE_AFF_NUMERIC;
   882    882     const unsigned char *zIn = zType;
   883    883     const unsigned char *zEnd = (zIn+nType);
   884    884   
   885    885     while( zIn!=zEnd ){
   886    886       h = (h<<8) + sqlite3UpperToLower[*zIn];
   887    887       zIn++;
   888         -    if     ( h==0x63686172 ) aff = SQLITE_AFF_TEXT;           /* CHAR */
   889         -    else if( h==0x636C6F62 ) aff = SQLITE_AFF_TEXT;           /* CLOB */
   890         -    else if( h==0x74657874 ) aff = SQLITE_AFF_TEXT;           /* TEXT */
   891         -    else if( h==0x626C6F62 && aff==SQLITE_AFF_NUMERIC ){      /* BLOB */
          888  +    if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){             /* CHAR */
          889  +      aff = SQLITE_AFF_TEXT; 
          890  +    }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){       /* CLOB */
          891  +      aff = SQLITE_AFF_TEXT;
          892  +    }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){       /* TEXT */
          893  +      aff = SQLITE_AFF_TEXT;
          894  +    }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b')          /* BLOB */
          895  +        && aff==SQLITE_AFF_NUMERIC ){
   892    896         aff = SQLITE_AFF_NONE;
   893         -    }else if( (h&0x00FFFFFF)==0x00696E74 ){                   /* INT */
          897  +    }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){    /* INT */
   894    898         aff = SQLITE_AFF_INTEGER; 
   895    899         break;
   896    900       }
   897    901     }
   898    902   
   899    903     return aff;
   900    904   }