/ Check-in [f1534489]
Login

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

Overview
Comment:Change the tokenizer to ignore C-style comments /*...*/ in accordance with SQL99. (CVS 731)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f1534489484afdb835ad8e6f97909fbe76dbe414
User & Date: drh 2002-08-27 14:28:30
Context
2002-08-28
03:00
Slightly faster INSERTs from a SELECT by avoiding an intermediate table. But it didn't make nearly as much difference as I had hoped. (CVS 732) check-in: 723362e7 user: drh tags: trunk
2002-08-27
14:28
Change the tokenizer to ignore C-style comments /*...*/ in accordance with SQL99. (CVS 731) check-in: f1534489 user: drh tags: trunk
2002-08-26
19:55
Fix for ticket #142: Make sure we get the correct sort order even when the columns being sorted contain NULLs. (CVS 730) check-in: 45847390 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/tokenize.c.

    11     11   *************************************************************************
    12     12   ** An tokenizer for SQL
    13     13   **
    14     14   ** This file contains C code that splits an SQL input string up into
    15     15   ** individual tokens and sends those tokens one-by-one over to the
    16     16   ** parser for analysis.
    17     17   **
    18         -** $Id: tokenize.c,v 1.48 2002/08/24 18:24:56 drh Exp $
           18  +** $Id: tokenize.c,v 1.49 2002/08/27 14:28:30 drh Exp $
    19     19   */
    20     20   #include "sqliteInt.h"
    21     21   #include "os.h"
    22     22   #include <ctype.h>
    23     23   #include <stdlib.h>
    24     24   
    25     25   /*
................................................................................
   250    250         return 1;
   251    251       }
   252    252       case '*': {
   253    253         *tokenType = TK_STAR;
   254    254         return 1;
   255    255       }
   256    256       case '/': {
          257  +      if( z[1]!='*' || z[2]==0 ){
   257    258         *tokenType = TK_SLASH;
   258    259         return 1;
          260  +      }
          261  +      for(i=3; z[i] && (z[i]!='/' || z[i-1]!='*'); i++){}
          262  +      if( z[i] ) i++;
          263  +      *tokenType = TK_COMMENT;
          264  +      return i;
   259    265       }
   260    266       case '%': {
   261    267         *tokenType = TK_REM;
   262    268         return 1;
   263    269       }
   264    270       case '=': {
   265    271         *tokenType = TK_EQ;