diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-26 08:59:23 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-26 08:59:23 +0000 |
commit | 3417a7e59c8146d0c1f80b7190cc113db71300f6 (patch) | |
tree | 6c2169d424d803fb648ddeb976b9cda499734160 | |
parent | c07a014d36c1ed5cc157abb4725e41d91bdfa304 (diff) | |
download | sequelpro-3417a7e59c8146d0c1f80b7190cc113db71300f6.tar.gz sequelpro-3417a7e59c8146d0c1f80b7190cc113db71300f6.tar.bz2 sequelpro-3417a7e59c8146d0c1f80b7190cc113db71300f6.zip |
• fixed issue for sorting the Custom Query table via clicking at the header if no ORDER BY statement was found in the original statement
-rw-r--r-- | Source/CustomQuery.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 8ceb822c..6bb65056 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1305,9 +1305,11 @@ //make queryString and perform query if([queryString isMatchedByRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+(\\s+(DESC|ASC))?(\\s|\\n)+(?=(LI|PR|IN|FO|LO))"]) [queryString replaceOccurrencesOfRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?(\\s|\\n)+(?=(LI|PR|IN|FO|LO))" withString:newOrder]; - else + else if ([queryString isMatchedByRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?"]) [queryString replaceOccurrencesOfRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?" withString:newOrder]; - + else + [queryString appendFormat:@" %@", newOrder]; + tableReloadAfterEdting = YES; [self performQueries:[NSArray arrayWithObject:queryString]]; |