SQLite

Check-in [d8b4b0ef13]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8b4b0ef13dddbf527e7440e7343c458210dceac
User & Date: danielk1977 2005-02-01 02:13:29.000
Context
2005-02-01
03:09
Avoid allocating a vdbe in sqlite3FinishCoding() if one has not been allocated already. (CVS 2299) (check-in: eaf1866e4d user: danielk1977 tags: trunk)
02:13
Change to sqlite3AffinityType() to remove hex constants. (CVS 2298) (check-in: d8b4b0ef13 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: 4eca6c05ab user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/build.c.
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32







-
+







**     CREATE INDEX
**     DROP INDEX
**     creating ID lists
**     BEGIN TRANSACTION
**     COMMIT
**     ROLLBACK
**
** $Id: build.c,v 1.305 2005/02/01 01:21:55 danielk1977 Exp $
** $Id: build.c,v 1.306 2005/02/01 02:13:29 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** This routine is called when a new SQL statement is beginning to
** be parsed.  Initialize the pParse structure as needed.
881
882
883
884
885
886
887

888
889
890
891







892
893

894
895
896
897
898
899
900
881
882
883
884
885
886
887
888




889
890
891
892
893
894
895
896

897
898
899
900
901
902
903
904







+
-
-
-
-
+
+
+
+
+
+
+

-
+







  char aff = SQLITE_AFF_NUMERIC;
  const unsigned char *zIn = zType;
  const unsigned char *zEnd = (zIn+nType);

  while( zIn!=zEnd ){
    h = (h<<8) + sqlite3UpperToLower[*zIn];
    zIn++;
    if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){             /* CHAR */
    if     ( h==0x63686172 ) aff = SQLITE_AFF_TEXT;           /* CHAR */
    else if( h==0x636C6F62 ) aff = SQLITE_AFF_TEXT;           /* CLOB */
    else if( h==0x74657874 ) aff = SQLITE_AFF_TEXT;           /* TEXT */
    else if( h==0x626C6F62 && aff==SQLITE_AFF_NUMERIC ){      /* BLOB */
      aff = SQLITE_AFF_TEXT; 
    }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){       /* CLOB */
      aff = SQLITE_AFF_TEXT;
    }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){       /* TEXT */
      aff = SQLITE_AFF_TEXT;
    }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b')          /* BLOB */
        && aff==SQLITE_AFF_NUMERIC ){
      aff = SQLITE_AFF_NONE;
    }else if( (h&0x00FFFFFF)==0x00696E74 ){                   /* INT */
    }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){    /* INT */
      aff = SQLITE_AFF_INTEGER; 
      break;
    }
  }

  return aff;
}