aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-04 15:05:31 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-04 15:05:31 +0000
commit970535298acfe00937792e4e7d9d03b51fc26f76 (patch)
tree71eba26164e7da4d962e523da778ac21e32b4f91
parentfbe74f1a65b511f79b07b5e6a91479593a0e17bb (diff)
downloadsequelpro-970535298acfe00937792e4e7d9d03b51fc26f76.tar.gz
sequelpro-970535298acfe00937792e4e7d9d03b51fc26f76.tar.bz2
sequelpro-970535298acfe00937792e4e7d9d03b51fc26f76.zip
• fix for alias parsing if alias consists of only one single character
-rw-r--r--Source/SPTextView.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index d16992e4..a1797521 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -776,7 +776,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
// Check if found table name is known, if not parse for aliases
if(![allTables containsObject:[NSString stringWithFormat:@"%@%@%@", conID, SPUniqueSchemaDelimiter, tableName]]) {
NSString* currentQuery = [[self string] substringWithRange:[customQueryInstance currentQueryRange]];
- NSRange aliasRange = [currentQuery rangeOfRegex:[NSString stringWithFormat:@"(?i)\\s`?(\\S+?)`?\\s+(AS\\s+)?`?%@`?", tableName] capture:1L];
+ NSRange aliasRange = [currentQuery rangeOfRegex:[NSString stringWithFormat:@"(?i)\\s`?(\\S+?)`?\\s+(AS\\s+)?`?%@`?\\b", tableName] capture:1L];
if(aliasRange.length) {
NSString *alias = [[currentQuery substringWithRange:aliasRange] stringByReplacingOccurrencesOfString:@"``" withString:@"`"];
// If alias refers to db.table split it