diff options
author | rowanbeentje <rowan@beent.je> | 2010-09-27 08:36:14 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-09-27 08:36:14 +0000 |
commit | 68a2f6250684d9bd51f6281c9bcbb20b10d26876 (patch) | |
tree | 37c6cd454520f54e66a4a08880e3328db383138a | |
parent | 92f1221ab8c8d7d4170f88c37ba02a7f32206424 (diff) | |
download | sequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.tar.gz sequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.tar.bz2 sequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.zip |
- Fix support for delimiters at the very end of a query string/file
-rw-r--r-- | Source/SPSQLParser.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPSQLParser.m b/Source/SPSQLParser.m index 8173170d..4cb0aaa4 100644 --- a/Source/SPSQLParser.m +++ b/Source/SPSQLParser.m @@ -765,14 +765,14 @@ TO_BUFFER_STATE to_scan_string (const char *); switch((unichar)(long)(*charAtIndex)(self, @selector(_charAtIndex:), currentStringIndex+3)) { case 'i': case 'I': - if([self isMatchedByRegex:@"^(delimiter[ \\t]+(\\S+))(?=\\s)" + if([self isMatchedByRegex:@"^(delimiter[ \\t]+(\\S+))(?=\\s|\\Z)" options:RKLCaseless inRange:NSMakeRange(currentStringIndex, stringLength - currentStringIndex) error:nil]) { // Delimiter command found. Extract the delimiter string itself - NSArray *delimiterCommandParts = [[self arrayOfCaptureComponentsMatchedByRegex:@"(?i)^(delimiter[ \\t]+(\\S+))(?=\\s)" + NSArray *delimiterCommandParts = [[self arrayOfCaptureComponentsMatchedByRegex:@"(?i)^(delimiter[ \\t]+(\\S+))(?=\\s|\\Z)" range:NSMakeRange(currentStringIndex, stringLength - currentStringIndex)] objectAtIndex:0]; if (delimiter) [delimiter release]; delimiter = [[NSString alloc] initWithString:[delimiterCommandParts objectAtIndex:2]]; |