diff options
author | drh <drh@noemail.net> | 2005-10-23 11:29:40 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-10-23 11:29:40 +0000 |
commit | eef8b55832eb53453bc81f7054e64aec004362df (patch) | |
tree | 03ee002062a7048622b0ad8cb33aa587dc1fc0d1 /src/tokenize.c | |
parent | d9cb6ac02f783873152877b77b0ac67f9c327008 (diff) | |
download | sqlite-eef8b55832eb53453bc81f7054e64aec004362df.tar.gz sqlite-eef8b55832eb53453bc81f7054e64aec004362df.zip |
Report an error if the input SQL contains an unterminated string.
Ticket #1497. (CVS 2751)
FossilOrigin-Name: c9c476dd836c49255eabc6cce83064974c079ce3
Diffstat (limited to 'src/tokenize.c')
-rw-r--r-- | src/tokenize.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/tokenize.c b/src/tokenize.c index fb5f266a4..457de9abb 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.107 2005/08/23 11:31:26 drh Exp $ +** $Id: tokenize.c,v 1.108 2005/10/23 11:29:40 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -196,9 +196,13 @@ static int getToken(const unsigned char *z, int *tokenType){ } } } - if( c ) i++; - *tokenType = TK_STRING; - return i; + if( c ){ + *tokenType = TK_STRING; + return i+1; + }else{ + *tokenType = TK_ILLEGAL; + return i; + } } case '.': { #ifndef SQLITE_OMIT_FLOATING_POINT |