From aa7d26a28f9609963478ffdebaf6b8ffcde32bcd Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 5 Mar 2013 23:59:02 +0000 Subject: - Fix an error parsing SQL inside an unterminated delimiter statement causing an off-by-one error in positioning, addressing Issue #1643 --- Source/SPSQLParser.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SPSQLParser.m b/Source/SPSQLParser.m index e0abf319..d95d964f 100644 --- a/Source/SPSQLParser.m +++ b/Source/SPSQLParser.m @@ -630,7 +630,7 @@ TO_BUFFER_STATE to_scan_string (const char *); if (supportDelimiters && [finalQuery isMatchedByRegex:@"(?i)^\\s*delimiter\\s+\\S+"]) finalQuery = nil; if ([finalQuery length]) - [resultsArray addObject:[NSValue valueWithRange:NSMakeRange(stringIndex, [string length] - stringIndex - delimiterLengthMinusOne)]]; + [resultsArray addObject:[NSValue valueWithRange:NSMakeRange(stringIndex, [string length] - stringIndex)]]; } return resultsArray; -- cgit v1.2.3