aboutsummaryrefslogtreecommitdiff
path: root/src/tokenize.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2004-05-27 13:35:19 +0000
committerdanielk1977 <danielk1977@noemail.net>2004-05-27 13:35:19 +0000
commit3fd0a736bfa81524e7bba6152e5b868c5925aba8 (patch)
treea185ccc46aeaa11fda65ee85f6073ff6a147481e /src/tokenize.c
parent30ccda10064df7a13249d500c6acc2f789585677 (diff)
downloadsqlite-3fd0a736bfa81524e7bba6152e5b868c5925aba8.tar.gz
sqlite-3fd0a736bfa81524e7bba6152e5b868c5925aba8.zip
A couple of test cases and fixes for blob literals. (CVS 1474)
FossilOrigin-Name: 6d552af67cf6fa6935373ba39de5c47ebf613eb9
Diffstat (limited to 'src/tokenize.c')
-rw-r--r--src/tokenize.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tokenize.c b/src/tokenize.c
index 122e61440..77d760003 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.71 2004/05/27 09:28:43 danielk1977 Exp $
+** $Id: tokenize.c,v 1.72 2004/05/27 13:35:20 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -377,14 +377,19 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
}
case 'x': case 'X': {
if( z[1]=='\'' || z[1]=='"' ){
- int delim = z[0];
- for(i=1; z[i]; i++){
+ int delim = z[1];
+ *tokenType = TK_BLOB;
+ for(i=2; z[i]; i++){
if( z[i]==delim ){
+ if( i%2 ) *tokenType = TK_ILLEGAL;
break;
}
+ if( !isxdigit(z[i]) ){
+ *tokenType = TK_ILLEGAL;
+ return i;
+ }
}
if( z[i] ) i++;
- *tokenType = TK_BLOB;
return i;
}
/* Otherwise fall through to the next case */