mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
A couple of test cases and fixes for blob literals. (CVS 1474)
FossilOrigin-Name: 6d552af67cf6fa6935373ba39de5c47ebf613eb9
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user